pre-commit fixes

This commit is contained in:
Dan Halbert 2023-08-14 00:47:22 -04:00
parent 2171e67c1b
commit d582407b06
141 changed files with 800 additions and 805 deletions

View File

@ -20,3 +20,7 @@ deques
extint extint
shs shs
pass-thru pass-thru
numer
arithmetics
ftbfs
straightaway

View File

@ -228,4 +228,3 @@ CFLAGS_MOD += -DMICROPY_PY_BTREE=1
$(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter $(BTREE_DEFS) $(BUILD)/$(BTREE_DIR)/%.o: CFLAGS += -Wno-old-style-definition -Wno-sign-compare -Wno-unused-parameter $(BTREE_DEFS)
$(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS) $(BUILD)/extmod/modbtree.o: CFLAGS += $(BTREE_DEFS)
endif endif

View File

@ -29,7 +29,7 @@
#include "py/misc.h" // For MP_STRINGIFY. #include "py/misc.h" // For MP_STRINGIFY.
#include "py/mpconfig.h" #include "py/mpconfig.h"
// Preprocessor directives indentifying the platform. // Preprocessor directives identifying the platform.
// The (u)platform module itself is guarded by MICROPY_PY_UPLATFORM, see the // The (u)platform module itself is guarded by MICROPY_PY_UPLATFORM, see the
// .c file, but these are made available because they're generally usable. // .c file, but these are made available because they're generally usable.
// TODO: Add more architectures, compilers and libraries. // TODO: Add more architectures, compilers and libraries.

View File

@ -39,7 +39,7 @@
#include "lib/re1.5/re1.5.h" #include "lib/re1.5/re1.5.h"
//CIRCUITPY // CIRCUITPY
#if MICROPY_PY_URE_DEBUG #if MICROPY_PY_URE_DEBUG
#define FLAG_DEBUG 0x1000 #define FLAG_DEBUG 0x1000
#endif #endif

View File

@ -139,6 +139,10 @@ msgstr ""
msgid "%q index out of range" msgid "%q index out of range"
msgstr "" msgstr ""
#: py/obj.c
msgid "%q indices must be integers, not %s"
msgstr ""
#: shared-module/bitbangio/SPI.c #: shared-module/bitbangio/SPI.c
msgid "%q init failed" msgid "%q init failed"
msgstr "" msgstr ""
@ -214,7 +218,7 @@ msgstr ""
msgid "%q must be of type %q or %q, not %q" msgid "%q must be of type %q or %q, not %q"
msgstr "" msgstr ""
#: py/argcheck.c py/obj.c py/objstrunicode.c shared-module/synthio/__init__.c #: py/argcheck.c py/objstrunicode.c shared-module/synthio/__init__.c
msgid "%q must be of type %q, not %q" msgid "%q must be of type %q, not %q"
msgstr "" msgstr ""
@ -417,6 +421,10 @@ msgstr ""
msgid "'yield' outside function" msgid "'yield' outside function"
msgstr "" msgstr ""
#: py/compile.c
msgid "* arg after **"
msgstr ""
#: py/compile.c #: py/compile.c
msgid "*x must be assignment target" msgid "*x must be assignment target"
msgstr "" msgstr ""
@ -840,10 +848,6 @@ msgstr ""
msgid "Coordinate arrays types have different sizes" msgid "Coordinate arrays types have different sizes"
msgstr "" msgstr ""
#: py/persistentcode.c
msgid "Corrupt .mpy file"
msgstr ""
#: ports/espressif/common-hal/neopixel_write/__init__.c #: ports/espressif/common-hal/neopixel_write/__init__.c
msgid "Could not retrieve clock" msgid "Could not retrieve clock"
msgstr "" msgstr ""
@ -1138,12 +1142,6 @@ msgstr ""
msgid "In-buffer elements must be <= 4 bytes long" msgid "In-buffer elements must be <= 4 bytes long"
msgstr "" 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 #: shared-bindings/_pew/PewPew.c
msgid "Incorrect buffer size" msgid "Incorrect buffer size"
msgstr "" msgstr ""
@ -1490,7 +1488,7 @@ msgstr ""
msgid "No in or out in program" msgid "No in or out in program"
msgstr "" msgstr ""
#: shared-bindings/time/__init__.c #: py/objint.c shared-bindings/time/__init__.c
msgid "No long integer support" msgid "No long integer support"
msgstr "" msgstr ""
@ -2498,6 +2496,10 @@ msgstr ""
msgid "array/bytes required on right side" msgid "array/bytes required on right side"
msgstr "" msgstr ""
#: py/asmxtensa.c
msgid "asm overflow"
msgstr ""
#: extmod/ulab/code/numpy/numerical.c #: extmod/ulab/code/numpy/numerical.c
msgid "attempt to get (arg)min/(arg)max of empty sequence" msgid "attempt to get (arg)min/(arg)max of empty sequence"
msgstr "" msgstr ""
@ -2587,6 +2589,10 @@ msgstr ""
msgid "buffer too small for requested bytes" msgid "buffer too small for requested bytes"
msgstr "" msgstr ""
#: py/emitbc.c
msgid "bytecode overflow"
msgstr ""
#: py/objarray.c #: py/objarray.c
msgid "bytes length not a multiple of item size" msgid "bytes length not a multiple of item size"
msgstr "" msgstr ""
@ -2632,7 +2638,7 @@ msgstr ""
msgid "can't cancel self" msgid "can't cancel self"
msgstr "" msgstr ""
#: py/obj.c py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c #: py/objint.c py/runtime.c shared-module/adafruit_pixelbuf/PixelBuf.c
msgid "can't convert %q to %q" msgid "can't convert %q to %q"
msgstr "" msgstr ""
@ -2641,6 +2647,11 @@ msgstr ""
msgid "can't convert %s to complex" msgid "can't convert %s to complex"
msgstr "" msgstr ""
#: py/obj.c
#, c-format
msgid "can't convert %s to float"
msgstr ""
#: py/objstr.c #: py/objstr.c
msgid "can't convert '%q' object to %q implicitly" msgid "can't convert '%q' object to %q implicitly"
msgstr "" msgstr ""
@ -2650,11 +2661,11 @@ msgid "can't convert complex to float"
msgstr "" msgstr ""
#: py/obj.c #: py/obj.c
msgid "can't convert to %q" msgid "can't convert to complex"
msgstr "" msgstr ""
#: py/obj.c #: py/obj.c
msgid "can't convert to complex" msgid "can't convert to float"
msgstr "" msgstr ""
#: py/runtime.c #: py/runtime.c
@ -2681,14 +2692,6 @@ msgstr ""
msgid "can't do truncated division of a complex number" msgid "can't do truncated division of a complex number"
msgstr "" msgstr ""
#: py/compile.c
msgid "can't have multiple **x"
msgstr ""
#: py/compile.c
msgid "can't have multiple *x"
msgstr ""
#: py/emitnative.c #: py/emitnative.c
msgid "can't implicitly convert '%q' to 'bool'" msgid "can't implicitly convert '%q' to 'bool'"
msgstr "" msgstr ""
@ -2743,6 +2746,10 @@ msgid ""
"can't switch from manual field specification to automatic field numbering" "can't switch from manual field specification to automatic field numbering"
msgstr "" msgstr ""
#: extmod/moduasyncio.c
msgid "can't wait"
msgstr ""
#: extmod/ulab/code/ndarray.c #: extmod/ulab/code/ndarray.c
msgid "cannot assign new shape" msgid "cannot assign new shape"
msgstr "" msgstr ""
@ -2839,10 +2846,6 @@ msgstr ""
msgid "compression header" msgid "compression header"
msgstr "" msgstr ""
#: py/parse.c
msgid "constant must be an integer"
msgstr ""
#: py/emitnative.c #: py/emitnative.c
msgid "conversion to object" msgid "conversion to object"
msgstr "" msgstr ""
@ -3179,7 +3182,11 @@ msgid "import * not at module level"
msgstr "" msgstr ""
#: py/persistentcode.c #: py/persistentcode.c
msgid "incompatible native .mpy architecture" msgid "incompatible .mpy arch"
msgstr ""
#: py/persistentcode.c
msgid "incompatible .mpy file"
msgstr "" msgstr ""
#: py/objstr.c #: py/objstr.c
@ -3208,6 +3215,10 @@ msgstr ""
msgid "index out of range" msgid "index out of range"
msgstr "" msgstr ""
#: py/obj.c
msgid "indices must be integers"
msgstr ""
#: extmod/ulab/code/ndarray.c #: extmod/ulab/code/ndarray.c
msgid "indices must be integers, slices, or Boolean lists" msgid "indices must be integers, slices, or Boolean lists"
msgstr "" msgstr ""
@ -3341,10 +3352,6 @@ msgstr ""
msgid "invalid exception" msgid "invalid exception"
msgstr "" msgstr ""
#: extmod/modframebuf.c
msgid "invalid format"
msgstr ""
#: py/objstr.c #: py/objstr.c
msgid "invalid format specifier" msgid "invalid format specifier"
msgstr "" msgstr ""
@ -3406,10 +3413,6 @@ msgstr ""
msgid "keyword argument(s) not yet implemented - use normal args instead" msgid "keyword argument(s) not yet implemented - use normal args instead"
msgstr "" msgstr ""
#: py/bc.c
msgid "keywords must be strings"
msgstr ""
#: py/emitinlinethumb.c py/emitinlinextensa.c #: py/emitinlinethumb.c py/emitinlinextensa.c
msgid "label '%q' not defined" msgid "label '%q' not defined"
msgstr "" msgstr ""
@ -3634,14 +3637,6 @@ msgstr ""
msgid "non-hex digit found" msgid "non-hex digit found"
msgstr "" msgstr ""
#: py/compile.c
msgid "non-keyword arg after */**"
msgstr ""
#: py/compile.c
msgid "non-keyword arg after keyword arg"
msgstr ""
#: ports/nrf/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c
msgid "non-zero timeout must be > 0.01" msgid "non-zero timeout must be > 0.01"
msgstr "" msgstr ""
@ -3654,6 +3649,10 @@ msgstr ""
msgid "not a 128-bit UUID" msgid "not a 128-bit UUID"
msgstr "" msgstr ""
#: py/parse.c
msgid "not a constant"
msgstr ""
#: py/objstr.c #: py/objstr.c
msgid "not all arguments converted during string formatting" msgid "not all arguments converted during string formatting"
msgstr "" msgstr ""
@ -3892,6 +3891,14 @@ msgstr ""
msgid "port must be >= 0" msgid "port must be >= 0"
msgstr "" msgstr ""
#: py/compile.c
msgid "positional arg after **"
msgstr ""
#: py/compile.c
msgid "positional arg after keyword arg"
msgstr ""
#: py/objint_mpz.c #: py/objint_mpz.c
msgid "pow() 3rd argument cannot be 0" msgid "pow() 3rd argument cannot be 0"
msgstr "" msgstr ""
@ -3920,6 +3927,11 @@ msgstr ""
msgid "relative import" msgid "relative import"
msgstr "" msgstr ""
#: py/obj.c
#, c-format
msgid "requested length %d but object has length %d"
msgstr ""
#: extmod/ulab/code/ndarray_operators.c #: extmod/ulab/code/ndarray_operators.c
msgid "results cannot be cast to specified type" msgid "results cannot be cast to specified type"
msgstr "" msgstr ""
@ -4114,6 +4126,10 @@ msgstr ""
msgid "tobytes can be invoked for dense arrays only" msgid "tobytes can be invoked for dense arrays only"
msgstr "" msgstr ""
#: py/compile.c
msgid "too many args"
msgstr ""
#: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c #: extmod/ulab/code/ndarray.c extmod/ulab/code/numpy/create.c
msgid "too many dimensions" msgid "too many dimensions"
msgstr "" msgstr ""
@ -4139,6 +4155,10 @@ msgstr ""
msgid "trapz is defined for 1D iterables" msgid "trapz is defined for 1D iterables"
msgstr "" msgstr ""
#: py/obj.c
msgid "tuple/list has wrong length"
msgstr ""
#: ports/espressif/common-hal/canio/CAN.c #: ports/espressif/common-hal/canio/CAN.c
#, c-format #, c-format
msgid "twai_driver_install returned esp-idf error #%d" msgid "twai_driver_install returned esp-idf error #%d"

8
main.c
View File

@ -418,8 +418,8 @@ STATIC bool run_code_py(safe_mode_t safe_mode, bool *simulate_reset) {
}; };
#if CIRCUITPY_FULL_BUILD #if CIRCUITPY_FULL_BUILD
static const char *const double_extension_filenames[] = { static const char *const double_extension_filenames[] = {
"code.txt.py", "code.py.txt", "code.txt.txt","code.py.py", "code.txt.py", "code.py.txt", "code.txt.txt", "code.py.py",
"main.txt.py", "main.py.txt", "main.txt.txt","main.py.py" "main.txt.py", "main.py.txt", "main.txt.txt", "main.py.py"
}; };
#endif #endif
@ -992,9 +992,9 @@ int __attribute__((used)) main(void) {
#if CIRCUITPY_BOOT_COUNTER #if CIRCUITPY_BOOT_COUNTER
// Increment counter before possibly entering safe mode // Increment counter before possibly entering safe mode
common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj,0,1,&value_out); common_hal_nvm_bytearray_get_bytes(&common_hal_mcu_nvm_obj, 0, 1, &value_out);
++value_out; ++value_out;
common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj,0,&value_out,1); common_hal_nvm_bytearray_set_bytes(&common_hal_mcu_nvm_obj, 0, &value_out, 1);
#endif #endif
// Start the debug serial // Start the debug serial

View File

@ -38,7 +38,7 @@
#endif #endif
#endif #endif
//CIRCUITPY: native emitters not supported // CIRCUITPY: native emitters not supported
#define MICROPY_EMIT_X64 (!CIRCUITPY) #define MICROPY_EMIT_X64 (!CIRCUITPY)
#define MICROPY_EMIT_X86 (!CIRCUITPY) #define MICROPY_EMIT_X86 (!CIRCUITPY)
#define MICROPY_EMIT_THUMB (!CIRCUITPY) #define MICROPY_EMIT_THUMB (!CIRCUITPY)

View File

@ -22,15 +22,15 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PA04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PA05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA11) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA10) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA10) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA09) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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_SPI), MP_ROM_PTR(&board_spi_obj) },

14
ports/atmel-samd/boards/circuitbrains_deluxe_m4/pins.c Executable file → Normal file
View File

@ -39,8 +39,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PB14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED),MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_STATUS_LED), MP_ROM_PTR(&pin_PB13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PB13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_PB12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB31) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_PB31) },
@ -48,12 +48,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, { 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_SCL), MP_ROM_PTR(&pin_PB03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, { 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_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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_SPI), MP_ROM_PTR(&board_spi_obj) },

View File

@ -28,19 +28,19 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { 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_D11), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, { 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_SCL), MP_ROM_PTR(&pin_PB03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PB22) }, { 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_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, { 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_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_RX), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX),MP_ROM_PTR(&pin_PA27) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

View File

@ -9,8 +9,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA07) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_TX),MP_ROM_PTR(&pin_PA00) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA00) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_RX),MP_ROM_PTR(&pin_PA01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA01) },
// ESP control // ESP control
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PB17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PB17) },
@ -21,41 +21,41 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB30) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PB30) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB31) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PB31) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PA23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PA23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA19) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R1),MP_ROM_PTR(&pin_PB00) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R1), MP_ROM_PTR(&pin_PB00) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G1),MP_ROM_PTR(&pin_PB01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G1), MP_ROM_PTR(&pin_PB01) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B1),MP_ROM_PTR(&pin_PB02) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B1), MP_ROM_PTR(&pin_PB02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R2),MP_ROM_PTR(&pin_PB03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R2), MP_ROM_PTR(&pin_PB03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G2),MP_ROM_PTR(&pin_PB04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G2), MP_ROM_PTR(&pin_PB04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B2),MP_ROM_PTR(&pin_PB05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B2), MP_ROM_PTR(&pin_PB05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRA),MP_ROM_PTR(&pin_PB07) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRA), MP_ROM_PTR(&pin_PB07) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRB),MP_ROM_PTR(&pin_PB08) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRB), MP_ROM_PTR(&pin_PB08) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRC),MP_ROM_PTR(&pin_PB09) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRC), MP_ROM_PTR(&pin_PB09) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRD),MP_ROM_PTR(&pin_PB15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRD), MP_ROM_PTR(&pin_PB15) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRE),MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRE), MP_ROM_PTR(&pin_PB13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_CLK),MP_ROM_PTR(&pin_PB06) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_CLK), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_LAT),MP_ROM_PTR(&pin_PB14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_LAT), MP_ROM_PTR(&pin_PB14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_OE),MP_ROM_PTR(&pin_PB12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_OE), MP_ROM_PTR(&pin_PB12) },
{ MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_PA27) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_PA27) },
// Grounded when closed. // Grounded when closed.
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP),MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_DOWN),MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_DOWN), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA14) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_L),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PA14) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },

View File

@ -29,8 +29,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA19) }, { 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_D12), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA16) },
// ESP control // ESP control
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA15) },
@ -41,17 +41,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA04) }, { 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_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_SDA), MP_ROM_PTR(&pin_PB02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB03) }, { 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_NEOPIXEL), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, { 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_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, { 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_RX), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX),MP_ROM_PTR(&pin_PB07) }, { 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_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_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_UART), MP_ROM_PTR(&board_uart_obj) },

View File

@ -29,20 +29,20 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_PA19) }, { 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_D12), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, { 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_SCL), MP_ROM_PTR(&pin_PB03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PB22) }, { 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_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, { 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_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_RX), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX),MP_ROM_PTR(&pin_PA27) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX), MP_ROM_PTR(&pin_PA27) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_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_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },

View File

@ -7,15 +7,15 @@ 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_A0), MP_ROM_PTR(&pin_PA03) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_D5),MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_GREEN_LED),MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_GREEN_LED), MP_ROM_PTR(&pin_PA05) },
{ MP_ROM_QSTR(MP_QSTR_D6),MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_RED_LED),MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_RED_LED), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA06) },
{ MP_ROM_QSTR(MP_QSTR_D7),MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_BLUE_LED),MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_BLUE_LED), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA08) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) }, { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA08) },

View File

@ -29,7 +29,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB22) },
// LCD pins // LCD pins
{ MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PA00) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PA00) },
@ -65,17 +65,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) },
// SPI // SPI
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
// I2C // I2C
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, { 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_SCL), MP_ROM_PTR(&pin_PB03) },
// SD Card // SD Card
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS),MP_ROM_PTR(&pin_PB30) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PB30) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CARD_DETECT),MP_ROM_PTR(&pin_PA01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CARD_DETECT), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },

View File

@ -29,7 +29,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PB23) }, { MP_OBJ_NEW_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_PB23) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_PB22) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_PB22) },
// LCD pins // LCD pins
{ MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PA00) }, { MP_OBJ_NEW_QSTR(MP_QSTR_TFT_RESET), MP_ROM_PTR(&pin_PA00) },
@ -65,17 +65,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_RX), MP_ROM_PTR(&pin_PB13) },
// SPI // SPI
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_PA12) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA14) },
// I2C // I2C
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_PB02) }, { 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_SCL), MP_ROM_PTR(&pin_PB03) },
// SD Card // SD Card
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS),MP_ROM_PTR(&pin_PB30) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_PB30) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CARD_DETECT),MP_ROM_PTR(&pin_PA01) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CARD_DETECT), MP_ROM_PTR(&pin_PA01) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },

View File

@ -41,8 +41,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) },

View File

@ -13,7 +13,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB13) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB12) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB12) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PB14) },
{ MP_ROM_QSTR(MP_QSTR_xSDCS),MP_ROM_PTR(&pin_PA04) }, { MP_ROM_QSTR(MP_QSTR_xSDCS), MP_ROM_PTR(&pin_PA04) },
{ MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) }, { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_PA02) },
{ MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) }, { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_PA05) },
@ -43,7 +43,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_TCK), MP_ROM_PTR(&pin_PB01) }, { MP_ROM_QSTR(MP_QSTR_TCK), MP_ROM_PTR(&pin_PB01) },
{ MP_ROM_QSTR(MP_QSTR_TDI), MP_ROM_PTR(&pin_PB02) }, { 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_TMS), MP_ROM_PTR(&pin_PB03) },
{ MP_ROM_QSTR(MP_QSTR_ESP_CS),MP_ROM_PTR(&pin_PB15) }, { 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_TX1), MP_ROM_PTR(&pin_PA12) },
{ MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA13) }, { MP_ROM_QSTR(MP_QSTR_RX1), MP_ROM_PTR(&pin_PA13) },

View File

@ -25,8 +25,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) },

View File

@ -25,8 +25,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PA07) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA10) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA10) },
{ MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_APA102_MOSI), MP_ROM_PTR(&pin_PA00) },
{ MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) }, { MP_ROM_QSTR(MP_QSTR_DOTSTAR_DATA), MP_ROM_PTR(&pin_PA00) },

View File

@ -28,7 +28,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, { 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_D11), MP_ROM_PTR(&pin_PA19) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_PA17) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_PA16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_PA16) },
// ESP control // ESP control
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA15) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_PA15) },
@ -39,17 +39,17 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_TX), MP_ROM_PTR(&pin_PA04) }, { 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_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_SDA), MP_ROM_PTR(&pin_PB02) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_PB03) }, { 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_NEOPIXEL), MP_ROM_PTR(&pin_PB22) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK),MP_ROM_PTR(&pin_PA13) }, { 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_MOSI), MP_ROM_PTR(&pin_PA12) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_PA14) }, { 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_RX), MP_ROM_PTR(&pin_PB06) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED_TX),MP_ROM_PTR(&pin_PB07) }, { 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_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_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_UART), MP_ROM_PTR(&board_uart_obj) },

View File

@ -113,11 +113,11 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
RUN_BACKGROUND_TASKS; RUN_BACKGROUND_TASKS;
// Detect if interrupt was alarm or ctrl-C interrupt. // Detect if interrupt was alarm or ctrl-C interrupt.
if (alarm_time_timealarm_woke_this_cycle()) { if (alarm_time_timealarm_woke_this_cycle()) {
wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
if (alarm_pin_pinalarm_woke_this_cycle()) { if (alarm_pin_pinalarm_woke_this_cycle()) {
wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }

View File

@ -112,7 +112,7 @@ void common_hal_digitalio_digitalinout_set_value(
} }
} else { } else {
hri_port_set_DIR_DIR_bf(PORT, port, pin_mask); hri_port_set_DIR_DIR_bf(PORT, port, pin_mask);
hri_port_clear_OUT_OUT_bf(PORT,port, pin_mask); hri_port_clear_OUT_OUT_bf(PORT, port, pin_mask);
} }
} }

View File

@ -42,7 +42,7 @@
#include "hri/hri_nvmctrl_d51.h" #include "hri/hri_nvmctrl_d51.h"
#endif #endif
__attribute__((naked,noinline,aligned(16))) __attribute__((naked, noinline, aligned(16)))
static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask, static void neopixel_send_buffer_core(volatile uint32_t *clraddr, uint32_t pinMask,
const uint8_t *ptr, int numBytes); const uint8_t *ptr, int numBytes);

View File

@ -27,40 +27,40 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_GPIO22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_SDA6),MP_ROM_PTR(&pin_GPIO22) }, { MP_ROM_QSTR(MP_QSTR_SDA6), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) }, { MP_ROM_QSTR(MP_QSTR_GPIO23), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO23) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_SCL6),MP_ROM_PTR(&pin_GPIO23) }, { MP_ROM_QSTR(MP_QSTR_SCL6), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_GPIO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_SDA4),MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_SDA4), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_GPIO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_SCL4),MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SCL4), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_SPI0_CE1),MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SPI0_CE1), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_GPIO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_SPI0_CE0),MP_ROM_PTR(&pin_GPIO8) }, { MP_ROM_QSTR(MP_QSTR_SPI0_CE0), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_GPIO10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_SPI0_MOSI),MP_ROM_PTR(&pin_GPIO10) }, { MP_ROM_QSTR(MP_QSTR_SPI0_MOSI), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_GPIO9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_SPI0_MISO),MP_ROM_PTR(&pin_GPIO9) }, { MP_ROM_QSTR(MP_QSTR_SPI0_MISO), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_GPIO11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_SPI0_SCLK),MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_SPI0_SCLK), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_SDA1),MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_SDA1), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_GPIO12), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO12) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO12) },

View File

@ -291,13 +291,13 @@ STATIC const mp_rom_map_elem_t espnow_locals_dict_table[] = {
// Send messages // Send messages
{ MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&espnow_send_obj) }, { MP_ROM_QSTR(MP_QSTR_send), MP_ROM_PTR(&espnow_send_obj) },
{ MP_ROM_QSTR(MP_QSTR_send_success),MP_ROM_PTR(&espnow_send_success_obj)}, { MP_ROM_QSTR(MP_QSTR_send_success), MP_ROM_PTR(&espnow_send_success_obj)},
{ MP_ROM_QSTR(MP_QSTR_send_failure),MP_ROM_PTR(&espnow_send_failure_obj)}, { MP_ROM_QSTR(MP_QSTR_send_failure), MP_ROM_PTR(&espnow_send_failure_obj)},
// Read messages // Read messages
{ MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&espnow_read_obj) }, { MP_ROM_QSTR(MP_QSTR_read), MP_ROM_PTR(&espnow_read_obj) },
{ MP_ROM_QSTR(MP_QSTR_read_success),MP_ROM_PTR(&espnow_read_success_obj)}, { MP_ROM_QSTR(MP_QSTR_read_success), MP_ROM_PTR(&espnow_read_success_obj)},
{ MP_ROM_QSTR(MP_QSTR_read_failure),MP_ROM_PTR(&espnow_read_failure_obj)}, { MP_ROM_QSTR(MP_QSTR_read_failure), MP_ROM_PTR(&espnow_read_failure_obj)},
// Config parameters // Config parameters
{ MP_ROM_QSTR(MP_QSTR_set_pmk), MP_ROM_PTR(&espnow_set_pmk_obj) }, { MP_ROM_QSTR(MP_QSTR_set_pmk), MP_ROM_PTR(&espnow_set_pmk_obj) },

View File

@ -80,7 +80,7 @@ STATIC const mp_rom_map_elem_t espnow_module_globals_table[] = {
// module classes // module classes
{ MP_ROM_QSTR(MP_QSTR_ESPNow), MP_ROM_PTR(&espnow_type) }, { MP_ROM_QSTR(MP_QSTR_ESPNow), MP_ROM_PTR(&espnow_type) },
{ MP_ROM_QSTR(MP_QSTR_ESPNowPacket),MP_ROM_PTR(&espnow_packet_type_obj) }, { MP_ROM_QSTR(MP_QSTR_ESPNowPacket), MP_ROM_PTR(&espnow_packet_type_obj) },
{ MP_ROM_QSTR(MP_QSTR_Peer), MP_ROM_PTR(&espnow_peer_type) }, { MP_ROM_QSTR(MP_QSTR_Peer), MP_ROM_PTR(&espnow_peer_type) },
{ MP_ROM_QSTR(MP_QSTR_Peers), MP_ROM_PTR(&espnow_peers_type) }, { MP_ROM_QSTR(MP_QSTR_Peers), MP_ROM_PTR(&espnow_peers_type) },
}; };

View File

@ -28,10 +28,10 @@ STATIC const mp_rom_obj_tuple_t matrix_data_tuple = {
}; };
STATIC const mp_rom_map_elem_t matrix_common_table[] = { STATIC const mp_rom_map_elem_t matrix_common_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_rgb_pins),MP_ROM_PTR(&matrix_data_tuple) }, { MP_OBJ_NEW_QSTR(MP_QSTR_rgb_pins), MP_ROM_PTR(&matrix_data_tuple) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_clock_pin),MP_ROM_PTR(&pin_GPIO2) }, { MP_OBJ_NEW_QSTR(MP_QSTR_clock_pin), MP_ROM_PTR(&pin_GPIO2) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_latch_pin),MP_ROM_PTR(&pin_GPIO47) }, { MP_OBJ_NEW_QSTR(MP_QSTR_latch_pin), MP_ROM_PTR(&pin_GPIO47) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_output_enable_pin),MP_ROM_PTR(&pin_GPIO14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_output_enable_pin), MP_ROM_PTR(&pin_GPIO14) },
}; };
MP_DEFINE_CONST_DICT(matrix_common_dict, matrix_common_table); MP_DEFINE_CONST_DICT(matrix_common_dict, matrix_common_table);
@ -66,32 +66,32 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRESS),MP_ROM_PTR(&matrix_addr_tuple) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRESS), MP_ROM_PTR(&matrix_addr_tuple) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_COMMON),MP_ROM_PTR(&matrix_common_dict) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_COMMON), MP_ROM_PTR(&matrix_common_dict) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R1),MP_ROM_PTR(&pin_GPIO42) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R1), MP_ROM_PTR(&pin_GPIO42) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G1),MP_ROM_PTR(&pin_GPIO41) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G1), MP_ROM_PTR(&pin_GPIO41) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B1),MP_ROM_PTR(&pin_GPIO40) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B1), MP_ROM_PTR(&pin_GPIO40) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R2),MP_ROM_PTR(&pin_GPIO38) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_R2), MP_ROM_PTR(&pin_GPIO38) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G2),MP_ROM_PTR(&pin_GPIO39) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_G2), MP_ROM_PTR(&pin_GPIO39) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B2),MP_ROM_PTR(&pin_GPIO37) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_B2), MP_ROM_PTR(&pin_GPIO37) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRA),MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRA), MP_ROM_PTR(&pin_GPIO45) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRB),MP_ROM_PTR(&pin_GPIO36) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRB), MP_ROM_PTR(&pin_GPIO36) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRC),MP_ROM_PTR(&pin_GPIO48) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRC), MP_ROM_PTR(&pin_GPIO48) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRD),MP_ROM_PTR(&pin_GPIO35) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRD), MP_ROM_PTR(&pin_GPIO35) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRE),MP_ROM_PTR(&pin_GPIO21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_ADDRE), MP_ROM_PTR(&pin_GPIO21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_CLK),MP_ROM_PTR(&pin_GPIO2) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_CLK), MP_ROM_PTR(&pin_GPIO2) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_LAT),MP_ROM_PTR(&pin_GPIO47) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_LAT), MP_ROM_PTR(&pin_GPIO47) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MTX_OE),MP_ROM_PTR(&pin_GPIO14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MTX_OE), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_GPIO15) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_GPIO15) },
// Grounded when closed. // Grounded when closed.
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP),MP_ROM_PTR(&pin_GPIO6) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_UP), MP_ROM_PTR(&pin_GPIO6) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_DOWN),MP_ROM_PTR(&pin_GPIO7) }, { MP_OBJ_NEW_QSTR(MP_QSTR_BUTTON_DOWN), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_i2c_obj) },

View File

@ -39,20 +39,20 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO33),MP_ROM_PTR(&pin_GPIO33) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO34),MP_ROM_PTR(&pin_GPIO34) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO35),MP_ROM_PTR(&pin_GPIO35) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO37),MP_ROM_PTR(&pin_GPIO37) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO42) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO42) },

View File

@ -66,20 +66,20 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO13), MP_ROM_PTR(&pin_GPIO13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO47) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO47) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO47),MP_ROM_PTR(&pin_GPIO47) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO47), MP_ROM_PTR(&pin_GPIO47) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO48) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO48) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO48),MP_ROM_PTR(&pin_GPIO48) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO48), MP_ROM_PTR(&pin_GPIO48) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MOSI),MP_ROM_PTR(&pin_GPIO35) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO35),MP_ROM_PTR(&pin_GPIO35) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_MISO),MP_ROM_PTR(&pin_GPIO37) }, { MP_OBJ_NEW_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO37),MP_ROM_PTR(&pin_GPIO37) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_IO45), MP_ROM_PTR(&pin_GPIO45) },

View File

@ -48,21 +48,21 @@ displayio_fourwire_obj_t board_display_obj;
// display init sequence according to M5Gfx // display init sequence according to M5Gfx
uint8_t display_init_sequence[] = { uint8_t display_init_sequence[] = {
0x01,DELAY,0x80, // Software reset then delay 0x80 (128ms) 0x01, DELAY, 0x80, // Software reset then delay 0x80 (128ms)
0xC8,0x03,0xFF,0x93,0x42, // Turn on the external command 0xC8, 0x03, 0xFF, 0x93, 0x42, // Turn on the external command
0xC0,0x02,0x12, 0x12, // Power Control 1 0xC0, 0x02, 0x12, 0x12, // Power Control 1
0xC1,0x01,0x03, // Power Control 2 0xC1, 0x01, 0x03, // Power Control 2
0xC5,0x01,0xF2, // VCOM Control 1 0xC5, 0x01, 0xF2, // VCOM Control 1
0xB0,0x01,0xE0, // RGB Interface SYNC Mode 0xB0, 0x01, 0xE0, // RGB Interface SYNC Mode
0xF6,0x03,0x01, 0x00, 0x00, // Interface control 0xF6, 0x03, 0x01, 0x00, 0x00, // Interface control
0XE0,0x0F,0x00,0x0C,0x11,0x04,0x11,0x08,0x37,0x89,0x4C,0x06,0x0C,0x0A,0x2E,0x34,0x0F, // Positive Gamma Correction 0XE0, 0x0F, 0x00, 0x0C, 0x11, 0x04, 0x11, 0x08, 0x37, 0x89, 0x4C, 0x06, 0x0C, 0x0A, 0x2E, 0x34, 0x0F, // Positive Gamma Correction
0xE1,0x0F,0x00,0x0B,0x11,0x05,0x13,0x09,0x33,0x67,0x48,0x07,0x0E,0x0B,0x2E,0x33,0x0F, // Negative Gamma Correction 0xE1, 0x0F, 0x00, 0x0B, 0x11, 0x05, 0x13, 0x09, 0x33, 0x67, 0x48, 0x07, 0x0E, 0x0B, 0x2E, 0x33, 0x0F, // Negative Gamma Correction
0xB6,0x04,0x08,0x82,0x1D,0x04, // Display Function Control 0xB6, 0x04, 0x08, 0x82, 0x1D, 0x04, // Display Function Control
0x3A,0x01,0x55, // COLMOD: Pixel Format Set 16 bit 0x3A, 0x01, 0x55, // COLMOD: Pixel Format Set 16 bit
0x21,0x00, // Display inversion ON 0x21, 0x00, // Display inversion ON
0x36,0x01,0x08, // Memory Access Control: RGB order 0x36, 0x01, 0x08, // Memory Access Control: RGB order
0x11,DELAY,0x78, // Exit Sleep then delay 0x78 (120ms) 0x11, DELAY, 0x78, // Exit Sleep then delay 0x78 (120ms)
0x29,DELAY,0x78, // Display on then delay 0x78 (120ms) 0x29, DELAY, 0x78, // Display on then delay 0x78 (120ms)
}; };
static bool pmic_set_power_source(uint8_t source, busio_i2c_obj_t *i2c) { static bool pmic_set_power_source(uint8_t source, busio_i2c_obj_t *i2c) {

View File

@ -80,10 +80,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
// { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO32) }, AXP_DC3 // { MP_ROM_QSTR(MP_QSTR_TFT_BACKLIGHT), MP_ROM_PTR(&pin_GPIO32) }, AXP_DC3
// sd card // sd card
{ MP_ROM_QSTR(MP_QSTR_SD_CS),MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO4) },
// touch screen // touch screen
{ MP_ROM_QSTR(MP_QSTR_TOUCH_INT),MP_ROM_PTR(&pin_GPIO39) }, { MP_ROM_QSTR(MP_QSTR_TOUCH_INT), MP_ROM_PTR(&pin_GPIO39) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_PORTA_I2C), MP_ROM_PTR(&board_porta_i2c_obj) },

View File

@ -38,21 +38,21 @@ displayio_fourwire_obj_t board_display_obj;
// display init sequence according to M5Gfx // display init sequence according to M5Gfx
uint8_t display_init_sequence[] = { uint8_t display_init_sequence[] = {
0x01,0x80,0x80, // Software reset then delay 0x80 (128ms) 0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms)
0xC8,0x03,0xFF,0x93,0x42, // Turn on the external command 0xC8, 0x03, 0xFF, 0x93, 0x42, // Turn on the external command
0xC0,0x02,0x12, 0x12, // Power Control 1 0xC0, 0x02, 0x12, 0x12, // Power Control 1
0xC1,0x01,0x03, // Power Control 2 0xC1, 0x01, 0x03, // Power Control 2
0xC5,0x01,0xF2, // VCOM Control 1 0xC5, 0x01, 0xF2, // VCOM Control 1
0xB0,0x01,0xE0, // RGB Interface SYNC Mode 0xB0, 0x01, 0xE0, // RGB Interface SYNC Mode
0xF6,0x03,0x01, 0x00, 0x00, // Interface control 0xF6, 0x03, 0x01, 0x00, 0x00, // Interface control
0XE0,0x0F,0x00,0x0C,0x11,0x04,0x11,0x08,0x37,0x89,0x4C,0x06,0x0C,0x0A,0x2E,0x34,0x0F, // Positive Gamma Correction 0XE0, 0x0F, 0x00, 0x0C, 0x11, 0x04, 0x11, 0x08, 0x37, 0x89, 0x4C, 0x06, 0x0C, 0x0A, 0x2E, 0x34, 0x0F, // Positive Gamma Correction
0xE1,0x0F,0x00,0x0B,0x11,0x05,0x13,0x09,0x33,0x67,0x48,0x07,0x0E,0x0B,0x2E,0x33,0x0F, // Negative Gamma Correction 0xE1, 0x0F, 0x00, 0x0B, 0x11, 0x05, 0x13, 0x09, 0x33, 0x67, 0x48, 0x07, 0x0E, 0x0B, 0x2E, 0x33, 0x0F, // Negative Gamma Correction
0xB6,0x04,0x08,0x82,0x1D,0x04, // Display Function Control 0xB6, 0x04, 0x08, 0x82, 0x1D, 0x04, // Display Function Control
0x3A,0x01,0x55, // COLMOD: Pixel Format Set 16 bit 0x3A, 0x01, 0x55, // COLMOD: Pixel Format Set 16 bit
0x21,0x00, // Display inversion ON 0x21, 0x00, // Display inversion ON
0x36,0x01,0x08, // Memory Access Control: RGB order 0x36, 0x01, 0x08, // Memory Access Control: RGB order
0x11,0x80,0x78, // Exit Sleep then delay 0x78 (120ms) 0x11, 0x80, 0x78, // Exit Sleep then delay 0x78 (120ms)
0x29,0x80,0x78, // Display on then delay 0x78 (120ms) 0x29, 0x80, 0x78, // Display on then delay 0x78 (120ms)
}; };
void board_init(void) { void board_init(void) {

View File

@ -76,7 +76,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_BTN_C), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_BTN_C), MP_ROM_PTR(&pin_GPIO37) },
// sd card // sd card
{ MP_ROM_QSTR(MP_QSTR_SD_CS),MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO4) },
// tft // tft
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO14) },

30
ports/espressif/boards/m5stack_core_fire/board.c Executable file → Normal file
View File

@ -38,21 +38,21 @@ displayio_fourwire_obj_t board_display_obj;
// display init sequence according to M5Gfx // display init sequence according to M5Gfx
uint8_t display_init_sequence[] = { uint8_t display_init_sequence[] = {
0x01,0x80,0x80, // Software reset then delay 0x80 (128ms) 0x01, 0x80, 0x80, // Software reset then delay 0x80 (128ms)
0xC8,0x03,0xFF,0x93,0x42, // Turn on the external command 0xC8, 0x03, 0xFF, 0x93, 0x42, // Turn on the external command
0xC0,0x02,0x12, 0x12, // Power Control 1 0xC0, 0x02, 0x12, 0x12, // Power Control 1
0xC1,0x01,0x03, // Power Control 2 0xC1, 0x01, 0x03, // Power Control 2
0xC5,0x01,0xF2, // VCOM Control 1 0xC5, 0x01, 0xF2, // VCOM Control 1
0xB0,0x01,0xE0, // RGB Interface SYNC Mode 0xB0, 0x01, 0xE0, // RGB Interface SYNC Mode
0xF6,0x03,0x01, 0x00, 0x00, // Interface control 0xF6, 0x03, 0x01, 0x00, 0x00, // Interface control
0XE0,0x0F,0x00,0x0C,0x11,0x04,0x11,0x08,0x37,0x89,0x4C,0x06,0x0C,0x0A,0x2E,0x34,0x0F, // Positive Gamma Correction 0XE0, 0x0F, 0x00, 0x0C, 0x11, 0x04, 0x11, 0x08, 0x37, 0x89, 0x4C, 0x06, 0x0C, 0x0A, 0x2E, 0x34, 0x0F, // Positive Gamma Correction
0xE1,0x0F,0x00,0x0B,0x11,0x05,0x13,0x09,0x33,0x67,0x48,0x07,0x0E,0x0B,0x2E,0x33,0x0F, // Negative Gamma Correction 0xE1, 0x0F, 0x00, 0x0B, 0x11, 0x05, 0x13, 0x09, 0x33, 0x67, 0x48, 0x07, 0x0E, 0x0B, 0x2E, 0x33, 0x0F, // Negative Gamma Correction
0xB6,0x04,0x08,0x82,0x1D,0x04, // Display Function Control 0xB6, 0x04, 0x08, 0x82, 0x1D, 0x04, // Display Function Control
0x3A,0x01,0x55, // COLMOD: Pixel Format Set 16 bit 0x3A, 0x01, 0x55, // COLMOD: Pixel Format Set 16 bit
0x21,0x00, // Display inversion ON 0x21, 0x00, // Display inversion ON
0x36,0x01,0x08, // Memory Access Control: RGB order 0x36, 0x01, 0x08, // Memory Access Control: RGB order
0x11,0x80,0x78, // Exit Sleep then delay 0x78 (120ms) 0x11, 0x80, 0x78, // Exit Sleep then delay 0x78 (120ms)
0x29,0x80,0x78, // Display on then delay 0x78 (120ms) 0x29, 0x80, 0x78, // Display on then delay 0x78 (120ms)
}; };
void board_init(void) { void board_init(void) {

View File

@ -78,7 +78,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_BTN_C), MP_ROM_PTR(&pin_GPIO37) }, { MP_ROM_QSTR(MP_QSTR_BTN_C), MP_ROM_PTR(&pin_GPIO37) },
// sd card // sd card
{ MP_ROM_QSTR(MP_QSTR_SD_CS),MP_ROM_PTR(&pin_GPIO4) }, { MP_ROM_QSTR(MP_QSTR_SD_CS), MP_ROM_PTR(&pin_GPIO4) },
// tft // tft
{ MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO14) }, { MP_ROM_QSTR(MP_QSTR_TFT_CS), MP_ROM_PTR(&pin_GPIO14) },

38
ports/espressif/boards/m5stack_stick_c/board.c Executable file → Normal file
View File

@ -41,25 +41,25 @@
// display init sequence according to adafruit_st7735r.py library // display init sequence according to adafruit_st7735r.py library
uint8_t display_init_sequence[] = { uint8_t display_init_sequence[] = {
0x01,0x80,0x96, // SWRESET and Delay 150ms 0x01, 0x80, 0x96, // SWRESET and Delay 150ms
0x11,0x80,0xff, // SLPOUT and Delay 0x11, 0x80, 0xff, // SLPOUT and Delay
0xb1,0x03,0x01,0x2C,0x2D, // _FRMCTR1 0xb1, 0x03, 0x01, 0x2C, 0x2D, // _FRMCTR1
0xb2,0x03,0x01,0x2C,0x2D, // _FRMCTR2 0xb2, 0x03, 0x01, 0x2C, 0x2D, // _FRMCTR2
0xb3,0x06,0x01,0x2C,0x2D,0x01,0x2C,0x2D, // _FRMCTR3 0xb3, 0x06, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, // _FRMCTR3
0xb4,0x01,0x07, // _INVCTR line inversion 0xb4, 0x01, 0x07, // _INVCTR line inversion
0xc0,0x03,0xa2,0x02,0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA 0xc0, 0x03, 0xa2, 0x02, 0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA
0xc1,0x01,0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V 0xc1, 0x01, 0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V
0xc2,0x02,0x0a,0x00, // _PWCTR3 Opamp current small, Boost frequency 0xc2, 0x02, 0x0a, 0x00, // _PWCTR3 Opamp current small, Boost frequency
0xc3,0x02,0x8a,0x2a, 0xc3, 0x02, 0x8a, 0x2a,
0xc4,0x02,0x8a,0xee, 0xc4, 0x02, 0x8a, 0xee,
0xc5,0x01,0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0xc5, 0x01, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
0x36,0x01,0xc8, // MADCTL Rotate display 0x36, 0x01, 0xc8, // MADCTL Rotate display
0x21,0x00, // _INVON 0x21, 0x00, // _INVON
0x3a,0x01,0x05, // COLMOD - 16bit color 0x3a, 0x01, 0x05, // COLMOD - 16bit color
0xe0,0x10,0x02,0x1c,0x07,0x12,0x37,0x32,0x29,0x2d,0x29,0x25,0x2B,0x39,0x00,0x01,0x03,0x10, // _GMCTRP1 Gamma 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 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, 0x2E, 0x2E, 0x37, 0x3F, 0x00, 0x00, 0x02, 0x10, // _GMCTRN1
0x13,0x80,0x0a, // _NORON 0x13, 0x80, 0x0a, // _NORON
0x29,0x80,0x64 // _DISPON 0x29, 0x80, 0x64 // _DISPON
}; };
static bool pmic_init(busio_i2c_obj_t *i2c) { static bool pmic_init(busio_i2c_obj_t *i2c) {

38
ports/espressif/boards/m5stack_stick_c_plus/board.c Executable file → Normal file
View File

@ -41,25 +41,25 @@
// display init sequence according to adafruit_st7735r.py library // display init sequence according to adafruit_st7735r.py library
uint8_t display_init_sequence[] = { uint8_t display_init_sequence[] = {
0x01,0x80,0x96, // SWRESET and Delay 150ms 0x01, 0x80, 0x96, // SWRESET and Delay 150ms
0x11,0x80,0xff, // SLPOUT and Delay 0x11, 0x80, 0xff, // SLPOUT and Delay
0xb1,0x03,0x01,0x2C,0x2D, // _FRMCTR1 0xb1, 0x03, 0x01, 0x2C, 0x2D, // _FRMCTR1
0xb2,0x03,0x01,0x2C,0x2D, // _FRMCTR2 0xb2, 0x03, 0x01, 0x2C, 0x2D, // _FRMCTR2
0xb3,0x06,0x01,0x2C,0x2D,0x01,0x2C,0x2D, // _FRMCTR3 0xb3, 0x06, 0x01, 0x2C, 0x2D, 0x01, 0x2C, 0x2D, // _FRMCTR3
0xb4,0x01,0x07, // _INVCTR line inversion 0xb4, 0x01, 0x07, // _INVCTR line inversion
0xc0,0x03,0xa2,0x02,0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA 0xc0, 0x03, 0xa2, 0x02, 0x84, // _PWCTR1 GVDD = 4.7V, 1.0uA
0xc1,0x01,0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V 0xc1, 0x01, 0xc5, // _PWCTR2 VGH=14.7V, VGL=-7.35V
0xc2,0x02,0x0a,0x00, // _PWCTR3 Opamp current small, Boost frequency 0xc2, 0x02, 0x0a, 0x00, // _PWCTR3 Opamp current small, Boost frequency
0xc3,0x02,0x8a,0x2a, 0xc3, 0x02, 0x8a, 0x2a,
0xc4,0x02,0x8a,0xee, 0xc4, 0x02, 0x8a, 0xee,
0xc5,0x01,0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V 0xc5, 0x01, 0x0e, // _VMCTR1 VCOMH = 4V, VOML = -1.1V
0x36,0x01,0xc8, // MADCTL Rotate display 0x36, 0x01, 0xc8, // MADCTL Rotate display
0x21,0x00, // _INVON 0x21, 0x00, // _INVON
0x3a,0x01,0x05, // COLMOD - 16bit color 0x3a, 0x01, 0x05, // COLMOD - 16bit color
0xe0,0x10,0x02,0x1c,0x07,0x12,0x37,0x32,0x29,0x2d,0x29,0x25,0x2B,0x39,0x00,0x01,0x03,0x10, // _GMCTRP1 Gamma 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 0xe1, 0x10, 0x03, 0x1d, 0x07, 0x06, 0x2E, 0x2C, 0x29, 0x2D, 0x2E, 0x2E, 0x37, 0x3F, 0x00, 0x00, 0x02, 0x10, // _GMCTRN1
0x13,0x80,0x0a, // _NORON 0x13, 0x80, 0x0a, // _NORON
0x29,0x80,0x64 // _DISPON 0x29, 0x80, 0x64 // _DISPON
}; };
static bool pmic_init(busio_i2c_obj_t *i2c) { static bool pmic_init(busio_i2c_obj_t *i2c) {

View File

@ -53,7 +53,7 @@ void board_init(void) {
// Delete code.Py, use main.py // Delete code.Py, use main.py
mp_import_stat_t stat_c = mp_import_stat("code.py"); mp_import_stat_t stat_c = mp_import_stat("code.py");
if (stat_c == MP_IMPORT_STAT_FILE) { if (stat_c == MP_IMPORT_STAT_FILE) {
f_unlink(fatfs,"/code.py"); f_unlink(fatfs, "/code.py");
} }
} }

View File

@ -5,9 +5,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO21) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_GPIO33) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO33) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_GPIO34) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO34) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) }, { MP_OBJ_NEW_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO45) },

View File

@ -160,20 +160,20 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
esp_sleep_wakeup_cause_t cause = _get_wakeup_cause(false); esp_sleep_wakeup_cause_t cause = _get_wakeup_cause(false);
switch (cause) { switch (cause) {
case ESP_SLEEP_WAKEUP_TIMER: { case ESP_SLEEP_WAKEUP_TIMER: {
wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
case ESP_SLEEP_WAKEUP_GPIO: { case ESP_SLEEP_WAKEUP_GPIO: {
wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
case ESP_SLEEP_WAKEUP_TOUCHPAD: { case ESP_SLEEP_WAKEUP_TOUCHPAD: {
wake_alarm = alarm_touch_touchalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_touch_touchalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
#if CIRCUITPY_ESPULP #if CIRCUITPY_ESPULP
case ESP_SLEEP_WAKEUP_ULP: { case ESP_SLEEP_WAKEUP_ULP: {
wake_alarm = espulp_ulpalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = espulp_ulpalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
#endif #endif

View File

@ -135,13 +135,13 @@ static void start_dma(analogbufio_bufferedin_obj_t *self, adc_digi_convert_mode_
}; };
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"pin:%d, ADC channel:%d, ADC index:%d, adc1_chan_mask:0x%x, adc2_chan_mask:0x%x\n",pin->number,pin->adc_channel,pin->adc_index,adc1_chan_mask,adc2_chan_mask); mp_printf(&mp_plat_print, "pin:%d, ADC channel:%d, ADC index:%d, adc1_chan_mask:0x%x, adc2_chan_mask:0x%x\n", pin->number, pin->adc_channel, pin->adc_index, adc1_chan_mask, adc2_chan_mask);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
esp_err_t err = adc_digi_initialize(&adc_dma_config); esp_err_t err = adc_digi_initialize(&adc_dma_config);
if (ESP_OK != err) { if (ESP_OK != err) {
stop_dma(self); stop_dma(self);
common_hal_analogbufio_bufferedin_deinit(self); common_hal_analogbufio_bufferedin_deinit(self);
mp_raise_ValueError_varg(translate("Unable to initialize ADC DMA controller, ErrorCode:%d"),err); mp_raise_ValueError_varg(translate("Unable to initialize ADC DMA controller, ErrorCode:%d"), err);
} }
adc_digi_configuration_t dig_cfg = { adc_digi_configuration_t dig_cfg = {
@ -154,7 +154,7 @@ static void start_dma(analogbufio_bufferedin_obj_t *self, adc_digi_convert_mode_
}; };
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"conversion_mode:%d, format:%d, conv_limit_en:%d, sample_rate:%d\n",*convert_mode,*output_format,ADC_CONV_LIMIT_EN,sample_rate); mp_printf(&mp_plat_print, "conversion_mode:%d, format:%d, conv_limit_en:%d, sample_rate:%d\n", *convert_mode, *output_format, ADC_CONV_LIMIT_EN, sample_rate);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
adc_digi_pattern_config_t adc_pattern[NUM_ADC_CHANNELS] = {0}; adc_digi_pattern_config_t adc_pattern[NUM_ADC_CHANNELS] = {0};
@ -169,20 +169,20 @@ static void start_dma(analogbufio_bufferedin_obj_t *self, adc_digi_convert_mode_
dig_cfg.adc_pattern = adc_pattern; dig_cfg.adc_pattern = adc_pattern;
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"adc_pattern[0].channel:%d, adc_pattern[0].unit:%d, adc_pattern[0].atten:%d\n",adc_pattern[0].channel,adc_pattern[0].unit,adc_pattern[0].atten); mp_printf(&mp_plat_print, "adc_pattern[0].channel:%d, adc_pattern[0].unit:%d, adc_pattern[0].atten:%d\n", adc_pattern[0].channel, adc_pattern[0].unit, adc_pattern[0].atten);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
err = adc_digi_controller_configure(&dig_cfg); err = adc_digi_controller_configure(&dig_cfg);
if (ESP_OK != err) { if (ESP_OK != err) {
stop_dma(self); stop_dma(self);
common_hal_analogbufio_bufferedin_deinit(self); common_hal_analogbufio_bufferedin_deinit(self);
mp_raise_ValueError_varg(translate("Unable to configure ADC DMA controller, ErrorCode:%d"),err); mp_raise_ValueError_varg(translate("Unable to configure ADC DMA controller, ErrorCode:%d"), err);
} }
err = adc_digi_start(); err = adc_digi_start();
if (ESP_OK != err) { if (ESP_OK != err) {
stop_dma(self); stop_dma(self);
common_hal_analogbufio_bufferedin_deinit(self); common_hal_analogbufio_bufferedin_deinit(self);
mp_raise_ValueError_varg(translate("Unable to start ADC DMA controller, ErrorCode:%d"),err); mp_raise_ValueError_varg(translate("Unable to start ADC DMA controller, ErrorCode:%d"), err);
} }
} }
@ -251,7 +251,7 @@ uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t
start_dma(self, &convert_mode, &output_format); start_dma(self, &convert_mode, &output_format);
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"Required bytes: %d\n",len); mp_printf(&mp_plat_print, "Required bytes: %d\n", len);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
while (captured_bytes < len) { while (captured_bytes < len) {
@ -284,7 +284,7 @@ uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t
// For all chips except for ESP32C3 we would receive samples only from one unit // For all chips except for ESP32C3 we would receive samples only from one unit
// For ESP32C3 we may receive sample from alternating units and need to ignore them // For ESP32C3 we may receive sample from alternating units and need to ignore them
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"Invalid sample received: 0x%x\n",pResult->val); mp_printf(&mp_plat_print, "Invalid sample received: 0x%x\n", pResult->val);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
stop_dma(self); stop_dma(self);
return captured_samples; return captured_samples;
@ -293,13 +293,13 @@ uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t
} }
} else if (ret == ESP_ERR_TIMEOUT) { } else if (ret == ESP_ERR_TIMEOUT) {
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"ADC Timeout\n"); mp_printf(&mp_plat_print, "ADC Timeout\n");
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
stop_dma(self); stop_dma(self);
return captured_samples; return captured_samples;
} else { } else {
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"adc_digi_read_bytes failed error code:%d\n",ret); mp_printf(&mp_plat_print, "adc_digi_read_bytes failed error code:%d\n", ret);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
stop_dma(self); stop_dma(self);
return captured_samples; return captured_samples;
@ -308,7 +308,7 @@ uint32_t common_hal_analogbufio_bufferedin_readinto(analogbufio_bufferedin_obj_t
stop_dma(self); stop_dma(self);
#if defined(DEBUG_ANALOGBUFIO) #if defined(DEBUG_ANALOGBUFIO)
mp_printf(&mp_plat_print,"Captured bytes: %d\n",captured_bytes); mp_printf(&mp_plat_print, "Captured bytes: %d\n", captured_bytes);
#endif // DEBUG_ANALOGBUFIO #endif // DEBUG_ANALOGBUFIO
return captured_samples; return captured_samples;
} }

View File

@ -77,7 +77,7 @@ STATIC void install_all_match_filter(canio_listener_obj_t *self) {
self->standard = true; self->standard = true;
} }
__attribute__((noinline,optimize("O0"))) __attribute__((noinline, optimize("O0")))
STATIC void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) { STATIC void set_filters(canio_listener_obj_t *self, size_t nmatch, canio_match_obj_t **matches) {
twai_ll_enter_reset_mode(&TWAI); twai_ll_enter_reset_mode(&TWAI);
@ -163,7 +163,7 @@ mp_obj_t common_hal_canio_listener_receive(canio_listener_obj_t *self) {
int dlc = self->message_in.data_length_code; int dlc = self->message_in.data_length_code;
canio_message_obj_t *message = canio_message_obj_t *message =
mp_obj_malloc(canio_message_obj_t,rtr ? &canio_remote_transmission_request_type : &canio_message_type); mp_obj_malloc(canio_message_obj_t, rtr ? &canio_remote_transmission_request_type : &canio_message_type);
message->extended = self->message_in.extd; message->extended = self->message_in.extd;
message->id = self->message_in.identifier; message->id = self->message_in.identifier;
message->size = dlc; message->size = dlc;

View File

@ -411,7 +411,7 @@ void common_hal_socketpool_socket_connect(socketpool_socket_obj_t *self,
// Switch to blocking mode for this one call // Switch to blocking mode for this one call
int opts; int opts;
opts = lwip_fcntl(self->num,F_GETFL,0); opts = lwip_fcntl(self->num, F_GETFL, 0);
opts = opts & (~O_NONBLOCK); opts = opts & (~O_NONBLOCK);
lwip_fcntl(self->num, F_SETFL, opts); lwip_fcntl(self->num, F_SETFL, opts);

View File

@ -33,7 +33,7 @@
static const char *TAG = "ESP32S2_I2S_LCD"; static const char *TAG = "ESP32S2_I2S_LCD";
#define I2S_CHECK(a, str, ret) if (!(a)) { \ #define I2S_CHECK(a, str, ret) if (!(a)) { \
ESP_LOGE(TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \ ESP_LOGE(TAG, "%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, str); \
return ret; \ return ret; \
} }
@ -401,7 +401,7 @@ i2s_lcd_handle_t i2s_lcd_driver_init(const i2s_lcd_config_t *config) {
esp_err_t ret = lcd_cam_init(i2s_lcd_drv, config); esp_err_t ret = lcd_cam_init(i2s_lcd_drv, config);
if (ESP_OK != ret) { if (ESP_OK != ret) {
ESP_LOGE(TAG,"%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, "i2s lcd driver initialize failed"); ESP_LOGE(TAG, "%s:%d (%s):%s", __FILE__, __LINE__, __FUNCTION__, "i2s lcd driver initialize failed");
heap_caps_free(i2s_lcd_drv); heap_caps_free(i2s_lcd_drv);
return NULL; return NULL;
} }

View File

@ -41,9 +41,9 @@ static inline unsigned int irq_getie(void) {
static inline void irq_setie(unsigned int ie) { static inline void irq_setie(unsigned int ie) {
if (ie) { if (ie) {
csrs(mstatus,CSR_MSTATUS_MIE); csrs(mstatus, CSR_MSTATUS_MIE);
} else { } else {
csrc(mstatus,CSR_MSTATUS_MIE); csrc(mstatus, CSR_MSTATUS_MIE);
} }
} }

View File

@ -92,9 +92,9 @@ static inline void bb_spi_en(unsigned int en) {
__attribute__((section(".ramtext"))) __attribute__((section(".ramtext")))
static inline void bb_spi_irq_setie(unsigned int ie) { static inline void bb_spi_irq_setie(unsigned int ie) {
if (ie) { if (ie) {
csrs(mstatus,CSR_MSTATUS_MIE); csrs(mstatus, CSR_MSTATUS_MIE);
} else { } else {
csrc(mstatus,CSR_MSTATUS_MIE); csrc(mstatus, CSR_MSTATUS_MIE);
} }
} }

View File

@ -30,8 +30,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_GPIO_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_GPIO_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_03) },
// SD control // SD control
{ MP_OBJ_NEW_QSTR(MP_QSTR_SD_CD), MP_ROM_PTR(&pin_GPIO_AD_11) }, { MP_OBJ_NEW_QSTR(MP_QSTR_SD_CD), MP_ROM_PTR(&pin_GPIO_AD_11) },

View File

@ -30,8 +30,8 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO_05) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO_04) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_GPIO_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO_03) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_D13),MP_ROM_PTR(&pin_GPIO_03) }, { MP_OBJ_NEW_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO_03) },
// ESP control // ESP control
{ MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_GPIO_AD_14) }, { MP_OBJ_NEW_QSTR(MP_QSTR_ESP_CS), MP_ROM_PTR(&pin_GPIO_AD_14) },

View File

@ -25,15 +25,8 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
<<<<<<<< HEAD:ports/mimxrt10xx/boards/teensy40/board.c
#include "supervisor/board.h" #include "supervisor/board.h"
#include "shared-bindings/microcontroller/Pin.h" #include "shared-bindings/microcontroller/Pin.h"
========
#include <stdbool.h>
#include "py/mpconfig.h"
#include "fsl_edma.h"
#include "dma_manager.h"
>>>>>>>> v1.19.1:ports/raspberrypi/dma_manager.c
// These pins should never ever be reset; doing so could interfere with basic operation. // These pins should never ever be reset; doing so could interfere with basic operation.
// Used in common-hal/microcontroller/Pin.c // Used in common-hal/microcontroller/Pin.c
@ -61,35 +54,4 @@ const mcu_pin_obj_t *mimxrt10xx_reset_forbidden_pins[] = {
NULL, // Must end in NULL. NULL, // Must end in NULL.
}; };
<<<<<<<< HEAD:ports/mimxrt10xx/boards/teensy40/board.c
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. // Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
========
STATIC bool dma_initialized = false;
// allocate_channel(): retrieve an available channel. Return the number or -1
int allocate_dma_channel(void) {
for (int i = 0; i < ARRAY_SIZE(channel_list); i++) {
if (channel_list[i] == false) { // Channel available
channel_list[i] = true;
return i;
}
}
return -1;
}
// free_channel(n): Declare channel as free
void free_dma_channel(int n) {
if (n >= 0 && n <= ARRAY_SIZE(channel_list)) {
channel_list[n] = false;
}
}
void dma_init(void) {
if (!dma_initialized) {
edma_config_t dmaConfig;
EDMA_GetDefaultConfig(&dmaConfig);
EDMA_Init(DMA0, &dmaConfig);
dma_initialized = true;
}
}
>>>>>>>> v1.19.1:ports/raspberrypi/dma_manager.c

View File

@ -47,7 +47,7 @@
#if ENABLE_DEBUG_PRINTING #if ENABLE_DEBUG_PRINTING
#define DBGPrintf mp_printf #define DBGPrintf mp_printf
#else #else
#define DBGPrintf(p,...) #define DBGPrintf(p, ...)
#endif #endif

View File

@ -305,7 +305,7 @@ void clocks_init(void) {
/* Set SAI3 MCLK3 clock source. */ /* Set SAI3 MCLK3 clock source. */
IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0); IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0);
/* Set MQS configuration. */ /* Set MQS configuration. */
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0); IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0);
/* Set GPT1 High frequency reference clock source. */ /* Set GPT1 High frequency reference clock source. */
IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT1_MASK; IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT1_MASK;
/* Set GPT2 High frequency reference clock source. */ /* Set GPT2 High frequency reference clock source. */

View File

@ -370,7 +370,7 @@ void clocks_init(void) {
/* Set SAI3 MCLK3 clock source. */ /* Set SAI3 MCLK3 clock source. */
IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0); IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0);
/* Set MQS configuration. */ /* Set MQS configuration. */
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0); IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0);
/* Set ENET Ref clock source. */ /* Set ENET Ref clock source. */
IOMUXC_GPR->GPR1 &= ~IOMUXC_GPR_GPR1_ENET1_TX_CLK_DIR_MASK; IOMUXC_GPR->GPR1 &= ~IOMUXC_GPR_GPR1_ENET1_TX_CLK_DIR_MASK;
/* Set GPT1 High frequency reference clock source. */ /* Set GPT1 High frequency reference clock source. */

View File

@ -383,7 +383,7 @@ void clocks_init(void) {
/* Set SAI3 MCLK3 clock source. */ /* Set SAI3 MCLK3 clock source. */
IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0); IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0);
/* Set MQS configuration. */ /* Set MQS configuration. */
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0); IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0);
/* Set ENET Ref clock source. */ /* Set ENET Ref clock source. */
#if defined(IOMUXC_GPR_GPR1_ENET_REF_CLK_DIR_MASK) #if defined(IOMUXC_GPR_GPR1_ENET_REF_CLK_DIR_MASK)
IOMUXC_GPR->GPR1 &= ~IOMUXC_GPR_GPR1_ENET_REF_CLK_DIR_MASK; IOMUXC_GPR->GPR1 &= ~IOMUXC_GPR_GPR1_ENET_REF_CLK_DIR_MASK;

View File

@ -318,7 +318,7 @@ void clocks_init(void) {
/* Set SAI3 MCLK3 clock source. */ /* Set SAI3 MCLK3 clock source. */
IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0); IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0);
/* Set MQS configuration. */ /* Set MQS configuration. */
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0); IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0);
/* Set ENET1 Tx clock source. */ /* Set ENET1 Tx clock source. */
IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1RefClkMode, false); IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1RefClkMode, false);
/* Set ENET2 Tx clock source. */ /* Set ENET2 Tx clock source. */

View File

@ -640,7 +640,7 @@ void clocks_init(void) {
IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0); IOMUXC_SetSaiMClkClockSource(IOMUXC_GPR, kIOMUXC_GPR_SAI3MClk3Sel, 0);
/* Set MQS configuration. */ /* Set MQS configuration. */
IOMUXC_MQSConfig(IOMUXC_GPR,kIOMUXC_MqsPwmOverSampleRate32, 0); IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate32, 0);
/* Set ENET Ref clock source. */ /* Set ENET Ref clock source. */
IOMUXC_GPR->GPR4 &= ~IOMUXC_GPR_GPR4_ENET_REF_CLK_DIR_MASK; IOMUXC_GPR->GPR4 &= ~IOMUXC_GPR_GPR4_ENET_REF_CLK_DIR_MASK;
/* Set ENET_1G Tx clock source. */ /* Set ENET_1G Tx clock source. */

View File

@ -321,7 +321,7 @@ __attribute__((used, naked, no_instrument_function, optimize("no-tree-loop-distr
main(); main();
} }
void __attribute__((no_instrument_function,section(".itcm.profile_enter"),long_call)) __cyg_profile_func_enter(void *this_fn, void __attribute__((no_instrument_function, section(".itcm.profile_enter"), long_call)) __cyg_profile_func_enter(void *this_fn,
void *call_site) { void *call_site) {
if ((ITM->TER & (1 << 3)) == 0) { if ((ITM->TER & (1 << 3)) == 0) {
return; return;
@ -333,7 +333,7 @@ void __attribute__((no_instrument_function,section(".itcm.profile_enter"),long_c
ITM->PORT[3].u32 = addr; ITM->PORT[3].u32 = addr;
} }
void __attribute__((no_instrument_function,section(".itcm.profile_exit"),long_call)) __cyg_profile_func_exit(void *this_fn, void __attribute__((no_instrument_function, section(".itcm.profile_exit"), long_call)) __cyg_profile_func_exit(void *this_fn,
void *call_site) { void *call_site) {
if ((ITM->TER & (1 << 4)) == 0) { if ((ITM->TER & (1 << 4)) == 0) {
return; return;

View File

@ -49,10 +49,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_P1_00) }, { MP_ROM_QSTR(MP_QSTR_PDM_CLK), MP_ROM_PTR(&pin_P1_00) },
{ MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_P0_16) }, { MP_ROM_QSTR(MP_QSTR_PDM_DATA), MP_ROM_PTR(&pin_P0_16) },
{MP_ROM_QSTR(MP_QSTR_READ_BATT_ENABLE),MP_ROM_PTR(&pin_P0_14)}, {MP_ROM_QSTR(MP_QSTR_READ_BATT_ENABLE), MP_ROM_PTR(&pin_P0_14)},
{MP_ROM_QSTR(MP_QSTR_VBATT),MP_ROM_PTR(&pin_P0_31)}, {MP_ROM_QSTR(MP_QSTR_VBATT), MP_ROM_PTR(&pin_P0_31)},
{MP_ROM_QSTR(MP_QSTR_CHARGE_STATUS),MP_ROM_PTR(&pin_P0_17)}, {MP_ROM_QSTR(MP_QSTR_CHARGE_STATUS), MP_ROM_PTR(&pin_P0_17)},
{MP_ROM_QSTR(MP_QSTR_CHARGE_RATE),MP_ROM_PTR(&pin_P0_13)}, {MP_ROM_QSTR(MP_QSTR_CHARGE_RATE), MP_ROM_PTR(&pin_P0_13)},
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, { 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_SPI), MP_ROM_PTR(&board_spi_obj) },

View File

@ -39,7 +39,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_15) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_15) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_16) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_16) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL),MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_07) }, { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_07) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_08) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P1_08) },

View File

@ -37,11 +37,11 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) },
{ MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_06) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON),MP_ROM_PTR(&pin_P1_06) }, { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_P1_06) },
{ MP_ROM_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_P0_19) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_19) },
{ MP_ROM_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_P0_23) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_23) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_12) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_12) },

View File

@ -14,15 +14,15 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_10) }, { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_10) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_14) }, { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_14) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_26) },
{ MP_ROM_QSTR(MP_QSTR_D10),MP_ROM_PTR(&pin_P0_17) }, { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_17) },
{ MP_ROM_QSTR(MP_QSTR_D14),MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_08) },
{ MP_ROM_QSTR(MP_QSTR_D15),MP_ROM_PTR(&pin_P0_06) }, { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_P0_06) },
{ MP_ROM_QSTR(MP_QSTR_D16),MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_D17),MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_D18),MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_P0_02) },
{ MP_ROM_QSTR(MP_QSTR_D19),MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_P0_03) },
{ MP_ROM_QSTR(MP_QSTR_D20),MP_ROM_PTR(&pin_P0_04) }, { MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_P0_04) },
{ MP_ROM_QSTR(MP_QSTR_D21),MP_ROM_PTR(&pin_P0_05) }, { MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_P0_05) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) }, { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_P0_02) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) }, { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_03) },
@ -31,10 +31,10 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_29) },
{ MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) }, { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) },
{ MP_ROM_QSTR(MP_QSTR_LED),MP_ROM_PTR(&pin_P0_31) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_31) },
{ MP_ROM_QSTR(MP_QSTR_SDA),MP_ROM_PTR(&pin_P0_29) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_29) },
{ MP_ROM_QSTR(MP_QSTR_SCL),MP_ROM_PTR(&pin_P0_23) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_23) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) }, { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_13) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_08) }, { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_08) },

View File

@ -233,11 +233,11 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
nrf_sleep_source_t cause = _get_wakeup_cause(); nrf_sleep_source_t cause = _get_wakeup_cause();
switch (cause) { switch (cause) {
case NRF_SLEEP_WAKEUP_TIMER: { case NRF_SLEEP_WAKEUP_TIMER: {
wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
case NRF_SLEEP_WAKEUP_GPIO: { case NRF_SLEEP_WAKEUP_GPIO: {
wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
default: default:

View File

@ -82,9 +82,9 @@ void common_hal_mcu_enable_interrupts() {
void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) { void common_hal_mcu_on_next_reset(mcu_runmode_t runmode) {
enum { DFU_MAGIC_UF2_RESET = 0x57 }; enum { DFU_MAGIC_UF2_RESET = 0x57 };
if (runmode == RUNMODE_BOOTLOADER || runmode == RUNMODE_UF2) { if (runmode == RUNMODE_BOOTLOADER || runmode == RUNMODE_UF2) {
sd_power_gpregret_set(0,DFU_MAGIC_UF2_RESET); sd_power_gpregret_set(0, DFU_MAGIC_UF2_RESET);
} else { } else {
sd_power_gpregret_set(0,0); sd_power_gpregret_set(0, 0);
} }
if (runmode == RUNMODE_SAFE_MODE) { if (runmode == RUNMODE_SAFE_MODE) {
safe_mode_on_next_reset(SAFE_MODE_PROGRAMMATIC); safe_mode_on_next_reset(SAFE_MODE_PROGRAMMATIC);

View File

@ -175,7 +175,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
ARG_user_interruptible, ARG_user_interruptible,
ARG_wrap_target, ARG_wrap_target,
ARG_wrap, ARG_wrap,
ARG_offset,}; ARG_offset, };
static const mp_arg_t allowed_args[] = { static const mp_arg_t allowed_args[] = {
{ MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ }, { MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ },
{ MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_INT }, { MP_QSTR_frequency, MP_ARG_REQUIRED | MP_ARG_INT },

View File

@ -168,11 +168,11 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
uint8_t cause = _get_wakeup_cause(); uint8_t cause = _get_wakeup_cause();
switch (cause) { switch (cause) {
case RP_SLEEP_WAKEUP_RTC: { case RP_SLEEP_WAKEUP_RTC: {
wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
case RP_SLEEP_WAKEUP_GPIO: { case RP_SLEEP_WAKEUP_GPIO: {
wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
default: default:

View File

@ -79,7 +79,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t *self,
common_hal_pulseio_pulsein_pause(self); common_hal_pulseio_pulsein_pause(self);
common_hal_rp2pio_statemachine_set_interrupt_handler(&(self->state_machine),&common_hal_pulseio_pulsein_interrupt,self,PIO_IRQ0_INTE_SM0_RXNEMPTY_BITS); common_hal_rp2pio_statemachine_set_interrupt_handler(&(self->state_machine), &common_hal_pulseio_pulsein_interrupt, self, PIO_IRQ0_INTE_SM0_RXNEMPTY_BITS);
common_hal_pulseio_pulsein_resume(self, 0); common_hal_pulseio_pulsein_resume(self, 0);
} }
@ -102,7 +102,7 @@ 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_pause(pulseio_pulsein_obj_t *self) {
pio_sm_restart(self->state_machine.pio, self->state_machine.state_machine); pio_sm_restart(self->state_machine.pio, self->state_machine.state_machine);
pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false); pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, false);
pio_sm_clear_fifos(self->state_machine.pio,self->state_machine.state_machine); pio_sm_clear_fifos(self->state_machine.pio, self->state_machine.state_machine);
self->last_level = self->idle_state; self->last_level = self->idle_state;
self->level_count = 0; self->level_count = 0;
self->paused = true; self->paused = true;
@ -149,18 +149,18 @@ void common_hal_pulseio_pulsein_resume(pulseio_pulsein_obj_t *self,
common_hal_pulseio_pulsein_pause(self); common_hal_pulseio_pulsein_pause(self);
// Send the trigger pulse. // Send the trigger pulse.
if (trigger_duration > 0) { if (trigger_duration > 0) {
gpio_set_function(self->pin,GPIO_FUNC_SIO); gpio_set_function(self->pin, GPIO_FUNC_SIO);
gpio_set_dir(self->pin,true); gpio_set_dir(self->pin, true);
gpio_put(self->pin, !self->idle_state); gpio_put(self->pin, !self->idle_state);
common_hal_mcu_delay_us((uint32_t)trigger_duration); common_hal_mcu_delay_us((uint32_t)trigger_duration);
gpio_set_function(self->pin,GPIO_FUNC_PIO0); gpio_set_function(self->pin, GPIO_FUNC_PIO0);
} }
// exec a wait for the selected pin to change state // exec a wait for the selected pin to change state
if (self->idle_state == true) { if (self->idle_state == true) {
pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x2020); pio_sm_exec(self->state_machine.pio, self->state_machine.state_machine, 0x2020);
} else { } else {
pio_sm_exec(self->state_machine.pio,self->state_machine.state_machine,0x20a0); pio_sm_exec(self->state_machine.pio, self->state_machine.state_machine, 0x20a0);
} }
pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true); pio_sm_set_enabled(self->state_machine.pio, self->state_machine.state_machine, true);
self->paused = false; self->paused = false;

View File

@ -151,7 +151,7 @@ void reset_rp2pio_statemachine(void) {
irq_handler_t int_handler = irq_get_exclusive_handler(irq); irq_handler_t int_handler = irq_get_exclusive_handler(irq);
if (int_handler > 0) { if (int_handler > 0) {
irq_set_enabled(irq, false); irq_set_enabled(irq, false);
irq_remove_handler(irq,int_handler); irq_remove_handler(irq, int_handler);
} }
} }
} }

View File

@ -168,9 +168,9 @@ STATIC mp_obj_t sensor_imu_get(void) {
avec_obj[0] = mp_obj_new_int(avec[0]); avec_obj[0] = mp_obj_new_int(avec[0]);
avec_obj[1] = mp_obj_new_int(avec[1]); avec_obj[1] = mp_obj_new_int(avec[1]);
avec_obj[2] = mp_obj_new_int(avec[2]); avec_obj[2] = mp_obj_new_int(avec[2]);
ret[0] = mp_obj_new_list(3,ovec_obj); ret[0] = mp_obj_new_list(3, ovec_obj);
ret[1] = mp_obj_new_list(3,avec_obj); ret[1] = mp_obj_new_list(3, avec_obj);
return mp_obj_new_tuple(2,ret); return mp_obj_new_tuple(2, ret);
} }
STATIC mp_obj_t sensor_imu_calibrate(void) { STATIC mp_obj_t sensor_imu_calibrate(void) {
@ -182,15 +182,15 @@ STATIC mp_obj_t sensor_imu_calibrate(void) {
return mp_const_true; return mp_const_true;
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(sensor_init_obj,sensor_init); STATIC MP_DEFINE_CONST_FUN_OBJ_1(sensor_init_obj, sensor_init);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_deinit_obj,sensor_deinit); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_deinit_obj, sensor_deinit);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_temperature_obj,sensor_get_temperature); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_temperature_obj, sensor_get_temperature);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_humidity_obj,sensor_get_humidity); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_humidity_obj, sensor_get_humidity);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_lux_obj,sensor_get_lux); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_lux_obj, sensor_get_lux);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_hall_obj,sensor_get_hall); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_hall_obj, sensor_get_hall);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_pressure_obj,sensor_get_pressure); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_get_pressure_obj, sensor_get_pressure);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_imu_get_obj,sensor_imu_get); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_imu_get_obj, sensor_imu_get);
STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_imu_calibrate_obj,sensor_imu_calibrate); STATIC MP_DEFINE_CONST_FUN_OBJ_0(sensor_imu_calibrate_obj, sensor_imu_calibrate);
STATIC const mp_rom_map_elem_t sensor_globals_table[] = { STATIC const mp_rom_map_elem_t sensor_globals_table[] = {

View File

@ -193,9 +193,9 @@ size_t common_hal_bleio_characteristic_get_value(
if (common_hal_bleio_service_get_is_remote(self->service)) { if (common_hal_bleio_service_get_is_remote(self->service)) {
// ble client gets characteristic value // ble client gets characteristic value
if (BT_GATT_CHRC_READ & self->props) { if (BT_GATT_CHRC_READ & self->props) {
sc = sl_bt_gatt_read_characteristic_value(conn_handle,self->handle); sc = sl_bt_gatt_read_characteristic_value(conn_handle, self->handle);
while (SL_STATUS_OK != sc && retry > 0) { while (SL_STATUS_OK != sc && retry > 0) {
sc = sl_bt_gatt_read_characteristic_value(conn_handle,self->handle); sc = sl_bt_gatt_read_characteristic_value(conn_handle, self->handle);
vTaskDelay(100 / portTICK_PERIOD_MS); vTaskDelay(100 / portTICK_PERIOD_MS);
retry--; retry--;
} }
@ -372,7 +372,7 @@ void common_hal_bleio_characteristic_add_descriptor(
// Set the remote characteristics CCCD to enable or disable notification and indication. // Set the remote characteristics CCCD to enable or disable notification and indication.
void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self, void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self,
bool notify,bool indicate) { bool notify, bool indicate) {
sl_status_t sc = SL_STATUS_FAIL; sl_status_t sc = SL_STATUS_FAIL;
@ -383,7 +383,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self,
indicate = 0; indicate = 0;
if (notify) { if (notify) {
sc = sl_bt_gatt_set_characteristic_notification(conn_handle, sc = sl_bt_gatt_set_characteristic_notification(conn_handle,
self->handle,sl_bt_gatt_notification); self->handle, sl_bt_gatt_notification);
if (SL_STATUS_OK != sc) { if (SL_STATUS_OK != sc) {
mp_raise_bleio_BluetoothError(translate("Notify fail")); mp_raise_bleio_BluetoothError(translate("Notify fail"));
} }
@ -391,7 +391,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self,
if (indicate) { if (indicate) {
sc = sl_bt_gatt_set_characteristic_notification(conn_handle, sc = sl_bt_gatt_set_characteristic_notification(conn_handle,
self->handle,sl_bt_gatt_indication); self->handle, sl_bt_gatt_indication);
if (SL_STATUS_OK != sc) { if (SL_STATUS_OK != sc) {
mp_raise_bleio_BluetoothError(translate("Indicate fail")); mp_raise_bleio_BluetoothError(translate("Indicate fail"));
} }
@ -399,7 +399,7 @@ void common_hal_bleio_characteristic_set_cccd(bleio_characteristic_obj_t *self,
if (0 == notify && 0 == indicate) { if (0 == notify && 0 == indicate) {
sc = sl_bt_gatt_set_characteristic_notification(conn_handle, sc = sl_bt_gatt_set_characteristic_notification(conn_handle,
self->handle,sl_bt_gatt_disable); self->handle, sl_bt_gatt_disable);
if (SL_STATUS_OK != sc) { if (SL_STATUS_OK != sc) {
mp_raise_bleio_BluetoothError(translate("Indicate fail")); mp_raise_bleio_BluetoothError(translate("Indicate fail"));
} }

View File

@ -57,7 +57,7 @@ bool characteristic_buffer_on_ble_evt(uint16_t attribute,
} }
} }
} else { } else {
ringbuf_put_n(&bleio_characteristic_buffer_list.data[cindex]->ringbuf,data, len); ringbuf_put_n(&bleio_characteristic_buffer_list.data[cindex]->ringbuf, data, len);
} }
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();

View File

@ -101,7 +101,7 @@ mp_float_t common_hal_bleio_connection_get_connection_interval(
mp_int_t common_hal_bleio_connection_get_max_packet_length( mp_int_t common_hal_bleio_connection_get_max_packet_length(
bleio_connection_internal_t *self) { bleio_connection_internal_t *self) {
sl_status_t sc = sl_bt_gatt_server_get_mtu(self->conn_handle,&self->mtu); sl_status_t sc = sl_bt_gatt_server_get_mtu(self->conn_handle, &self->mtu);
if (sc != SL_STATUS_OK) { if (sc != SL_STATUS_OK) {
mp_raise_bleio_BluetoothError(translate("gatt_server_get_mtu fail.")); mp_raise_bleio_BluetoothError(translate("gatt_server_get_mtu fail."));
} }
@ -136,7 +136,7 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(
xdiscovery_event = xEventGroupCreate(); xdiscovery_event = xEventGroupCreate();
if (xdiscovery_event != NULL) { if (xdiscovery_event != NULL) {
xEventGroupClearBits(xdiscovery_event,1 << 0); xEventGroupClearBits(xdiscovery_event, 1 << 0);
} }
self->connection->remote_service_list = mp_obj_new_list(0, NULL); self->connection->remote_service_list = mp_obj_new_list(0, NULL);
bleio_connection_ensure_connected(self); bleio_connection_ensure_connected(self);
@ -161,7 +161,7 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(
ux_bits = xEventGroupWaitBits( ux_bits = xEventGroupWaitBits(
xdiscovery_event, xdiscovery_event,
1 << 0, 1 << 0,
pdTRUE,pdFALSE, pdTRUE, pdFALSE,
DISCOVERY_TIMEOUT_MS / portTICK_PERIOD_MS); DISCOVERY_TIMEOUT_MS / portTICK_PERIOD_MS);
if ((ux_bits & (1 << 0)) == (1 << 0)) { if ((ux_bits & (1 << 0)) == (1 << 0)) {
@ -189,7 +189,7 @@ mp_obj_tuple_t *common_hal_bleio_connection_discover_remote_services(
uuid16_value[0] = uuid->efr_ble_uuid.uuid16.value & 0xff; uuid16_value[0] = uuid->efr_ble_uuid.uuid16.value & 0xff;
uuid16_value[1] = uuid->efr_ble_uuid.uuid16.value >> 8; uuid16_value[1] = uuid->efr_ble_uuid.uuid16.value >> 8;
sc = sl_bt_gatt_discover_primary_services_by_uuid( sc = sl_bt_gatt_discover_primary_services_by_uuid(
self->connection->conn_handle,2,uuid16_value); self->connection->conn_handle, 2, uuid16_value);
} else if (BLE_UUID_TYPE_128 == uuid->efr_ble_uuid.uuid.type) { } else if (BLE_UUID_TYPE_128 == uuid->efr_ble_uuid.uuid.type) {
sc = sl_bt_gatt_discover_primary_services_by_uuid( sc = sl_bt_gatt_discover_primary_services_by_uuid(

View File

@ -125,13 +125,13 @@ void sl_bt_on_event(sl_bt_msg_t *evt) {
sl_bt_system_get_identity_address(&address, &address_type); sl_bt_system_get_identity_address(&address, &address_type);
snprintf((char *)device_name, 14 + 1, snprintf((char *)device_name, 14 + 1,
"CIRCUITPY-%X%X",address.addr[1], address.addr[0]); "CIRCUITPY-%X%X", address.addr[1], address.addr[0]);
sl_bt_gatt_server_write_attribute_value(gattdb_device_name, sl_bt_gatt_server_write_attribute_value(gattdb_device_name,
0,14,device_name); 0, 14, device_name);
sl_bt_sm_store_bonding_configuration(5,2); sl_bt_sm_store_bonding_configuration(5, 2);
sl_bt_sm_configure(0x00,sl_bt_sm_io_capability_noinputnooutput); sl_bt_sm_configure(0x00, sl_bt_sm_io_capability_noinputnooutput);
sl_bt_sm_set_bondable_mode(1); sl_bt_sm_set_bondable_mode(1);
break; break;
@ -162,7 +162,7 @@ void sl_bt_on_event(sl_bt_msg_t *evt) {
&evt->data.evt_scanner_legacy_advertisement_report.data); &evt->data.evt_scanner_legacy_advertisement_report.data);
if (xscan_event != NULL) { if (xscan_event != NULL) {
xEventGroupSetBits(xscan_event,1 << 0); xEventGroupSetBits(xscan_event, 1 << 0);
} }
break; break;
@ -289,7 +289,7 @@ void sl_bt_on_event(sl_bt_msg_t *evt) {
conn_state = RUNNING; conn_state = RUNNING;
serv_idx = 0; serv_idx = 0;
if (xdiscovery_event != NULL) { if (xdiscovery_event != NULL) {
xEventGroupSetBits(xdiscovery_event,1 << 0); xEventGroupSetBits(xdiscovery_event, 1 << 0);
} }
} }
} }
@ -338,7 +338,7 @@ void sl_bt_on_event(sl_bt_msg_t *evt) {
break; break;
case sl_bt_evt_sm_confirm_bonding_id: case sl_bt_evt_sm_confirm_bonding_id:
sl_bt_sm_bonding_confirm(evt->data.evt_sm_confirm_bonding.connection,1); sl_bt_sm_bonding_confirm(evt->data.evt_sm_confirm_bonding.connection, 1);
break; break;
case sl_bt_evt_sm_bonded_id: case sl_bt_evt_sm_bonded_id:

View File

@ -111,7 +111,7 @@ void common_hal_busio_uart_construct(busio_uart_obj_t *self,
uartdrv_usart_init.txQueue = (UARTDRV_Buffer_FifoQueue_t *) uartdrv_usart_init.txQueue = (UARTDRV_Buffer_FifoQueue_t *)
&uartdrv_usart_tx_buffer; &uartdrv_usart_tx_buffer;
if (UARTDRV_InitUart(self->handle,&uartdrv_usart_init) if (UARTDRV_InitUart(self->handle, &uartdrv_usart_init)
!= ECODE_EMDRV_UARTDRV_OK) { != ECODE_EMDRV_UARTDRV_OK) {
mp_raise_RuntimeError(translate("UART init")); mp_raise_RuntimeError(translate("UART init"));
} }
@ -183,7 +183,7 @@ void UARTDRV_Receive_Callback(UARTDRV_Handle_t *handle,
taskENTER_CRITICAL(); taskENTER_CRITICAL();
ringbuf_put_n(&context->ringbuf, &context->rx_char, 1); ringbuf_put_n(&context->ringbuf, &context->rx_char, 1);
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();
errflag = UARTDRV_Receive(context->handle,&context->rx_char,1, errflag = UARTDRV_Receive(context->handle, &context->rx_char, 1,
(UARTDRV_Callback_t)UARTDRV_Receive_Callback); (UARTDRV_Callback_t)UARTDRV_Receive_Callback);
if (context->sigint_enabled) { if (context->sigint_enabled) {
if (context->rx_char == CHAR_CTRL_C) { if (context->rx_char == CHAR_CTRL_C) {
@ -213,7 +213,7 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data,
RUN_BACKGROUND_TASKS; RUN_BACKGROUND_TASKS;
// restart if it failed in the callback // restart if it failed in the callback
if (errflag != ECODE_EMDRV_UARTDRV_OK) { if (errflag != ECODE_EMDRV_UARTDRV_OK) {
errflag = UARTDRV_Receive(self->handle,&self->rx_char,1, errflag = UARTDRV_Receive(self->handle, &self->rx_char, 1,
(UARTDRV_Callback_t)UARTDRV_Receive_Callback); (UARTDRV_Callback_t)UARTDRV_Receive_Callback);
} }
// Allow user to break out of a timeout with a KeyboardInterrupt. // Allow user to break out of a timeout with a KeyboardInterrupt.

View File

@ -64,11 +64,11 @@ void common_hal_digitalio_digitalinout_deinit(
digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_input( digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_input(
digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) { digitalio_digitalinout_obj_t *self, digitalio_pull_t pull) {
if (pull == PULL_NONE) { if (pull == PULL_NONE) {
GPIO_PinModeSet(self->pin->port,self->pin->number,gpioModeInput,1); GPIO_PinModeSet(self->pin->port, self->pin->number, gpioModeInput, 1);
} else if (pull == PULL_UP) { } else if (pull == PULL_UP) {
GPIO_PinModeSet(self->pin->port,self->pin->number,gpioModeInputPull,1); GPIO_PinModeSet(self->pin->port, self->pin->number, gpioModeInputPull, 1);
} else { } else {
GPIO_PinModeSet(self->pin->port,self->pin->number,gpioModeInputPull,0); GPIO_PinModeSet(self->pin->port, self->pin->number, gpioModeInputPull, 0);
} }
return DIGITALINOUT_OK; return DIGITALINOUT_OK;
} }
@ -78,11 +78,11 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(
digitalio_digitalinout_obj_t *self, bool value, digitalio_digitalinout_obj_t *self, bool value,
digitalio_drive_mode_t drive_mode) { digitalio_drive_mode_t drive_mode) {
if (drive_mode == DRIVE_MODE_OPEN_DRAIN) { if (drive_mode == DRIVE_MODE_OPEN_DRAIN) {
GPIO_PinModeSet(self->pin->port,self->pin->number, GPIO_PinModeSet(self->pin->port, self->pin->number,
gpioModeWiredAnd,value); gpioModeWiredAnd, value);
} else { } else {
GPIO_PinModeSet(self->pin->port,self->pin->number, GPIO_PinModeSet(self->pin->port, self->pin->number,
gpioModePushPull,value); gpioModePushPull, value);
} }
if (value) { if (value) {
@ -97,7 +97,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_switch_to_output(
// Get direction of the pin // Get direction of the pin
digitalio_direction_t common_hal_digitalio_digitalinout_get_direction( digitalio_direction_t common_hal_digitalio_digitalinout_get_direction(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
GPIO_Mode_TypeDef mode = GPIO_PinModeGet(self->pin->port,self->pin->number); GPIO_Mode_TypeDef mode = GPIO_PinModeGet(self->pin->port, self->pin->number);
if (mode >= gpioModePushPull) { if (mode >= gpioModePushPull) {
return DIRECTION_OUTPUT; return DIRECTION_OUTPUT;
} }
@ -129,9 +129,9 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(
digitalio_digitalinout_obj_t *self, digitalio_digitalinout_obj_t *self,
digitalio_drive_mode_t drive_mode) { digitalio_drive_mode_t drive_mode) {
if (drive_mode == DRIVE_MODE_OPEN_DRAIN) { if (drive_mode == DRIVE_MODE_OPEN_DRAIN) {
GPIO_PinModeSet(self->pin->port,self->pin->number,gpioModeWiredAnd,1); GPIO_PinModeSet(self->pin->port, self->pin->number, gpioModeWiredAnd, 1);
} else { } else {
GPIO_PinModeSet(self->pin->port,self->pin->number,gpioModePushPull,1); GPIO_PinModeSet(self->pin->port, self->pin->number, gpioModePushPull, 1);
} }
return DIGITALINOUT_OK; return DIGITALINOUT_OK;
} }
@ -139,7 +139,7 @@ digitalinout_result_t common_hal_digitalio_digitalinout_set_drive_mode(
// Get drive mode // Get drive mode
digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode( digitalio_drive_mode_t common_hal_digitalio_digitalinout_get_drive_mode(
digitalio_digitalinout_obj_t *self) { digitalio_digitalinout_obj_t *self) {
GPIO_Mode_TypeDef mode = GPIO_PinModeGet(self->pin->port,self->pin->number); GPIO_Mode_TypeDef mode = GPIO_PinModeGet(self->pin->port, self->pin->number);
if (mode >= gpioModeWiredAnd) { if (mode >= gpioModeWiredAnd) {
return DRIVE_MODE_OPEN_DRAIN; return DRIVE_MODE_OPEN_DRAIN;
} }

View File

@ -47,9 +47,9 @@ void reset_all_pins(void) {
for (port_num = 0; port_num < GPIO_PORT_COUNT; port_num++) { for (port_num = 0; port_num < GPIO_PORT_COUNT; port_num++) {
for (pin_num = 0; pin_num < 16; pin_num++) { for (pin_num = 0; pin_num < 16; pin_num++) {
if (GPIO_PORT_PIN_VALID(ports[port_num],pin_num) if (GPIO_PORT_PIN_VALID(ports[port_num], pin_num)
&& !(never_reset_pins[port_num] >> pin_num & 0x01)) { && !(never_reset_pins[port_num] >> pin_num & 0x01)) {
GPIO_PinModeSet(ports[port_num], pin_num,gpioModeInput,1); GPIO_PinModeSet(ports[port_num], pin_num, gpioModeInput, 1);
} }
} }
} }

View File

@ -86,7 +86,7 @@ void port_internal_flash_flush(void) {
reset_into_safe_mode(SAFE_MODE_FLASH_WRITE_FAIL); reset_into_safe_mode(SAFE_MODE_FLASH_WRITE_FAIL);
} }
taskENTER_CRITICAL(); taskENTER_CRITICAL();
ret = MSC_WriteWord((uint32_t *)_flash_page_addr,_flash_cache,FLASH_PAGE_SIZE); ret = MSC_WriteWord((uint32_t *)_flash_page_addr, _flash_cache, FLASH_PAGE_SIZE);
taskEXIT_CRITICAL(); taskEXIT_CRITICAL();
if (mscReturnOk != ret) { if (mscReturnOk != ret) {
reset_into_safe_mode(SAFE_MODE_FLASH_WRITE_FAIL); reset_into_safe_mode(SAFE_MODE_FLASH_WRITE_FAIL);

View File

@ -122,11 +122,11 @@ mp_obj_t common_hal_alarm_light_sleep_until_alarms(size_t n_alarms, const mp_obj
stm_sleep_source_t cause = alarm_get_wakeup_cause(); stm_sleep_source_t cause = alarm_get_wakeup_cause();
switch (cause) { switch (cause) {
case STM_WAKEUP_RTC: { case STM_WAKEUP_RTC: {
wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_time_timealarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
case STM_WAKEUP_GPIO: { case STM_WAKEUP_GPIO: {
wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms,alarms); wake_alarm = alarm_pin_pinalarm_find_triggered_alarm(n_alarms, alarms);
break; break;
} }
default: default:

View File

@ -147,7 +147,7 @@ void alarm_pin_pinalarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_ob
if (!stm_peripherals_exti_reserve(alarm->pin->number)) { if (!stm_peripherals_exti_reserve(alarm->pin->number)) {
mp_raise_RuntimeError(translate("Pin interrupt already in use")); mp_raise_RuntimeError(translate("Pin interrupt already in use"));
} }
stm_peripherals_exti_set_callback(pin_alarm_callback,alarm->pin->number); stm_peripherals_exti_set_callback(pin_alarm_callback, alarm->pin->number);
stm_peripherals_exti_enable(alarm->pin->number); stm_peripherals_exti_enable(alarm->pin->number);
reserved_alarms[alarm->pin->number] = true; reserved_alarms[alarm->pin->number] = true;
} }

View File

@ -108,15 +108,15 @@ void alarm_time_timealarm_set_alarms(bool deep_sleep, size_t n_alarms, const mp_
// Use alarm B, since port reserves A // Use alarm B, since port reserves A
// If true deep sleep is called, it will either ignore or overwrite this depending on // If true deep sleep is called, it will either ignore or overwrite this depending on
// whether it is shorter or longer than the USB delay // whether it is shorter or longer than the USB delay
stm32_peripherals_rtc_assign_alarm_callback(PERIPHERALS_ALARM_B,timer_callback); stm32_peripherals_rtc_assign_alarm_callback(PERIPHERALS_ALARM_B, timer_callback);
stm32_peripherals_rtc_set_alarm(PERIPHERALS_ALARM_B,wakeup_in_ticks); stm32_peripherals_rtc_set_alarm(PERIPHERALS_ALARM_B, wakeup_in_ticks);
} }
void alarm_time_timealarm_prepare_for_deep_sleep(void) { void alarm_time_timealarm_prepare_for_deep_sleep(void) {
if (deep_sleep_ticks) { if (deep_sleep_ticks) {
// This is used for both fake and real deep sleep, so it still needs the callback // This is used for both fake and real deep sleep, so it still needs the callback
stm32_peripherals_rtc_assign_alarm_callback(PERIPHERALS_ALARM_B,timer_callback); stm32_peripherals_rtc_assign_alarm_callback(PERIPHERALS_ALARM_B, timer_callback);
stm32_peripherals_rtc_set_alarm(PERIPHERALS_ALARM_B,deep_sleep_ticks); stm32_peripherals_rtc_set_alarm(PERIPHERALS_ALARM_B, deep_sleep_ticks);
deep_sleep_ticks = 0; deep_sleep_ticks = 0;
} }
} }

View File

@ -79,7 +79,7 @@ void common_hal_analogio_analogin_deinit(analogio_analogin_obj_t *self) {
if (common_hal_analogio_analogin_deinited(self)) { if (common_hal_analogio_analogin_deinited(self)) {
return; return;
} }
reset_pin_number(self->pin->port,self->pin->number); reset_pin_number(self->pin->port, self->pin->number);
self->pin = NULL; self->pin = NULL;
} }
@ -200,7 +200,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
if (HAL_ADC_Start(&AdcHandle) != HAL_OK) { if (HAL_ADC_Start(&AdcHandle) != HAL_OK) {
return 0; return 0;
} }
HAL_ADC_PollForConversion(&AdcHandle,1); HAL_ADC_PollForConversion(&AdcHandle, 1);
uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle); uint16_t value = (uint16_t)HAL_ADC_GetValue(&AdcHandle);
HAL_ADC_Stop(&AdcHandle); HAL_ADC_Stop(&AdcHandle);

View File

@ -105,7 +105,7 @@ bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) {
void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) {
#if HAS_DAC #if HAS_DAC
reset_pin_number(self->pin->port,self->pin->number); reset_pin_number(self->pin->port, self->pin->number);
self->pin = NULL; self->pin = NULL;
dac_on[self->dac_index] = false; dac_on[self->dac_index] = false;

View File

@ -208,8 +208,8 @@ void common_hal_busio_i2c_deinit(busio_i2c_obj_t *self) {
reserved_i2c[self->sda->periph_index - 1] = false; reserved_i2c[self->sda->periph_index - 1] = false;
never_reset_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->sda->pin->port, self->sda->pin->number);
reset_pin_number(self->scl->pin->port,self->scl->pin->number); reset_pin_number(self->scl->pin->port, self->scl->pin->number);
self->sda = NULL; self->sda = NULL;
self->scl = NULL; self->scl = NULL;
} }

View File

@ -73,14 +73,14 @@ STATIC uint32_t get_busclock(SPI_TypeDef *instance) {
STATIC uint32_t stm32_baud_to_spi_div(uint32_t baudrate, uint16_t *prescaler, uint32_t busclock) { 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] = { static const uint32_t baud_map[8][2] = {
{2,SPI_BAUDRATEPRESCALER_2}, {2, SPI_BAUDRATEPRESCALER_2},
{4,SPI_BAUDRATEPRESCALER_4}, {4, SPI_BAUDRATEPRESCALER_4},
{8,SPI_BAUDRATEPRESCALER_8}, {8, SPI_BAUDRATEPRESCALER_8},
{16,SPI_BAUDRATEPRESCALER_16}, {16, SPI_BAUDRATEPRESCALER_16},
{32,SPI_BAUDRATEPRESCALER_32}, {32, SPI_BAUDRATEPRESCALER_32},
{64,SPI_BAUDRATEPRESCALER_64}, {64, SPI_BAUDRATEPRESCALER_64},
{128,SPI_BAUDRATEPRESCALER_128}, {128, SPI_BAUDRATEPRESCALER_128},
{256,SPI_BAUDRATEPRESCALER_256} {256, SPI_BAUDRATEPRESCALER_256}
}; };
size_t i = 0; size_t i = 0;
uint16_t divisor; uint16_t divisor;
@ -267,12 +267,12 @@ void common_hal_busio_spi_deinit(busio_spi_obj_t *self) {
reserved_spi[self->sck->periph_index - 1] = false; reserved_spi[self->sck->periph_index - 1] = false;
never_reset_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); reset_pin_number(self->sck->pin->port, self->sck->pin->number);
if (self->mosi != NULL) { if (self->mosi != NULL) {
reset_pin_number(self->mosi->pin->port,self->mosi->pin->number); reset_pin_number(self->mosi->pin->port, self->mosi->pin->number);
} }
if (self->miso != NULL) { if (self->miso != NULL) {
reset_pin_number(self->miso->pin->port,self->miso->pin->number); reset_pin_number(self->miso->pin->port, self->miso->pin->number);
} }
self->sck = NULL; self->sck = NULL;
self->mosi = NULL; self->mosi = NULL;
@ -379,7 +379,7 @@ bool common_hal_busio_spi_transfer(busio_spi_obj_t *self,
mp_raise_ValueError_varg(translate("No %q pin"), MP_QSTR_miso); mp_raise_ValueError_varg(translate("No %q pin"), MP_QSTR_miso);
} }
HAL_StatusTypeDef result = HAL_SPI_TransmitReceive(&self->handle, HAL_StatusTypeDef result = HAL_SPI_TransmitReceive(&self->handle,
(uint8_t *)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; return result == HAL_OK;
} }

View File

@ -274,11 +274,11 @@ void common_hal_busio_uart_deinit(busio_uart_obj_t *self) {
} }
if (self->tx) { if (self->tx) {
reset_pin_number(self->tx->pin->port,self->tx->pin->number); reset_pin_number(self->tx->pin->port, self->tx->pin->number);
self->tx = NULL; self->tx = NULL;
} }
if (self->rx) { if (self->rx) {
reset_pin_number(self->rx->pin->port,self->rx->pin->number); reset_pin_number(self->rx->pin->port, self->rx->pin->number);
self->rx = NULL; self->rx = NULL;
} }

View File

@ -86,7 +86,7 @@ float common_hal_mcu_processor_get_temperature(void) {
HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); HAL_ADC_ConfigChannel(&AdcHandle, &sConfig);
HAL_ADC_Start(&AdcHandle); HAL_ADC_Start(&AdcHandle);
if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { if (HAL_ADC_PollForConversion(&AdcHandle, 1) != HAL_OK) {
mp_raise_RuntimeError(translate("Temperature read timed out")); mp_raise_RuntimeError(translate("Temperature read timed out"));
} }
uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle);
@ -118,7 +118,7 @@ float common_hal_mcu_processor_get_voltage(void) {
HAL_ADC_ConfigChannel(&AdcHandle, &sConfig); HAL_ADC_ConfigChannel(&AdcHandle, &sConfig);
HAL_ADC_Start(&AdcHandle); HAL_ADC_Start(&AdcHandle);
if (HAL_ADC_PollForConversion(&AdcHandle,1) != HAL_OK) { if (HAL_ADC_PollForConversion(&AdcHandle, 1) != HAL_OK) {
mp_raise_RuntimeError(translate("Voltage read timed out")); mp_raise_RuntimeError(translate("Voltage read timed out"));
} }
uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle); uint32_t value = (uint32_t)HAL_ADC_GetValue(&AdcHandle);

View File

@ -79,7 +79,7 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) {
uint32_t new_random; uint32_t new_random;
uint32_t start = HAL_GetTick(); uint32_t start = HAL_GetTick();
// the HAL function has a timeout, but it isn't long enough, and isn't adjustable // 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)) { while (!(__HAL_RNG_GET_FLAG(&handle, RNG_FLAG_DRDY)) && ((HAL_GetTick() - start) < RNG_TIMEOUT)) {
; ;
} }
if (HAL_RNG_GenerateRandomNumber(&handle, &new_random) != HAL_OK) { if (HAL_RNG_GenerateRandomNumber(&handle, &new_random) != HAL_OK) {

View File

@ -269,13 +269,13 @@ bool common_hal_sdioio_sdcard_deinited(sdioio_sdcard_obj_t *self) {
STATIC void never_reset_mcu_periph(const mcu_periph_obj_t *periph) { STATIC void never_reset_mcu_periph(const mcu_periph_obj_t *periph) {
if (periph) { if (periph) {
never_reset_pin_number(periph->pin->port,periph->pin->number); never_reset_pin_number(periph->pin->port, periph->pin->number);
} }
} }
STATIC void reset_mcu_periph(const mcu_periph_obj_t *periph) { STATIC void reset_mcu_periph(const mcu_periph_obj_t *periph) {
if (periph) { if (periph) {
reset_pin_number(periph->pin->port,periph->pin->number); reset_pin_number(periph->pin->port, periph->pin->number);
} }
} }

View File

@ -37,8 +37,8 @@ void stm32_peripherals_gpio_init(void) {
__HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE();
// Never reset pins // Never reset pins
never_reset_pin_number(2,14); // PC14 OSC32_IN never_reset_pin_number(2, 14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT never_reset_pin_number(2, 15); // PC15 OSC32_OUT
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
} }

View File

@ -38,25 +38,25 @@ 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_PB02 = PIN(1, 2, NO_ADC);
const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC); const mcu_pin_obj_t pin_PE07 = PIN(4, 7, NO_ADC);

View File

@ -38,11 +38,11 @@ void stm32_peripherals_gpio_init(void) {
__HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();
// Never reset pins // Never reset pins
never_reset_pin_number(2,13); // PC13 anti tamp never_reset_pin_number(2, 13); // PC13 anti tamp
never_reset_pin_number(2,14); // PC14 OSC32_IN never_reset_pin_number(2, 14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT never_reset_pin_number(2, 15); // PC15 OSC32_OUT
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
// never_reset_pin_number(0,15); //PA15 JTDI // never_reset_pin_number(0,15); //PA15 JTDI
// never_reset_pin_number(1,3); //PB3 JTDO // never_reset_pin_number(1,3); //PB3 JTDO
// never_reset_pin_number(1,4); //PB4 JTRST // never_reset_pin_number(1,4); //PB4 JTRST

View File

@ -28,14 +28,14 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "peripherals/pins.h" #include "peripherals/pins.h"
const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); 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_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_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_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_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_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_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_PA07 = PIN(0, 7, ADC_INPUT(ADC_12, 7));
const mcu_pin_obj_t pin_PA08 = PIN(0, 8, 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_PA09 = PIN(0, 9, NO_ADC);
const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC);
@ -44,8 +44,8 @@ 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_PA13 = PIN(0, 13, NO_ADC);
const mcu_pin_obj_t pin_PA14 = PIN(0, 14, 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_PA15 = PIN(0, 15, NO_ADC);
const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_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_PB01 = PIN(1, 1, ADC_INPUT(ADC_12, 9));
const mcu_pin_obj_t pin_PB02 = PIN(1, 2, 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_PB03 = PIN(1, 3, NO_ADC);
const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC);
@ -60,12 +60,12 @@ 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_PB13 = PIN(1, 13, NO_ADC);
const mcu_pin_obj_t pin_PB14 = PIN(1, 14, 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_PB15 = PIN(1, 15, NO_ADC);
const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_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_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_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_PC03 = PIN(2, 3, ADC_INPUT(ADC_123, 13));
const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); const mcu_pin_obj_t pin_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_PC05 = PIN(2, 5, ADC_INPUT(ADC_12, 15));
const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC);
const mcu_pin_obj_t pin_PC07 = PIN(2, 7, 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_PC08 = PIN(2, 8, NO_ADC);
@ -111,14 +111,14 @@ 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_PF00 = PIN(5, 0, NO_ADC);
const mcu_pin_obj_t pin_PF01 = PIN(5, 1, 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_PF02 = PIN(5, 2, NO_ADC);
const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3, 9));
const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3, 14));
const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3, 15));
const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3, 4));
const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3, 5));
const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3, 6));
const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3, 7));
const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3, 8));
const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC);
const mcu_pin_obj_t pin_PF12 = PIN(5, 12, 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_PF13 = PIN(5, 13, NO_ADC);

View File

@ -38,11 +38,11 @@ void stm32_peripherals_gpio_init(void) {
__HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();
// Never reset pins // Never reset pins
never_reset_pin_number(2,13); // PC13 anti tamp never_reset_pin_number(2, 13); // PC13 anti tamp
never_reset_pin_number(2,14); // PC14 OSC32_IN never_reset_pin_number(2, 14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT never_reset_pin_number(2, 15); // PC15 OSC32_OUT
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
// never_reset_pin_number(0,15); //PA15 JTDI // never_reset_pin_number(0,15); //PA15 JTDI
// never_reset_pin_number(1,3); //PB3 JTDO // never_reset_pin_number(1,3); //PB3 JTDO
// never_reset_pin_number(1,4); //PB4 JTRST // never_reset_pin_number(1,4); //PB4 JTRST

View File

@ -28,14 +28,14 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "peripherals/pins.h" #include "peripherals/pins.h"
const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_123,0)); 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_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_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_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_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_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_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_PA07 = PIN(0, 7, ADC_INPUT(ADC_12, 7));
const mcu_pin_obj_t pin_PA08 = PIN(0, 8, 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_PA09 = PIN(0, 9, NO_ADC);
const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC);
@ -44,8 +44,8 @@ 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_PA13 = PIN(0, 13, NO_ADC);
const mcu_pin_obj_t pin_PA14 = PIN(0, 14, 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_PA15 = PIN(0, 15, NO_ADC);
const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_12,8)); const mcu_pin_obj_t pin_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_PB01 = PIN(1, 1, ADC_INPUT(ADC_12, 9));
const mcu_pin_obj_t pin_PB02 = PIN(1, 2, 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_PB03 = PIN(1, 3, NO_ADC);
const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC); const mcu_pin_obj_t pin_PB04 = PIN(1, 4, NO_ADC);
@ -60,12 +60,12 @@ 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_PB13 = PIN(1, 13, NO_ADC);
const mcu_pin_obj_t pin_PB14 = PIN(1, 14, 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_PB15 = PIN(1, 15, NO_ADC);
const mcu_pin_obj_t pin_PC00 = PIN(2, 0, ADC_INPUT(ADC_123,10)); const mcu_pin_obj_t pin_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_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_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_PC03 = PIN(2, 3, ADC_INPUT(ADC_123, 13));
const mcu_pin_obj_t pin_PC04 = PIN(2, 4, ADC_INPUT(ADC_12,14)); const mcu_pin_obj_t pin_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_PC05 = PIN(2, 5, ADC_INPUT(ADC_12, 15));
const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC); const mcu_pin_obj_t pin_PC06 = PIN(2, 6, NO_ADC);
const mcu_pin_obj_t pin_PC07 = PIN(2, 7, 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_PC08 = PIN(2, 8, NO_ADC);
@ -111,14 +111,14 @@ 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_PF00 = PIN(5, 0, NO_ADC);
const mcu_pin_obj_t pin_PF01 = PIN(5, 1, 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_PF02 = PIN(5, 2, NO_ADC);
const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3,9)); const mcu_pin_obj_t pin_PF03 = PIN(5, 3, ADC_INPUT(ADC_3, 9));
const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3,14)); const mcu_pin_obj_t pin_PF04 = PIN(5, 4, ADC_INPUT(ADC_3, 14));
const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3,15)); const mcu_pin_obj_t pin_PF05 = PIN(5, 5, ADC_INPUT(ADC_3, 15));
const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3,4)); const mcu_pin_obj_t pin_PF06 = PIN(5, 6, ADC_INPUT(ADC_3, 4));
const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3,5)); const mcu_pin_obj_t pin_PF07 = PIN(5, 7, ADC_INPUT(ADC_3, 5));
const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3,6)); const mcu_pin_obj_t pin_PF08 = PIN(5, 8, ADC_INPUT(ADC_3, 6));
const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3,7)); const mcu_pin_obj_t pin_PF09 = PIN(5, 9, ADC_INPUT(ADC_3, 7));
const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3,8)); const mcu_pin_obj_t pin_PF10 = PIN(5, 10, ADC_INPUT(ADC_3, 8));
const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC); const mcu_pin_obj_t pin_PF11 = PIN(5, 11, NO_ADC);
const mcu_pin_obj_t pin_PF12 = PIN(5, 12, 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_PF13 = PIN(5, 13, NO_ADC);

View File

@ -40,12 +40,12 @@ void stm32_peripherals_gpio_init(void) {
// Never reset pins // Never reset pins
// TODO: Move this out of peripherals. These helpers shouldn't reference anything CircuitPython // TODO: Move this out of peripherals. These helpers shouldn't reference anything CircuitPython
// specific. // specific.
never_reset_pin_number(2,14); // PC14 OSC32_IN never_reset_pin_number(2, 14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT never_reset_pin_number(2, 15); // PC15 OSC32_OUT
#if !(BOARD_OVERWRITE_SWD) #if !(BOARD_OVERWRITE_SWD)
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
#endif #endif
// Port H is not included in GPIO port array // Port H is not included in GPIO port array

View File

@ -148,47 +148,47 @@ TIM_TypeDef *mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, NULL
TIM11, NULL, NULL, NULL}; TIM11, NULL, NULL, NULL};
const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = { const mcu_tim_pin_obj_t mcu_tim_pin_list[44] = {
TIM(2,1,1,&pin_PA00), TIM(2, 1, 1, &pin_PA00),
TIM(5,2,1,&pin_PA00), TIM(5, 2, 1, &pin_PA00),
TIM(2,1,2,&pin_PA01), TIM(2, 1, 2, &pin_PA01),
TIM(5,2,2,&pin_PA01), TIM(5, 2, 2, &pin_PA01),
TIM(2,1,3,&pin_PA02), TIM(2, 1, 3, &pin_PA02),
TIM(5,2,3,&pin_PA02), TIM(5, 2, 3, &pin_PA02),
TIM(2,1,4,&pin_PA03), TIM(2, 1, 4, &pin_PA03),
TIM(5,2,4,&pin_PA03), TIM(5, 2, 4, &pin_PA03),
TIM(9,3,1,&pin_PA02), TIM(9, 3, 1, &pin_PA02),
TIM(9,3,2,&pin_PA03), TIM(9, 3, 2, &pin_PA03),
TIM(3,2,1,&pin_PA06), TIM(3, 2, 1, &pin_PA06),
TIM(3,2,2,&pin_PA07), TIM(3, 2, 2, &pin_PA07),
TIM(1,1,1,&pin_PA08), TIM(1, 1, 1, &pin_PA08),
TIM(1,1,2,&pin_PA09), TIM(1, 1, 2, &pin_PA09),
TIM(1,1,3,&pin_PA10), TIM(1, 1, 3, &pin_PA10),
TIM(1,1,4,&pin_PA11), TIM(1, 1, 4, &pin_PA11),
TIM(2,1,1,&pin_PA15), TIM(2, 1, 1, &pin_PA15),
TIM(3,2,3,&pin_PB00), TIM(3, 2, 3, &pin_PB00),
TIM(3,2,4,&pin_PB01), TIM(3, 2, 4, &pin_PB01),
TIM(2,1,2,&pin_PB03), TIM(2, 1, 2, &pin_PB03),
TIM(3,2,1,&pin_PB04), TIM(3, 2, 1, &pin_PB04),
TIM(3,2,2,&pin_PB05), TIM(3, 2, 2, &pin_PB05),
TIM(4,2,1,&pin_PB06), TIM(4, 2, 1, &pin_PB06),
TIM(4,2,2,&pin_PB07), TIM(4, 2, 2, &pin_PB07),
TIM(4,2,3,&pin_PB08), TIM(4, 2, 3, &pin_PB08),
TIM(10,2,1,&pin_PB08), TIM(10, 2, 1, &pin_PB08),
TIM(4,2,4,&pin_PB09), TIM(4, 2, 4, &pin_PB09),
TIM(11,2,1,&pin_PB09), TIM(11, 2, 1, &pin_PB09),
TIM(2,1,3,&pin_PB10), TIM(2, 1, 3, &pin_PB10),
TIM(3,2,1,&pin_PC06), TIM(3, 2, 1, &pin_PC06),
TIM(3,2,2,&pin_PC07), TIM(3, 2, 2, &pin_PC07),
TIM(3,2,3,&pin_PC08), TIM(3, 2, 3, &pin_PC08),
TIM(3,2,4,&pin_PC09), TIM(3, 2, 4, &pin_PC09),
TIM(4,2,1,&pin_PD12), TIM(4, 2, 1, &pin_PD12),
TIM(4,2,2,&pin_PD13), TIM(4, 2, 2, &pin_PD13),
TIM(4,2,3,&pin_PD14), TIM(4, 2, 3, &pin_PD14),
TIM(4,2,4,&pin_PD15), TIM(4, 2, 4, &pin_PD15),
TIM(9,3,1,&pin_PE05), TIM(9, 3, 1, &pin_PE05),
TIM(9,3,2,&pin_PE06), TIM(9, 3, 2, &pin_PE06),
TIM(1,1,1,&pin_PE09), TIM(1, 1, 1, &pin_PE09),
TIM(1,1,2,&pin_PE11), TIM(1, 1, 2, &pin_PE11),
TIM(1,1,3,&pin_PE13), TIM(1, 1, 3, &pin_PE13),
TIM(1,1,4,&pin_PE14), TIM(1, 1, 4, &pin_PE14),
}; };

View File

@ -34,6 +34,6 @@ void stm32_peripherals_gpio_init(void) {
__HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE();
// Never reset pins // Never reset pins
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
} }

View File

@ -28,14 +28,14 @@
#include "py/mphal.h" #include "py/mphal.h"
#include "peripherals/pins.h" #include "peripherals/pins.h"
const mcu_pin_obj_t pin_PA00 = PIN(0, 0, ADC_INPUT(ADC_1,0)); 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_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_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_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_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_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_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_PA07 = PIN(0, 7, ADC_INPUT(ADC_1, 7));
const mcu_pin_obj_t pin_PA08 = PIN(0, 8, 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_PA09 = PIN(0, 9, NO_ADC);
const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC); const mcu_pin_obj_t pin_PA10 = PIN(0, 10, NO_ADC);
@ -45,8 +45,8 @@ 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_PA14 = PIN(0, 14, NO_ADC);
const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC); const mcu_pin_obj_t pin_PA15 = PIN(0, 15, NO_ADC);
const mcu_pin_obj_t pin_PB00 = PIN(1, 0, ADC_INPUT(ADC_1,8)); 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_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_PB02 = PIN(1, 2, NO_ADC);
const mcu_pin_obj_t pin_PB03 = PIN(1, 3, 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_PB04 = PIN(1, 4, NO_ADC);

View File

@ -39,11 +39,11 @@ void stm32_peripherals_gpio_init(void) {
__HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE();
// Never reset pins // Never reset pins
never_reset_pin_number(2,13); // PC13 anti tamp never_reset_pin_number(2, 13); // PC13 anti tamp
never_reset_pin_number(2,14); // PC14 OSC32_IN never_reset_pin_number(2, 14); // PC14 OSC32_IN
never_reset_pin_number(2,15); // PC15 OSC32_OUT never_reset_pin_number(2, 15); // PC15 OSC32_OUT
never_reset_pin_number(0,13); // PA13 SWDIO never_reset_pin_number(0, 13); // PA13 SWDIO
never_reset_pin_number(0,14); // PA14 SWCLK never_reset_pin_number(0, 14); // PA14 SWCLK
// never_reset_pin_number(0,15); //PA15 JTDI // never_reset_pin_number(0,15); //PA15 JTDI
// never_reset_pin_number(1,3); //PB3 JTDO // never_reset_pin_number(1,3); //PB3 JTDO
// never_reset_pin_number(1,4); //PB4 JTRST // never_reset_pin_number(1,4); //PB4 JTRST

View File

@ -160,64 +160,64 @@ TIM_TypeDef *mcu_tim_banks[14] = {TIM1, TIM2, TIM3, TIM4, TIM5, NULL, NULL, TIM8
TIM11, TIM12, TIM13, TIM14}; TIM11, TIM12, TIM13, TIM14};
const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = { const mcu_tim_pin_obj_t mcu_tim_pin_list[60] = {
TIM(2,1,1,&pin_PA00), TIM(2, 1, 1, &pin_PA00),
TIM(5,2,1,&pin_PA00), TIM(5, 2, 1, &pin_PA00),
TIM(2,1,2,&pin_PA01), TIM(2, 1, 2, &pin_PA01),
TIM(5,2,2,&pin_PA01), TIM(5, 2, 2, &pin_PA01),
TIM(2,1,3,&pin_PA02), TIM(2, 1, 3, &pin_PA02),
TIM(5,2,3,&pin_PA02), TIM(5, 2, 3, &pin_PA02),
TIM(2,1,4,&pin_PA03), TIM(2, 1, 4, &pin_PA03),
TIM(5,2,4,&pin_PA03), TIM(5, 2, 4, &pin_PA03),
TIM(9,3,1,&pin_PA02), TIM(9, 3, 1, &pin_PA02),
TIM(9,3,2,&pin_PA03), TIM(9, 3, 2, &pin_PA03),
TIM(3,2,1,&pin_PA06), TIM(3, 2, 1, &pin_PA06),
TIM(13,9,1,&pin_PA06), TIM(13, 9, 1, &pin_PA06),
TIM(3,2,2,&pin_PA07), TIM(3, 2, 2, &pin_PA07),
TIM(14,9,1,&pin_PA07), TIM(14, 9, 1, &pin_PA07),
TIM(1,1,1,&pin_PA08), TIM(1, 1, 1, &pin_PA08),
TIM(1,1,2,&pin_PA09), TIM(1, 1, 2, &pin_PA09),
TIM(1,1,3,&pin_PA10), TIM(1, 1, 3, &pin_PA10),
TIM(1,1,4,&pin_PA11), TIM(1, 1, 4, &pin_PA11),
TIM(2,1,1,&pin_PA15), TIM(2, 1, 1, &pin_PA15),
TIM(3,2,3,&pin_PB00), TIM(3, 2, 3, &pin_PB00),
TIM(3,2,4,&pin_PB01), TIM(3, 2, 4, &pin_PB01),
TIM(2,1,2,&pin_PB03), TIM(2, 1, 2, &pin_PB03),
TIM(3,2,1,&pin_PB04), TIM(3, 2, 1, &pin_PB04),
TIM(3,2,2,&pin_PB05), TIM(3, 2, 2, &pin_PB05),
TIM(4,2,1,&pin_PB06), TIM(4, 2, 1, &pin_PB06),
TIM(4,2,2,&pin_PB07), TIM(4, 2, 2, &pin_PB07),
TIM(4,2,3,&pin_PB08), TIM(4, 2, 3, &pin_PB08),
TIM(10,2,1,&pin_PB08), TIM(10, 2, 1, &pin_PB08),
TIM(4,2,4,&pin_PB09), TIM(4, 2, 4, &pin_PB09),
TIM(11,2,1,&pin_PB09), TIM(11, 2, 1, &pin_PB09),
TIM(2,1,3,&pin_PB10), TIM(2, 1, 3, &pin_PB10),
TIM(2,1,4,&pin_PB11), TIM(2, 1, 4, &pin_PB11),
TIM(12,9,1,&pin_PB14), TIM(12, 9, 1, &pin_PB14),
TIM(12,9,2,&pin_PB15), TIM(12, 9, 2, &pin_PB15),
TIM(3,2,1,&pin_PC06), TIM(3, 2, 1, &pin_PC06),
TIM(3,2,2,&pin_PC07), TIM(3, 2, 2, &pin_PC07),
TIM(3,2,3,&pin_PC08), TIM(3, 2, 3, &pin_PC08),
TIM(3,2,4,&pin_PC09), TIM(3, 2, 4, &pin_PC09),
TIM(8,3,1,&pin_PC06), TIM(8, 3, 1, &pin_PC06),
TIM(8,3,2,&pin_PC07), TIM(8, 3, 2, &pin_PC07),
TIM(8,3,3,&pin_PC08), TIM(8, 3, 3, &pin_PC08),
TIM(8,3,4,&pin_PC09), TIM(8, 3, 4, &pin_PC09),
TIM(4,2,1,&pin_PD12), TIM(4, 2, 1, &pin_PD12),
TIM(4,2,2,&pin_PD13), TIM(4, 2, 2, &pin_PD13),
TIM(4,2,3,&pin_PD14), TIM(4, 2, 3, &pin_PD14),
TIM(4,2,4,&pin_PD15), TIM(4, 2, 4, &pin_PD15),
TIM(9,3,1,&pin_PE05), TIM(9, 3, 1, &pin_PE05),
TIM(9,3,2,&pin_PE06), TIM(9, 3, 2, &pin_PE06),
TIM(1,1,1,&pin_PE09), TIM(1, 1, 1, &pin_PE09),
TIM(1,1,2,&pin_PE11), TIM(1, 1, 2, &pin_PE11),
TIM(1,1,3,&pin_PE13), TIM(1, 1, 3, &pin_PE13),
TIM(1,1,4,&pin_PE14), TIM(1, 1, 4, &pin_PE14),
TIM(10,3,1,&pin_PF06), TIM(10, 3, 1, &pin_PF06),
TIM(11,3,1,&pin_PF07), TIM(11, 3, 1, &pin_PF07),
TIM(13,9,1,&pin_PF08), TIM(13, 9, 1, &pin_PF08),
TIM(14,9,1,&pin_PF09), TIM(14, 9, 1, &pin_PF09),
TIM(5,2,1,&pin_PF03), TIM(5, 2, 1, &pin_PF03),
TIM(5,2,2,&pin_PF04), TIM(5, 2, 2, &pin_PF04),
TIM(5,2,3,&pin_PF05), TIM(5, 2, 3, &pin_PF05),
TIM(5,2,4,&pin_PF10), TIM(5, 2, 4, &pin_PF10),
}; };

View File

@ -50,25 +50,25 @@ 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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_PF11 = PIN(5, 11, NO_ADC); // 144 only

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