From 547ca5a452f64fec654005ec669bb5c5184bd8a2 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Feb 2023 12:02:06 -0600 Subject: [PATCH 01/30] bitmap constructor positive validation --- shared-bindings/displayio/Bitmap.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 65551f4e0d..f507a64880 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -62,14 +62,11 @@ //| ... STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { mp_arg_check_num(n_args, n_kw, 3, 3, false); - uint32_t width = mp_obj_get_int(all_args[0]); - uint32_t height = mp_obj_get_int(all_args[1]); - uint32_t value_count = mp_obj_get_int(all_args[2]); + uint32_t width = mp_arg_validate_int_min(mp_obj_get_int(all_args[0]), 1, MP_QSTR_width); + uint32_t height = mp_arg_validate_int_min(mp_obj_get_int(all_args[1]), 1, MP_QSTR_height); + uint32_t value_count = mp_arg_validate_int_min(mp_obj_get_int(all_args[2]), 1, MP_QSTR_value_count); uint32_t bits = 1; - if (value_count == 0) { - mp_raise_ValueError(translate("value_count must be > 0")); - } while ((value_count - 1) >> bits) { if (bits < 8) { bits <<= 1; From beb4a797ff136d695d611c8b1665b433cd438331 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 4 Feb 2023 12:37:43 -0600 Subject: [PATCH 02/30] bitmap fill, __get_item__, and __set_item__ positive validation --- shared-bindings/displayio/Bitmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index f507a64880..a6bccc6298 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -141,15 +141,15 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val uint16_t x = 0; uint16_t y = 0; if (mp_obj_is_small_int(index_obj)) { - mp_int_t i = MP_OBJ_SMALL_INT_VALUE(index_obj); + mp_int_t i = mp_arg_validate_int_min(MP_OBJ_SMALL_INT_VALUE(index_obj), 0, MP_QSTR_index); uint16_t width = common_hal_displayio_bitmap_get_width(self); x = i % width; y = i / width; } else { mp_obj_t *items; mp_obj_get_array_fixed_n(index_obj, 2, &items); - x = mp_obj_get_int(items[0]); - y = mp_obj_get_int(items[1]); + x = mp_arg_validate_int_min(mp_obj_get_int(items[0]), 0, MP_QSTR_x); + y = mp_arg_validate_int_min(mp_obj_get_int(items[1]), 0, MP_QSTR_y); if (x >= common_hal_displayio_bitmap_get_width(self) || y >= common_hal_displayio_bitmap_get_height(self)) { mp_raise_IndexError(translate("pixel coordinates out of bounds")); } @@ -286,7 +286,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_min(mp_obj_get_int(value_obj), 0, MP_QSTR_value); if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { mp_raise_ValueError(translate("pixel value requires too many bits")); } From efe48e61ed8c3cef958dc9b5ad367cd454c9da19 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 6 Feb 2023 17:03:49 -0600 Subject: [PATCH 03/30] argument bounds validation for bitmap.blit() --- shared-bindings/displayio/Bitmap.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index a6bccc6298..458a73c3b1 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -212,8 +212,9 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg displayio_bitmap_t *self = MP_OBJ_TO_PTR(pos_args[0]); - int16_t x = args[ARG_x].u_int; - int16_t y = args[ARG_y].u_int; + // Check x,y are within self (target) bitmap boundary + int16_t x = mp_arg_validate_int_range(args[ARG_x].u_int, 0, self->width - 1, MP_QSTR_x); + int16_t y = mp_arg_validate_int_range(args[ARG_y].u_int, 0, self->height - 1, MP_QSTR_y); displayio_bitmap_t *source = mp_arg_validate_type(args[ARG_source].u_obj, &displayio_bitmap_type, MP_QSTR_source_bitmap); @@ -223,32 +224,21 @@ STATIC mp_obj_t displayio_bitmap_obj_blit(size_t n_args, const mp_obj_t *pos_arg mp_raise_ValueError(translate("source palette too large")); } - int16_t x1 = args[ARG_x1].u_int; - int16_t y1 = args[ARG_y1].u_int; + // Check x1,y1,x2,y2 are within source bitmap boundary + int16_t x1 = mp_arg_validate_int_range(args[ARG_x1].u_int, 0, source->width - 1, MP_QSTR_x1); + int16_t y1 = mp_arg_validate_int_range(args[ARG_y1].u_int, 0, source->height - 1, MP_QSTR_y1); int16_t x2, y2; // if x2 or y2 is None, then set as the maximum size of the source bitmap if (args[ARG_x2].u_obj == mp_const_none) { x2 = source->width; } else { - x2 = mp_obj_get_int(args[ARG_x2].u_obj); + x2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_x2].u_obj), 0, source->width, MP_QSTR_x2); } // int16_t y2; if (args[ARG_y2].u_obj == mp_const_none) { y2 = source->height; } else { - y2 = mp_obj_get_int(args[ARG_y2].u_obj); - } - - // Check x,y are within self (target) bitmap boundary - if ((x < 0) || (y < 0) || (x > self->width) || (y > self->height)) { - mp_raise_ValueError(translate("out of range of target")); - } - // Check x1,y1,x2,y2 are within source bitmap boundary - if ((x1 < 0) || (x1 > source->width) || - (y1 < 0) || (y1 > source->height) || - (x2 < 0) || (x2 > source->width) || - (y2 < 0) || (y2 > source->height)) { - mp_raise_ValueError(translate("out of range of source")); + y2 = mp_arg_validate_int_range(mp_obj_get_int(args[ARG_y2].u_obj), 0, source->height, MP_QSTR_y2); } // Ensure x1 < x2 and y1 < y2 From bb4cccc1cda1573889097ee0c596e27686a794bf Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 17:26:01 -0600 Subject: [PATCH 04/30] use range instead of min where applicable to consolodate bounds checks --- shared-bindings/displayio/Bitmap.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 458a73c3b1..0efa801a7d 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -148,21 +148,15 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val } else { mp_obj_t *items; mp_obj_get_array_fixed_n(index_obj, 2, &items); - x = mp_arg_validate_int_min(mp_obj_get_int(items[0]), 0, MP_QSTR_x); - y = mp_arg_validate_int_min(mp_obj_get_int(items[1]), 0, MP_QSTR_y); - if (x >= common_hal_displayio_bitmap_get_width(self) || y >= common_hal_displayio_bitmap_get_height(self)) { - mp_raise_IndexError(translate("pixel coordinates out of bounds")); - } + x = mp_arg_validate_int_range(mp_obj_get_int(items[0]), 0, self->width - 1, MP_QSTR_x); + y = mp_arg_validate_int_range(mp_obj_get_int(items[1]), 0, self->height - 1, MP_QSTR_y); } if (value_obj == MP_OBJ_SENTINEL) { // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_uint_t value = (mp_uint_t)mp_obj_get_int(value_obj); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1, MP_QSTR_value); common_hal_displayio_bitmap_set_pixel(self, x, y, value); } return mp_const_none; @@ -276,10 +270,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(displayio_bitmap_blit_obj, 1, displayio_bitmap_obj_bl STATIC mp_obj_t displayio_bitmap_obj_fill(mp_obj_t self_in, mp_obj_t value_obj) { displayio_bitmap_t *self = MP_OBJ_TO_PTR(self_in); - mp_uint_t value = (mp_uint_t)mp_arg_validate_int_min(mp_obj_get_int(value_obj), 0, MP_QSTR_value); - if ((value >> common_hal_displayio_bitmap_get_bits_per_value(self)) != 0) { - mp_raise_ValueError(translate("pixel value requires too many bits")); - } + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1,MP_QSTR_value); common_hal_displayio_bitmap_fill(self, value); return mp_const_none; From 67fd815e27581a1a758de68943cd64717e856021 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 17:39:38 -0600 Subject: [PATCH 05/30] maximum value validation for bitmap constructor --- shared-bindings/displayio/Bitmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 0efa801a7d..566bee954c 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -62,9 +62,9 @@ //| ... STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { mp_arg_check_num(n_args, n_kw, 3, 3, false); - uint32_t width = mp_arg_validate_int_min(mp_obj_get_int(all_args[0]), 1, MP_QSTR_width); - uint32_t height = mp_arg_validate_int_min(mp_obj_get_int(all_args[1]), 1, MP_QSTR_height); - uint32_t value_count = mp_arg_validate_int_min(mp_obj_get_int(all_args[2]), 1, MP_QSTR_value_count); + uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 1, 32767, MP_QSTR_width); + uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 1, 32767, MP_QSTR_height); + uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 32767, MP_QSTR_value_count); uint32_t bits = 1; while ((value_count - 1) >> bits) { From 5f3f87e371c7cc0d83817308375ab58e3d329210 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Fri, 10 Feb 2023 18:05:07 -0600 Subject: [PATCH 06/30] validate palette color count and group scale --- shared-bindings/displayio/Group.c | 2 +- shared-bindings/displayio/Palette.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/displayio/Group.c b/shared-bindings/displayio/Group.c index 3e4569b271..24064a74c1 100644 --- a/shared-bindings/displayio/Group.c +++ b/shared-bindings/displayio/Group.c @@ -56,7 +56,7 @@ STATIC mp_obj_t displayio_group_make_new(const mp_obj_type_t *type, size_t n_arg mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all_kw_array(n_args, n_kw, all_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - mp_int_t scale = mp_arg_validate_int_min(args[ARG_scale].u_int, 1, MP_QSTR_scale); + mp_int_t scale = mp_arg_validate_int_range(args[ARG_scale].u_int, 1, 32767,MP_QSTR_scale); displayio_group_t *self = m_new_obj(displayio_group_t); self->base.type = &displayio_group_type; diff --git a/shared-bindings/displayio/Palette.c b/shared-bindings/displayio/Palette.c index aa24dc262f..804b9ff034 100644 --- a/shared-bindings/displayio/Palette.c +++ b/shared-bindings/displayio/Palette.c @@ -58,7 +58,7 @@ STATIC mp_obj_t displayio_palette_make_new(const mp_obj_type_t *type, size_t n_a displayio_palette_t *self = m_new_obj(displayio_palette_t); self->base.type = &displayio_palette_type; - common_hal_displayio_palette_construct(self, args[ARG_color_count].u_int); + common_hal_displayio_palette_construct(self, mp_arg_validate_int_range(args[ARG_color_count].u_int, 1, 32767, MP_QSTR_color_count)); return MP_OBJ_FROM_PTR(self); } From 694537acb323314a25a802e53c4c34be5c6ced73 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Sat, 18 Feb 2023 10:35:39 -0600 Subject: [PATCH 07/30] change validation maximum computation --- shared-bindings/displayio/Bitmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index 566bee954c..e14ac638e2 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -156,7 +156,9 @@ STATIC mp_obj_t bitmap_subscr(mp_obj_t self_in, mp_obj_t index_obj, mp_obj_t val // load return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_bitmap_get_pixel(self, x, y)); } else { - mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range(mp_obj_get_int(value_obj), 0,(1u << common_hal_displayio_bitmap_get_bits_per_value(self)) - 1, MP_QSTR_value); + mp_uint_t value = (mp_uint_t)mp_arg_validate_int_range( + mp_obj_get_int(value_obj), 0, + (UINT32_MAX >> (32 - common_hal_displayio_bitmap_get_bits_per_value(self))), MP_QSTR_value); common_hal_displayio_bitmap_set_pixel(self, x, y, value); } return mp_const_none; From 3601bb3062735e12e9666e0bd1c0f730ab831f33 Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 20 Feb 2023 20:37:42 -0600 Subject: [PATCH 08/30] change value_count max --- shared-bindings/displayio/Bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Bitmap.c b/shared-bindings/displayio/Bitmap.c index e14ac638e2..c2431699b2 100644 --- a/shared-bindings/displayio/Bitmap.c +++ b/shared-bindings/displayio/Bitmap.c @@ -64,7 +64,7 @@ STATIC mp_obj_t displayio_bitmap_make_new(const mp_obj_type_t *type, size_t n_ar mp_arg_check_num(n_args, n_kw, 3, 3, false); uint32_t width = mp_arg_validate_int_range(mp_obj_get_int(all_args[0]), 1, 32767, MP_QSTR_width); uint32_t height = mp_arg_validate_int_range(mp_obj_get_int(all_args[1]), 1, 32767, MP_QSTR_height); - uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 32767, MP_QSTR_value_count); + uint32_t value_count = mp_arg_validate_int_range(mp_obj_get_int(all_args[2]), 1, 65535, MP_QSTR_value_count); uint32_t bits = 1; while ((value_count - 1) >> bits) { From e2565e2305df87c12f115514d66634ba9bfdfd60 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 14:00:14 -0500 Subject: [PATCH 09/30] mimxrt10xx: Add PWMAudioOut .. via a peripheral known as the "MQS" (medium quality sound). It uses an ~192kHz PWM signal to generate audio. It sounds OK on a small speaker with no amplifier. There's a small pop when starting/stopping audio, as is typical. --- .../mimxrt10xx/common-hal/audiobusio/I2SOut.h | 4 +- .../common-hal/audiobusio/__init__.c | 1 + .../common-hal/audiopwmio/PWMAudioOut.c | 159 ++++++++++++++++++ .../common-hal/audiopwmio/PWMAudioOut.h | 43 +++++ .../common-hal/audiopwmio/__init__.c | 0 .../common-hal/audiopwmio/__init__.h | 0 ports/mimxrt10xx/mpconfigport.mk | 1 + .../mimxrt10xx/MIMXRT1011/periph.c | 18 +- .../mimxrt10xx/MIMXRT1011/periph.h | 3 + .../mimxrt10xx/MIMXRT1021/periph.c | 10 ++ .../mimxrt10xx/MIMXRT1021/periph.h | 3 + .../mimxrt10xx/MIMXRT1062/periph.c | 10 ++ .../mimxrt10xx/MIMXRT1062/periph.h | 3 + 13 files changed, 246 insertions(+), 9 deletions(-) create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/__init__.c create mode 100644 ports/mimxrt10xx/common-hal/audiopwmio/__init__.h diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h index c4194402be..2473eb4cab 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -26,15 +26,13 @@ #pragma once +#if CIRCUITPY_AUDIOBUSIO_I2SOUT #include "supervisor/background_callback.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/audiobusio/__init__.h" // Some boards don't implement I2SOut, so suppress any routines from here. -#if CIRCUITPY_AUDIOBUSIO_I2SOUT - -#include "sdk/drivers/sai/fsl_sai.h" typedef struct { mp_obj_base_t base; diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 515c39a268..f2de99f004 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -284,6 +284,7 @@ static void i2s_fill_buffer(i2s_t *self) { static void i2s_callback_fun(void *self_in) { i2s_t *self = self_in; + mp_printf(&mp_plat_print, "."); i2s_fill_buffer(self); } diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c new file mode 100644 index 0000000000..dd50c7950a --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c @@ -0,0 +1,159 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include + +#include "mpconfigport.h" + +#include "py/gc.h" +#include "py/mperrno.h" +#include "py/runtime.h" +#include "common-hal/audiobusio/__init__.h" +#include "common-hal/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/audiopwmio/PWMAudioOut.h" +#include "shared-bindings/microcontroller/Pin.h" +#include "supervisor/shared/translate/translate.h" +#include "supervisor/shared/tick.h" + +// Where required we use identifier names that are required by NXP's +// API, even though they do not conform to the naming standards that Adafruit +// strives to adhere to. https://www.adafruit.com/blacklivesmatter +#include "sdk/drivers/sai/fsl_sai.h" + +STATIC void config_periph_pin(const mcu_periph_obj_t *periph) { + if (!periph) { + return; + } + if (periph->pin->mux_reg) { + IOMUXC_SetPinMux( + periph->pin->mux_reg, periph->mux_mode, + periph->input_reg, periph->input_idx, + 0, + 1); + } + + IOMUXC_SetPinConfig(0, 0, 0, 0, + periph->pin->cfg_reg, + IOMUXC_SW_PAD_CTL_PAD_HYS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUS(0) + | IOMUXC_SW_PAD_CTL_PAD_PUE(0) + | IOMUXC_SW_PAD_CTL_PAD_PKE(1) + | IOMUXC_SW_PAD_CTL_PAD_ODE(0) + | IOMUXC_SW_PAD_CTL_PAD_SPEED(2) + | IOMUXC_SW_PAD_CTL_PAD_DSE(4) + | IOMUXC_SW_PAD_CTL_PAD_SRE(0)); +} + +static void config_mqs(void) { + CCM->CCGR0 = (CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK)) | CCM_CCGR0_CG2(3); /* Enable MQS hmclk. */ + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, false); /* Release reset MQS. */ + IOMUXC_MQSEnable(IOMUXC_GPR, true); /* Enable MQS. */ + IOMUXC_MQSConfig(IOMUXC_GPR, kIOMUXC_MqsPwmOverSampleRate64, 0u); /* 98.304MHz/64/(0+1) = 1.536MHz + Higher frequency PWM involves less low frequen cy harmonic.*/ + +} + +// Caller validates that pins are free. +void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *self, + const mcu_pin_obj_t *left_channel, const mcu_pin_obj_t *right_channel, uint16_t default_value) { + + int instance = -1; + const mcu_periph_obj_t *left_periph = find_pin_function(mcu_mqs_left_list, left_channel, &instance, MP_QSTR_left_channel); + const mcu_periph_obj_t *right_periph = find_pin_function(mcu_mqs_right_list, right_channel, &instance, MP_QSTR_right_channel); + + mp_printf(&mp_plat_print, "note: peripheral %d\n", instance); + sai_transceiver_t config; + SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, 1U << 0u); + config.frameSync.frameSyncEarly = false; + config.frameSync.frameSyncPolarity = kSAI_PolarityActiveHigh; + // config.syncMode = kSAI_ModeAsync; + config.fifo.fifoPacking = kSAI_FifoPackingDisabled; + // These identifier names are required by NXP's API, even though they do + // not conform to the naming standards that Adafruit strives to adhere to. + // https://www.adafruit.com/blacklivesmatter + // config.masterSlave = kSAI_Master; + port_i2s_initialize(&self->i2s, instance, &config); + + self->left_channel = left_channel; + self->right_channel = right_channel; + claim_pin(left_channel); + claim_pin(right_channel); + config_periph_pin(left_periph); + config_periph_pin(right_periph); + config_mqs(); +} + +bool common_hal_audiopwmio_pwmaudioout_deinited(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_deinited(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_deinit(audiopwmio_pwmaudioout_obj_t *self) { + if (common_hal_audiopwmio_pwmaudioout_deinited(self)) { + return; + } + + port_i2s_deinit(&self->i2s); + + common_hal_reset_pin(self->left_channel); + self->left_channel = NULL; + + common_hal_reset_pin(self->right_channel); + self->right_channel = NULL; + + IOMUXC_MQSEnterSoftwareReset(IOMUXC_GPR, true); /* Reset MQS. */ + CCM->CCGR0 = CCM->CCGR0 & (~CCM_CCGR0_CG2_MASK); /* Disable MQS hmclk. */ +} + +void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t *self, + mp_obj_t sample, bool loop) { + if (common_hal_audiopwmio_pwmaudioout_get_playing(self)) { + common_hal_audiopwmio_pwmaudioout_stop(self); + } + port_i2s_play(&self->i2s, sample, loop); +} + +void common_hal_audiopwmio_pwmaudioout_pause(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_pause(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_resume(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_resume(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_paused(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_paused(&self->i2s); +} + +void common_hal_audiopwmio_pwmaudioout_stop(audiopwmio_pwmaudioout_obj_t *self) { + port_i2s_stop(&self->i2s); +} + +bool common_hal_audiopwmio_pwmaudioout_get_playing(audiopwmio_pwmaudioout_obj_t *self) { + return port_i2s_get_playing(&self->i2s); +} diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h new file mode 100644 index 0000000000..27cebc649b --- /dev/null +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h @@ -0,0 +1,43 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Jeff Epler for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#pragma once + +#if CIRCUITPY_AUDIOBUSIO_I2SOUT +#include "supervisor/background_callback.h" +#include "common-hal/microcontroller/Pin.h" + +#include "common-hal/audiobusio/__init__.h" + +// Some boards don't implement I2SOut, so suppress any routines from here. + +typedef struct { + mp_obj_base_t base; + i2s_t i2s; + const mcu_pin_obj_t *left_channel, *right_channel; +} audiopwmio_pwmaudioout_obj_t; + +#endif diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h b/ports/mimxrt10xx/common-hal/audiopwmio/__init__.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ports/mimxrt10xx/mpconfigport.mk b/ports/mimxrt10xx/mpconfigport.mk index a952460259..f7ab3d8130 100644 --- a/ports/mimxrt10xx/mpconfigport.mk +++ b/ports/mimxrt10xx/mpconfigport.mk @@ -17,6 +17,7 @@ CIRCUITPY_AUDIOCORE = 1 CIRCUITPY_AUDIOIO = 0 CIRCUITPY_AUDIOMIXER = 1 CIRCUITPY_AUDIOMP3 = 1 +CIRCUITPY_AUDIOPWMIO = 1 CIRCUITPY_BUSDEVICE = 1 CIRCUITPY_COUNTIO = 0 CIRCUITPY_FREQUENCYIO = 0 diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c index fbbf65c8a5..b67f7b1179 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.c @@ -169,25 +169,31 @@ const mcu_pwm_obj_t mcu_pwm_list[20] = { const mcu_periph_obj_t mcu_sai_rx_bclk_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_08), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_00), }; const mcu_periph_obj_t mcu_sai_rx_data0_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_03), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_03), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_03), }; const mcu_periph_obj_t mcu_sai_rx_sync_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_02), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_04), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_04), }; const mcu_periph_obj_t mcu_sai_tx_bclk_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_06), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_01), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_01), }; const mcu_periph_obj_t mcu_sai_tx_data0_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_04), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_02), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_02), }; const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(1, 0, 0, 0, &pin_GPIO_07), - PERIPH_PIN(2, 1, 0, 0, &pin_GPIO_SD_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_SD_00), +}; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_01), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 4, 0, 0, &pin_GPIO_AD_02), }; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h index 109717528f..045e33ca0e 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1011/periph.h @@ -54,4 +54,7 @@ extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[2]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[2]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[2]; +extern const mcu_periph_obj_t mcu_mqs_left_list[1]; +extern const mcu_periph_obj_t mcu_mqs_right_list[1]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1011_PERIPHERALS_MIMXRT1011_PERIPH_H diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c index b80fcf5065..59bd3cc105 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.c @@ -311,3 +311,13 @@ const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_34), PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_SD_B1_07), }; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_07), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_17), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_38), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_06), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_EMC_16), + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_37), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h index 31ac10e651..51c97b3eef 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1021/periph.h @@ -53,3 +53,6 @@ extern const mcu_periph_obj_t mcu_sai_rx_sync_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; + +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c index 8c038bdb71..c43f4eb96b 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.c @@ -362,3 +362,13 @@ const mcu_periph_obj_t mcu_sai_tx_sync_list[] = { PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_39), PERIPH_PIN(3, 8, 0, 0, &pin_GPIO_SD_B1_02), }; +const mcu_periph_obj_t mcu_mqs_left_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_14), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_01), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_05), +}; +const mcu_periph_obj_t mcu_mqs_right_list[] = { + PERIPH_PIN(3, 3, 0, 0, &pin_GPIO_EMC_13), + PERIPH_PIN(3, 2, 0, 0, &pin_GPIO_B0_00), + PERIPH_PIN(3, 1, 0, 0, &pin_GPIO_AD_B0_04), +}; diff --git a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h index ab8eb22678..28ea8e3742 100644 --- a/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h +++ b/ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062/periph.h @@ -54,4 +54,7 @@ extern const mcu_periph_obj_t mcu_sai_tx_bclk_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_data0_list[7]; extern const mcu_periph_obj_t mcu_sai_tx_sync_list[7]; +extern const mcu_periph_obj_t mcu_mqs_left_list[3]; +extern const mcu_periph_obj_t mcu_mqs_right_list[3]; + #endif // MICROPY_INCLUDED_MIMXRT10XX_MIMXRT1062_PERIPHERALS_MIMXRT1011_PERIPH_H From e1c8a3062a0c5000162ff8730dcb28dc2637a78c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:06:53 -0500 Subject: [PATCH 10/30] remove debugging print --- ports/mimxrt10xx/common-hal/audiobusio/__init__.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index f2de99f004..515c39a268 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -284,7 +284,6 @@ static void i2s_fill_buffer(i2s_t *self) { static void i2s_callback_fun(void *self_in) { i2s_t *self = self_in; - mp_printf(&mp_plat_print, "."); i2s_fill_buffer(self); } From 0c0e06c940848e9bf26642272e5bb2eb0fa1352a Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:10:04 -0500 Subject: [PATCH 11/30] remove comment that was copypasted --- ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h index 27cebc649b..b9e4279927 100644 --- a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.h @@ -32,8 +32,6 @@ #include "common-hal/audiobusio/__init__.h" -// Some boards don't implement I2SOut, so suppress any routines from here. - typedef struct { mp_obj_base_t base; i2s_t i2s; From b1d9331367b4717996cf4c353a18212491dcfa5b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 23 Mar 2023 21:11:05 -0500 Subject: [PATCH 12/30] move comment next to its associated #if --- ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h index 2473eb4cab..319e52c159 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h +++ b/ports/mimxrt10xx/common-hal/audiobusio/I2SOut.h @@ -26,14 +26,13 @@ #pragma once +// Some boards don't implement I2SOut, so suppress any routines from here. #if CIRCUITPY_AUDIOBUSIO_I2SOUT #include "supervisor/background_callback.h" #include "common-hal/microcontroller/Pin.h" #include "common-hal/audiobusio/__init__.h" -// Some boards don't implement I2SOut, so suppress any routines from here. - typedef struct { mp_obj_base_t base; i2s_t i2s; From efeaa1ad20a9977117169a9670707e17e767bd8a Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:02:08 +0300 Subject: [PATCH 13/30] Update mpconfigboard.mk of Deneyap Kart --- ports/espressif/boards/deneyap_kart/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk index c98cdb87b6..ea8c9a8522 100644 --- a/ports/espressif/boards/deneyap_kart/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D001 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320001 IDF_TARGET = esp32 From c8b329c4eeafcfd7350fe75652b2193a72e3bbcd Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:03:01 +0300 Subject: [PATCH 14/30] Update mpconfigboard.mk of Deneyap Kart 1A --- ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk index 8b3da63e5b..976083217e 100644 --- a/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart_1a/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D002 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00320002 IDF_TARGET = esp32 From 872495ef36a49c939d0e46f147476b1f4d904cf7 Mon Sep 17 00:00:00 2001 From: Ozgur BOSTAN <79173593+ozgurbostan@users.noreply.github.com> Date: Sun, 26 Mar 2023 01:03:40 +0300 Subject: [PATCH 15/30] Update mpconfigboard.mk Deneyap Kart G --- ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk index c01e84611b..a470d7a088 100644 --- a/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk +++ b/ports/espressif/boards/deneyap_kart_g/mpconfigboard.mk @@ -1,5 +1,5 @@ -CIRCUITPY_CREATOR_ID = 0x00001209 -CIRCUITPY_CREATION_ID = 0x0032D003 +CIRCUITPY_CREATOR_ID = 0x19231923 +CIRCUITPY_CREATION_ID = 0x00C30001 IDF_TARGET = esp32c3 From 297d9d0a8152299d95d7c04cf07a409d2a955d66 Mon Sep 17 00:00:00 2001 From: ozgurbostan Date: Sun, 26 Mar 2023 14:54:34 +0300 Subject: [PATCH 16/30] Add new boards (deneyapmini/v2 and deneyapkart1a) --- .../boards/deneyap_kart_1a_v2/board.c | 32 +++++++ .../boards/deneyap_kart_1a_v2/mpconfigboard.h | 47 ++++++++++ .../deneyap_kart_1a_v2/mpconfigboard.mk | 12 +++ .../boards/deneyap_kart_1a_v2/pins.c | 73 +++++++++++++++ .../boards/deneyap_kart_1a_v2/sdkconfig | 47 ++++++++++ ports/espressif/boards/deneyap_mini/board.c | 31 +++++++ .../boards/deneyap_mini/mpconfigboard.h | 39 ++++++++ .../boards/deneyap_mini/mpconfigboard.mk | 12 +++ ports/espressif/boards/deneyap_mini/pins.c | 89 +++++++++++++++++++ ports/espressif/boards/deneyap_mini/sdkconfig | 4 + .../espressif/boards/deneyap_mini_v2/board.c | 32 +++++++ .../boards/deneyap_mini_v2/mpconfigboard.h | 39 ++++++++ .../boards/deneyap_mini_v2/mpconfigboard.mk | 11 +++ ports/espressif/boards/deneyap_mini_v2/pins.c | 85 ++++++++++++++++++ .../boards/deneyap_mini_v2/sdkconfig | 37 ++++++++ 15 files changed, 590 insertions(+) create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/board.c create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/pins.c create mode 100644 ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig create mode 100644 ports/espressif/boards/deneyap_mini/board.c create mode 100644 ports/espressif/boards/deneyap_mini/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_mini/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_mini/pins.c create mode 100644 ports/espressif/boards/deneyap_mini/sdkconfig create mode 100644 ports/espressif/boards/deneyap_mini_v2/board.c create mode 100644 ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h create mode 100644 ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk create mode 100644 ports/espressif/boards/deneyap_mini_v2/pins.c create mode 100644 ports/espressif/boards/deneyap_mini_v2/sdkconfig diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/board.c b/ports/espressif/boards/deneyap_kart_1a_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h new file mode 100644 index 0000000000..088bfbfd41 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.h @@ -0,0 +1,47 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Kart 1A v2" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO33) +#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO21) + +#define MICROPY_HW_LED_STATUS (&pin_GPIO13) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO4) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO3) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO36) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO35) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO37) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO38) +#define DEFAULT_UART_BUS_TX (&pin_GPIO39) + +#define DOUBLE_TAP_PIN (&pin_GPIO34) diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk new file mode 100644 index 0000000000..1ec7c73185 --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x239A +USB_PID = 0x8148 + +USB_PRODUCT = "Deneyap Kart 1A v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/pins.c b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c new file mode 100644 index 0000000000..cf4c915e7f --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/pins.c @@ -0,0 +1,73 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_BOOT0), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO3) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO14) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO15) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) }, + + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + + { 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_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig new file mode 100644 index 0000000000..4e99a09f2e --- /dev/null +++ b/ports/espressif/boards/deneyap_kart_1a_v2/sdkconfig @@ -0,0 +1,47 @@ +# +# Component config +# +# +# ESP32S3-Specific +# +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +# CONFIG_SPIRAM_TYPE_AUTO is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM16 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM64=y +CONFIG_SPIRAM_SIZE=8388608 +# +# PSRAM Clock and CS IO for ESP32S3 +# +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM Clock and CS IO for ESP32S3 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_120M is not set +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# end of SPI RAM config + +# end of ESP32S3-Specific + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP + +# end of Component config diff --git a/ports/espressif/boards/deneyap_mini/board.c b/ports/espressif/boards/deneyap_mini/board.c new file mode 100644 index 0000000000..ac27ce4970 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/board.c @@ -0,0 +1,31 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.h b/ports/espressif/boards/deneyap_mini/mpconfigboard.h new file mode 100644 index 0000000000..0e47285238 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk new file mode 100644 index 0000000000..f6944b7d7a --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/mpconfigboard.mk @@ -0,0 +1,12 @@ +USB_VID = 0x303A +USB_PID = 0x8142 + +USB_PRODUCT = "Deneyap Mini" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/deneyap_mini/pins.c b/ports/espressif/boards/deneyap_mini/pins.c new file mode 100644 index 0000000000..6c04661467 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/pins.c @@ -0,0 +1,89 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_BT), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO35) }, + { MP_ROM_QSTR(MP_QSTR_LEDB), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_LEDG), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO34) }, + { MP_ROM_QSTR(MP_QSTR_LEDR), MP_ROM_PTR(&pin_GPIO34) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO16) }, + + { 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_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini/sdkconfig b/ports/espressif/boards/deneyap_mini/sdkconfig new file mode 100644 index 0000000000..7dfaf3052c --- /dev/null +++ b/ports/espressif/boards/deneyap_mini/sdkconfig @@ -0,0 +1,4 @@ +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini" +# end of LWIP diff --git a/ports/espressif/boards/deneyap_mini_v2/board.c b/ports/espressif/boards/deneyap_mini_v2/board.c new file mode 100644 index 0000000000..2287dbaaa7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/board.c @@ -0,0 +1,32 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" +#include "mpconfigboard.h" +#include "shared-bindings/microcontroller/Pin.h" + + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h new file mode 100644 index 0000000000..be6cbd86b7 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.h @@ -0,0 +1,39 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "Deneyap Mini v2" +#define MICROPY_HW_MCU_NAME "ESP32S2" + +#define CIRCUITPY_BOARD_I2C (1) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO37, .sda = &pin_GPIO36}} + +#define CIRCUITPY_BOARD_SPI (1) +#define CIRCUITPY_BOARD_SPI_PIN {{.clock = &pin_GPIO38, .mosi = &pin_GPIO40, .miso = &pin_GPIO39}} + +#define CIRCUITPY_BOARD_UART (1) +#define CIRCUITPY_BOARD_UART_PIN {{.tx = &pin_GPIO43, .rx = &pin_GPIO44}} diff --git a/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk new file mode 100644 index 0000000000..fa9c6b40ea --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x8145 + +USB_PRODUCT = "Deneyap Mini v2" +USB_MANUFACTURER = "Turkish Technology Team Foundation" + +IDF_TARGET = esp32s2 + +CIRCUITPY_ESP_FLASH_MODE = dio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 4MB diff --git a/ports/espressif/boards/deneyap_mini_v2/pins.c b/ports/espressif/boards/deneyap_mini_v2/pins.c new file mode 100644 index 0000000000..ab3250769d --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/pins.c @@ -0,0 +1,85 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43) }, + + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) }, + { MP_ROM_QSTR(MP_QSTR_PWM0), MP_ROM_PTR(&pin_GPIO42) }, + + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO41) }, + { MP_ROM_QSTR(MP_QSTR_PWM1), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_MO), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO40) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO40) }, + + { MP_ROM_QSTR(MP_QSTR_MI), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO39) }, + + { MP_ROM_QSTR(MP_QSTR_MC), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_SC), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO37) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO37) }, + + { MP_ROM_QSTR(MP_QSTR_SD), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO36) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO36) }, + + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO26) }, + + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_SS), MP_ROM_PTR(&pin_GPIO21) }, + + { MP_ROM_QSTR(MP_QSTR_DA1), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_DAC1), MP_ROM_PTR(&pin_GPIO18) }, + + { MP_ROM_QSTR(MP_QSTR_DA0), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_DAC0), MP_ROM_PTR(&pin_GPIO17) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_GPKEY), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO33) }, + { MP_ROM_QSTR(MP_QSTR_RGBLED), MP_ROM_PTR(&pin_GPIO33) }, + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_T0), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_T1), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_T2), MP_ROM_PTR(&pin_GPIO9) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_T3), MP_ROM_PTR(&pin_GPIO10) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_T4), MP_ROM_PTR(&pin_GPIO11) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_T5), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_T6), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO16) }, + + { 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_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/deneyap_mini_v2/sdkconfig b/ports/espressif/boards/deneyap_mini_v2/sdkconfig new file mode 100644 index 0000000000..613b744ef2 --- /dev/null +++ b/ports/espressif/boards/deneyap_mini_v2/sdkconfig @@ -0,0 +1,37 @@ +CONFIG_ESP32S2_SPIRAM_SUPPORT=y +# +# SPI RAM config +# +# CONFIG_SPIRAM_TYPE_AUTO is not set +CONFIG_SPIRAM_TYPE_ESPPSRAM16=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM32 is not set +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +CONFIG_SPIRAM_SIZE=2097152 +# end of SPI RAM config + +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +# +# PSRAM clock and cs IO for ESP32S2 +# +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# end of PSRAM clock and cs IO for ESP32S2 + +# CONFIG_SPIRAM_FETCH_INSTRUCTIONS is not set +# CONFIG_SPIRAM_RODATA is not set +# CONFIG_SPIRAM_SPEED_80M is not set +CONFIG_SPIRAM_SPEED_40M=y +# CONFIG_SPIRAM_SPEED_26M is not set +# CONFIG_SPIRAM_SPEED_20M is not set +CONFIG_SPIRAM=y +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +CONFIG_SPIRAM_USE_MEMMAP=y +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +# CONFIG_SPIRAM_USE_MALLOC is not set +CONFIG_SPIRAM_MEMTEST=y +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="DeneyapMini_v2" +# end of LWIP From d9c4050f9263ca0f62a20f4c36362b8d31221865 Mon Sep 17 00:00:00 2001 From: Luc Date: Sat, 25 Mar 2023 22:01:49 +0000 Subject: [PATCH 17/30] Translated using Weblate (German) Currently translated at 96.0% (962 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index fb676d621e..68b1152895 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,14 +6,14 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-01 17:39+0000\n" -"Last-Translator: Ettore Atalan \n" +"PO-Revision-Date: 2023-03-26 22:37+0000\n" +"Last-Translator: Luc \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16\n" +"X-Generator: Weblate 4.17-dev\n" #: main.c msgid "" @@ -198,7 +198,7 @@ msgstr "" #: ports/espressif/common-hal/analogbufio/BufferedIn.c msgid "%q must be array of type 'H'" -msgstr "" +msgstr "%q muss ein Array vom Typ 'H' sein" #: ports/raspberrypi/bindings/cyw43/__init__.c py/argcheck.c py/objexcept.c #: shared-bindings/canio/CAN.c shared-bindings/digitalio/Pull.c @@ -526,7 +526,7 @@ msgstr "Sucht bereits nach Wifi-Netzwerken" #: shared-module/os/getenv.c #, c-format msgid "An error occurred while retrieving '%s':\n" -msgstr "" +msgstr "Ein Fehler ist aufgetreten beim Abfragen von '%s':\n" #: ports/stm/common-hal/audiopwmio/PWMAudioOut.c msgid "Another PWMAudioOut is already active" @@ -826,11 +826,11 @@ msgstr "" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays have different lengths" -msgstr "" +msgstr "Koordinaten-Arrays haben unterschiedliche Längen" #: shared-bindings/bitmaptools/__init__.c msgid "Coordinate arrays types have different sizes" -msgstr "" +msgstr "Typen der Koordinaten-Arrays haben unterschiedliche Längen" #: py/persistentcode.c msgid "Corrupt .mpy file" @@ -951,7 +951,7 @@ msgstr "Fehler in regex" #: supervisor/shared/safe_mode.c msgid "Error in safemode.py." -msgstr "" +msgstr "Fehler in safemode.py." #: shared-bindings/socketpool/Socket.c shared-bindings/ssl/SSLSocket.c msgid "Error: Failure to bind" @@ -1028,7 +1028,7 @@ msgstr "Interner Flash konnte nicht geschrieben werden." #: supervisor/shared/safe_mode.c msgid "Fault detected by hardware." -msgstr "" +msgstr "Hardware hat Fehler festgestellt." #: py/moduerrno.c msgid "File exists" @@ -1250,7 +1250,7 @@ msgstr "Der Interne WatchDog Timer ist abgelaufen." #: supervisor/shared/safe_mode.c msgid "Interrupt error." -msgstr "" +msgstr "Interrupt Fehler." #: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c py/argcheck.c #: shared-bindings/digitalio/DigitalInOut.c @@ -1278,7 +1278,7 @@ msgstr "Ungültige BSSID" #: main.c msgid "Invalid CIRCUITPY_PYSTACK_SIZE\n" -msgstr "" +msgstr "Ungültiger Wert CIRCUITPY_PYSTACK_SIZE\n" #: shared-bindings/wifi/Radio.c msgid "Invalid MAC address" @@ -1977,7 +1977,7 @@ msgstr "Maßstabs-Abmeßungen müssen durch 3 teilbar sein" #: ports/espressif/common-hal/_bleio/Adapter.c #: ports/nrf/common-hal/_bleio/Adapter.c msgid "Scan already in progress. Stop with stop_scan." -msgstr "" +msgstr "Scan läuft schon. Stoppen mit stop_scan." #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c #: ports/atmel-samd/common-hal/audiobusio/PDMIn.c From 19429d3626c7396b6ce064ea844e98081e53a0bb Mon Sep 17 00:00:00 2001 From: Neradoc Date: Mon, 27 Mar 2023 16:58:44 +0200 Subject: [PATCH 18/30] espnow.Peer: fix argument types and default values --- ports/espressif/bindings/espnow/ESPNow.c | 2 +- ports/espressif/bindings/espnow/Peer.c | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 513966e1e8..06c186d210 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -53,7 +53,7 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| class ESPNow: //| """Provides access to the ESP-NOW protocol.""" //| -//| def __init__(self, buffer_size: Optional[int], phy_rate: Optional[int]) -> None: +//| def __init__(self, buffer_size: int = 526, phy_rate: Optional[int] = None) -> None: //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index ca756409a6..89766dbf11 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -40,6 +40,7 @@ //| def __init__( //| self, //| mac: bytes, +//| *, //| lmk: Optional[bytes], //| channel: int = 0, //| interface: int = 0, @@ -58,10 +59,10 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypt }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mac, MP_ARG_OBJ | MP_ARG_REQUIRED }, - { MP_QSTR_lmk, MP_ARG_OBJ, { .u_obj = mp_const_none } }, - { MP_QSTR_channel, MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_interface,MP_ARG_INT, { .u_obj = mp_const_none } }, - { MP_QSTR_encrypt, MP_ARG_BOOL,{ .u_obj = mp_const_none } }, + { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, + { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, + { MP_QSTR_encrypt, MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -77,20 +78,11 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s memcpy(self->peer_info.peer_addr, common_hal_espnow_get_bytes_len(args[ARG_mac].u_obj, ESP_NOW_ETH_ALEN), ESP_NOW_ETH_ALEN); - const mp_obj_t channel = args[ARG_channel].u_obj; - if (channel != mp_const_none) { - self->peer_info.channel = mp_arg_validate_int_range(mp_obj_get_int(channel), 0, 14, MP_QSTR_channel); - } + self->peer_info.channel = mp_arg_validate_int_range(args[ARG_channel].u_int, 0, 14, MP_QSTR_channel); - const mp_obj_t interface = args[ARG_interface].u_obj; - if (interface != mp_const_none) { - self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(mp_obj_get_int(interface), 0, 1, MP_QSTR_interface); - } + self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(args[ARG_interface].u_int, 0, 1, MP_QSTR_interface); - const mp_obj_t encrypt = args[ARG_encrypt].u_obj; - if (encrypt != mp_const_none) { - self->peer_info.encrypt = mp_obj_is_true(encrypt); - } + self->peer_info.encrypt = args[ARG_encrypt].u_bool; const mp_obj_t lmk = args[ARG_lmk].u_obj; if (lmk != mp_const_none) { From d6a067b0e564cc9d40d7782541393c5fe63f99e2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Mar 2023 10:52:23 -0500 Subject: [PATCH 19/30] Make PWMAudioOut object ll, have finaliser .. for reasons stated in the comment --- shared-bindings/audiopwmio/PWMAudioOut.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index b4cea75184..56c6412bc6 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -114,7 +114,12 @@ STATIC mp_obj_t audiopwmio_pwmaudioout_make_new(const mp_obj_type_t *type, size_ validate_obj_is_free_pin_or_none(args[ARG_right_channel].u_obj, MP_QSTR_right_channel); // create AudioOut object from the given pin - audiopwmio_pwmaudioout_obj_t *self = m_new_obj(audiopwmio_pwmaudioout_obj_t); + // The object is made long-lived because many implementations keep + // a pointer to the object (e.g., for the interrupt handler), which + // will not work properly if the object is moved. It is created + // with a finaliser as some ports use these (rather than 'reset' functions) + // to ensure resources are collected at interpreter shutdown. + audiopwmio_pwmaudioout_obj_t *self = m_new_ll_obj_with_finaliser(audiopwmio_pwmaudioout_obj_t); self->base.type = &audiopwmio_pwmaudioout_type; common_hal_audiopwmio_pwmaudioout_construct(self, left_channel_pin, right_channel_pin, args[ARG_quiescent_value].u_int); @@ -249,6 +254,7 @@ MP_PROPERTY_GETTER(audiopwmio_pwmaudioout_paused_obj, STATIC const mp_rom_map_elem_t audiopwmio_pwmaudioout_locals_dict_table[] = { // Methods { MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, + { MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiopwmio_pwmaudioout_deinit_obj) }, { MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&default___enter___obj) }, { MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&audiopwmio_pwmaudioout___exit___obj) }, { MP_ROM_QSTR(MP_QSTR_play), MP_ROM_PTR(&audiopwmio_pwmaudioout_play_obj) }, From 9d090ee73eabe5a84eb7f2aeacad431b4994cd29 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 27 Mar 2023 10:52:52 -0500 Subject: [PATCH 20/30] get rid of another debug print --- ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c index dd50c7950a..8650522b41 100644 --- a/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/mimxrt10xx/common-hal/audiopwmio/PWMAudioOut.c @@ -87,7 +87,6 @@ void common_hal_audiopwmio_pwmaudioout_construct(audiopwmio_pwmaudioout_obj_t *s const mcu_periph_obj_t *left_periph = find_pin_function(mcu_mqs_left_list, left_channel, &instance, MP_QSTR_left_channel); const mcu_periph_obj_t *right_periph = find_pin_function(mcu_mqs_right_list, right_channel, &instance, MP_QSTR_right_channel); - mp_printf(&mp_plat_print, "note: peripheral %d\n", instance); sai_transceiver_t config; SAI_GetClassicI2SConfig(&config, kSAI_WordWidth16bits, kSAI_Stereo, 1U << 0u); config.frameSync.frameSyncEarly = false; From 1fad969389ee76138c4ae3834724e2bde550ae78 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sun, 17 Jul 2022 10:17:05 +0200 Subject: [PATCH 21/30] add unsigned ints and 64 bit types to msgpack change msgpack error message when format invalid --- locale/circuitpython.pot | 8 +++--- shared-module/msgpack/__init__.c | 42 +++++++++++++++++++++++++------- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index 55ab977e97..b5026f7829 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1271,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" diff --git a/shared-module/msgpack/__init__.c b/shared-module/msgpack/__init__.c index d32550722c..3a34731d77 100644 --- a/shared-module/msgpack/__init__.c +++ b/shared-module/msgpack/__init__.c @@ -102,6 +102,16 @@ STATIC uint32_t read4(msgpack_stream_t *s) { return res; } +STATIC uint64_t read8(msgpack_stream_t *s) { + uint64_t res = 0; + read(s, &res, 8); + int n = 1; + if (*(char *)&n == 1) { + res = __builtin_bswap64(res); + } + return res; +} + STATIC size_t read_size(msgpack_stream_t *s, uint8_t len_index) { size_t res = 0; switch (len_index) { @@ -207,7 +217,7 @@ STATIC void pack_bin(msgpack_stream_t *s, const uint8_t *data, size_t len) { } } -STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { +STATIC void pack_ext(msgpack_stream_t *s, int8_t code, const uint8_t *data, size_t len) { if (len == 1) { write1(s, 0xd4); } else if (len == 2) { @@ -424,22 +434,39 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { return unpack_bytes(s, read_size(s, code - 0xc4)); } case 0xcc: // uint8 + return MP_OBJ_NEW_SMALL_INT((uint8_t)read1(s)); case 0xd0: // int8 return MP_OBJ_NEW_SMALL_INT((int8_t)read1(s)); case 0xcd: // uint16 + return MP_OBJ_NEW_SMALL_INT((uint16_t)read2(s)); case 0xd1: // int16 return MP_OBJ_NEW_SMALL_INT((int16_t)read2(s)); case 0xce: // uint32 + return mp_obj_new_int_from_uint((uint32_t)read4(s)); case 0xd2: // int32 - return MP_OBJ_NEW_SMALL_INT((int32_t)read4(s)); - case 0xca: { - union Float { mp_float_t f; - uint32_t u; + return mp_obj_new_int((int32_t)read4(s)); + case 0xcf: // uint 64 + return mp_obj_new_int_from_ull((uint64_t)read8(s)); + case 0xd3: // int 64 + return mp_obj_new_int_from_ll((int64_t)read8(s)); + case 0xca: { // float + union Float { + mp_float_t f; + uint32_t u; }; union Float data; data.u = read4(s); return mp_obj_new_float(data.f); } + case 0xcb: { // double + union Double { + uint64_t u; + double d; + }; + union Double data; + data.u = read8(s); + return mp_obj_new_float_from_d(data.d); + } case 0xd9: case 0xda: case 0xdb: { @@ -483,11 +510,8 @@ STATIC mp_obj_t unpack(msgpack_stream_t *s, mp_obj_t ext_hook, bool use_list) { // ext 8, 16, 32 return unpack_ext(s, read_size(s, code - 0xc7), ext_hook); case 0xc1: // never used - case 0xcb: // float 64 - case 0xcf: // uint 64 - case 0xd3: // int 64 default: - mp_raise_NotImplementedError(translate("64 bit types")); + mp_raise_ValueError(translate("Invalid format")); } } From 16854ae57084659390ed14f1dc69afa4f5547bc6 Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Mon, 27 Mar 2023 16:29:03 -0400 Subject: [PATCH 22/30] Add BUTTON, reorganise pins. --- .../raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c index e014ace05a..368f96b6fe 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c @@ -19,8 +19,9 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, @@ -31,10 +32,12 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_CKN), MP_ROM_PTR(&pin_GPIO16) }, { MP_ROM_QSTR(MP_QSTR_CKP), MP_ROM_PTR(&pin_GPIO17) }, { MP_ROM_QSTR(MP_QSTR_D0N), MP_ROM_PTR(&pin_GPIO18) }, From ca23f1e1acf573d8922bef35df2d4235f26d3aad Mon Sep 17 00:00:00 2001 From: foamyguy Date: Mon, 27 Mar 2023 16:52:01 -0500 Subject: [PATCH 23/30] attempt to fix missing jquery in RTD --- conf.py | 1 + requirements-doc.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/conf.py b/conf.py index 7b3b4ca585..ea5072ae4c 100644 --- a/conf.py +++ b/conf.py @@ -77,6 +77,7 @@ needs_sphinx = '1.3' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', + "sphinxcontrib.jquery", 'sphinxcontrib.rsvgconverter', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', diff --git a/requirements-doc.txt b/requirements-doc.txt index 43e99fa32f..0489dc0b9f 100644 --- a/requirements-doc.txt +++ b/requirements-doc.txt @@ -13,6 +13,7 @@ sphinx!=5.2.0.post0 sphinx-autoapi sphinx-rtd-theme sphinxcontrib-svg2pdfconverter +sphinxcontrib-jquery readthedocs-sphinx-search myst-parser From 89bd5fae616ec6d403d820bb470a5375789ccf5d Mon Sep 17 00:00:00 2001 From: CDario Date: Tue, 28 Mar 2023 06:28:56 +0000 Subject: [PATCH 24/30] Add M5stack AtomS3 Lite --- .../boards/m5stack_atoms3_lite/board.c | 29 +++++++++++++ .../m5stack_atoms3_lite/mpconfigboard.h | 36 ++++++++++++++++ .../m5stack_atoms3_lite/mpconfigboard.mk | 11 +++++ .../boards/m5stack_atoms3_lite/pins.c | 42 +++++++++++++++++++ .../boards/m5stack_atoms3_lite/sdkconfig | 7 ++++ 5 files changed, 125 insertions(+) create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/board.c create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/pins.c create mode 100644 ports/espressif/boards/m5stack_atoms3_lite/sdkconfig diff --git a/ports/espressif/boards/m5stack_atoms3_lite/board.c b/ports/espressif/boards/m5stack_atoms3_lite/board.c new file mode 100644 index 0000000000..164430c88c --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2020 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h new file mode 100644 index 0000000000..43dd436345 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.h @@ -0,0 +1,36 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2019 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +// Micropython setup + +#define MICROPY_HW_BOARD_NAME "M5Stack AtomS3 Lite" +#define MICROPY_HW_MCU_NAME "ESP32S3" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO35) + +#define CIRCUITPY_BOARD_I2C (2) +#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO39, .sda = &pin_GPIO38}, \ + {.scl = &pin_GPIO1, .sda = &pin_GPIO2}} diff --git a/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk new file mode 100644 index 0000000000..8bb5ab76d8 --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/mpconfigboard.mk @@ -0,0 +1,11 @@ +USB_VID = 0x303A +USB_PID = 0x815F +USB_PRODUCT = "M5Stack AtomS3 Lite" +USB_MANUFACTURER = "M5Stack" + +IDF_TARGET = esp32s3 + +CIRCUITPY_ESP_FLASH_MODE = qio +CIRCUITPY_ESP_FLASH_FREQ = 80m +CIRCUITPY_ESP_FLASH_SIZE = 8MB +CIRCUITPY_ESPCAMERA = 0 diff --git a/ports/espressif/boards/m5stack_atoms3_lite/pins.c b/ports/espressif/boards/m5stack_atoms3_lite/pins.c new file mode 100644 index 0000000000..052c15e69f --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/pins.c @@ -0,0 +1,42 @@ +#include "shared-bindings/board/__init__.h" + +CIRCUITPY_BOARD_BUS_SINGLETON(porta_i2c, i2c, 1) + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_PORTA_SCL), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_PORTA_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO8) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) }, + + + { MP_ROM_QSTR(MP_QSTR_D39), MP_ROM_PTR(&pin_GPIO39) }, + { MP_ROM_QSTR(MP_QSTR_D38), MP_ROM_PTR(&pin_GPIO38) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO35) }, + + { MP_ROM_QSTR(MP_QSTR_BTN), MP_ROM_PTR(&pin_GPIO41) }, + + { MP_ROM_QSTR(MP_QSTR_IR_LED), MP_ROM_PTR(&pin_GPIO4) }, + + { 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); diff --git a/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig new file mode 100644 index 0000000000..9d924272ec --- /dev/null +++ b/ports/espressif/boards/m5stack_atoms3_lite/sdkconfig @@ -0,0 +1,7 @@ +CONFIG_ESP32S3_SPIRAM_SUPPORT=n + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3" +# end of LWIP From a481c564da37beeaa5d88b08a33103901b803839 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 28 Mar 2023 14:00:03 +0200 Subject: [PATCH 25/30] change Peer(encrypt=) to encrypted to match the property --- ports/espressif/bindings/espnow/Peer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ports/espressif/bindings/espnow/Peer.c b/ports/espressif/bindings/espnow/Peer.c index 89766dbf11..5c21dafc4c 100644 --- a/ports/espressif/bindings/espnow/Peer.c +++ b/ports/espressif/bindings/espnow/Peer.c @@ -44,7 +44,7 @@ //| lmk: Optional[bytes], //| channel: int = 0, //| interface: int = 0, -//| encrypt: bool = False, +//| encrypted: bool = False, //| ) -> None: //| """Construct a new peer object. //| @@ -52,17 +52,17 @@ //| :param bytes lmk: The Local Master Key (lmk) of the peer. //| :param int channel: The peer's channel. Default: 0 ie. use the current channel. //| :param int interface: The WiFi interface to use. Default: 0 ie. STA. -//| :param bool encrypt: Whether or not to use encryption. +//| :param bool encrypted: Whether or not to use encryption. //| """ //| ... STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { - enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypt }; + enum { ARG_mac, ARG_lmk, ARG_channel, ARG_interface, ARG_encrypted }; static const mp_arg_t allowed_args[] = { { MP_QSTR_mac, MP_ARG_OBJ | MP_ARG_REQUIRED }, { MP_QSTR_lmk, MP_ARG_OBJ | MP_ARG_KW_ONLY, { .u_obj = mp_const_none } }, { MP_QSTR_channel, MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, { MP_QSTR_interface,MP_ARG_INT | MP_ARG_KW_ONLY, { .u_int = 0 } }, - { MP_QSTR_encrypt, MP_ARG_BOOL | MP_ARG_KW_ONLY,{ .u_bool = false } }, + { MP_QSTR_encrypted,MP_ARG_BOOL | MP_ARG_KW_ONLY, { .u_bool = false } }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; @@ -82,7 +82,7 @@ STATIC mp_obj_t espnow_peer_make_new(const mp_obj_type_t *type, size_t n_args, s self->peer_info.ifidx = (wifi_interface_t)mp_arg_validate_int_range(args[ARG_interface].u_int, 0, 1, MP_QSTR_interface); - self->peer_info.encrypt = args[ARG_encrypt].u_bool; + self->peer_info.encrypt = args[ARG_encrypted].u_bool; const mp_obj_t lmk = args[ARG_lmk].u_obj; if (lmk != mp_const_none) { From 02c628a3c70870557c83477a78b6a85a87f40bb7 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Tue, 28 Mar 2023 14:36:43 +0200 Subject: [PATCH 26/30] Update ports/espressif/bindings/espnow/ESPNow.c Co-authored-by: MicroDev <70126934+microdev1@users.noreply.github.com> --- ports/espressif/bindings/espnow/ESPNow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/espressif/bindings/espnow/ESPNow.c b/ports/espressif/bindings/espnow/ESPNow.c index 06c186d210..32676bc9be 100644 --- a/ports/espressif/bindings/espnow/ESPNow.c +++ b/ports/espressif/bindings/espnow/ESPNow.c @@ -53,7 +53,7 @@ static void espnow_check_for_deinit(espnow_obj_t *self) { //| class ESPNow: //| """Provides access to the ESP-NOW protocol.""" //| -//| def __init__(self, buffer_size: int = 526, phy_rate: Optional[int] = None) -> None: +//| def __init__(self, buffer_size: int = 526, phy_rate: int = 0) -> None: //| """Allocate and initialize `ESPNow` instance as a singleton. //| //| :param int buffer_size: The size of the internal ring buffer. Default: 526 bytes. From f7c2599c293dde3e790adc4cb337ae1e9195261e Mon Sep 17 00:00:00 2001 From: Luc Date: Mon, 27 Mar 2023 19:20:28 +0000 Subject: [PATCH 27/30] Translated using Weblate (German) Currently translated at 100.0% (1002 of 1002 strings) Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/de/ --- locale/de_DE.po | 163 ++++++++++++++++++++++++++---------------------- 1 file changed, 87 insertions(+), 76 deletions(-) diff --git a/locale/de_DE.po b/locale/de_DE.po index 68b1152895..98d4f651de 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-04 12:55-0600\n" -"PO-Revision-Date: 2023-03-26 22:37+0000\n" +"PO-Revision-Date: 2023-03-28 14:18+0000\n" "Last-Translator: Luc \n" "Language: de_DE\n" "MIME-Version: 1.0\n" @@ -37,12 +37,17 @@ msgid "" "Please file an issue with your program at https://github.com/adafruit/" "circuitpython/issues." msgstr "" +"\n" +"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://github" +".com/adafruit/circuitpython/issues." #: supervisor/shared/safe_mode.c msgid "" "\n" "Press reset to exit safe mode.\n" msgstr "" +"\n" +"Drücke Reset, um den Sicherheitsmodus zu beenden.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -189,7 +194,7 @@ msgstr "%q muss >= %d sein" #: shared-bindings/analogbufio/BufferedIn.c msgid "%q must be a bytearray or array of type 'H' or 'B'" -msgstr "" +msgstr "%q muss ein Bytearray oder ein Array vom Typ 'H' oder 'B' sein" #: shared-bindings/audiocore/RawSample.c msgid "%q must be a bytearray or array of type 'h', 'H', 'b', or 'B'" @@ -602,7 +607,7 @@ msgstr "Bitmap-Grösse und Bits pro Wert müssen übereinstimmen" #: supervisor/shared/safe_mode.c msgid "Boot device must be first (interface #0)." -msgstr "" +msgstr "Boot-Device muss an erster Stelle kommen (Interface #0)." #: ports/mimxrt10xx/common-hal/busio/UART.c msgid "Both RX and TX required for flow control" @@ -792,9 +797,8 @@ msgstr "" "Die Frequenz eines bereits verwendeten Timers kann nicht variiert werden" #: ports/nrf/common-hal/alarm/pin/PinAlarm.c -#, fuzzy msgid "Cannot wake on pin edge, only level" -msgstr "Kann nicht durch \"Pin edge\" geweckt werden nur durch \"level\"" +msgstr "Kann nicht durch Flanke an Pin geweckt werden, sondern nur durch Pegel" #: ports/espressif/common-hal/alarm/pin/PinAlarm.c msgid "Cannot wake on pin edge. Only level." @@ -1121,12 +1125,13 @@ msgstr "Hardware in Benutzung, probiere alternative Pins" #: supervisor/shared/safe_mode.c msgid "Heap allocation when VM not running." -msgstr "" +msgstr "Allokation auf Heap während VM nicht läuft." #: supervisor/shared/safe_mode.c msgid "" "Heap was corrupted because the stack was too small. Increase stack size." msgstr "" +"Heap wurde beschädigt, weil der Stack zu klein war. Bitte Stack vergrößern." #: extmod/vfs_posix_file.c py/objstringio.c msgid "I/O operation on closed file" @@ -1325,7 +1330,7 @@ msgstr "Ungültiger Zustand" #: shared-module/os/getenv.c msgid "Invalid unicode escape" -msgstr "" +msgstr "Ungültiges Unicode-Escape-Zeichen" #: shared-bindings/aesio/aes.c msgid "Key must be 16, 24, or 32 bytes long" @@ -1720,7 +1725,7 @@ msgstr "Zeit für Vorgang abgelaufen" #: ports/raspberrypi/common-hal/mdns/Server.c msgid "Out of MDNS service slots" -msgstr "" +msgstr "Keine freien Slots für MDNS-Dienst mehr verfügbar" #: ports/espressif/common-hal/espidf/__init__.c msgid "Out of memory" @@ -1826,7 +1831,7 @@ msgstr "Polygone brauchen mindestens 3 Punkte" #: shared-bindings/_bleio/Adapter.c msgid "Prefix buffer must be on the heap" -msgstr "Der Präfix-Puffer muss sich auf dem Heap befinden" +msgstr "Präfix-Puffer muss sich auf dem Heap befinden" #: main.c msgid "Press any key to enter the REPL. Use CTRL-D to reload.\n" @@ -1874,7 +1879,7 @@ msgstr "RNG DeInit-Fehler" #: ports/stm/common-hal/os/__init__.c msgid "RNG Init Error" -msgstr "RNG Init-Fehler" +msgstr "RNG-Init-Fehler" #: ports/atmel-samd/common-hal/busio/UART.c ports/cxd56/common-hal/busio/UART.c #: ports/nrf/common-hal/busio/UART.c ports/stm/common-hal/busio/UART.c @@ -2015,7 +2020,7 @@ msgstr "SocketPool kann nur mit wifi.radio verwendet werden" #: shared-bindings/aesio/aes.c msgid "Source and destination buffers must be the same length" -msgstr "Quell- und Zielbuffer müssen gleich lang sein" +msgstr "Quell- und Zielpuffer müssen gleich lang sein" #: shared-bindings/paralleldisplay/ParallelBus.c msgid "Specify exactly one of data0 or data_pins" @@ -2035,7 +2040,7 @@ msgstr "Stereo rechts muss sich auf PWM-Kanal B befinden" #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Stopping AP is not supported." -msgstr "" +msgstr "Das Stoppen des AP wird nicht unterstützt." #: shared-bindings/alarm/time/TimeAlarm.c msgid "Supply one of monotonic_time or epoch_time" @@ -2052,6 +2057,8 @@ msgstr "Zeitüberschreitung beim Auslesen der Temperatur" #: supervisor/shared/safe_mode.c msgid "The `microcontroller` module was used to boot into safe mode." msgstr "" +"Das 'microcontroller'-Modul wurde benutzt, um in den Sichheitsmodus zu " +"booten." #: py/obj.c msgid "The above exception was the direct cause of the following exception:" @@ -2065,6 +2072,8 @@ msgstr "Die Länge von rgb_pins muss 6, 12, 18, 24 oder 30 betragen" #: supervisor/shared/safe_mode.c msgid "The power dipped. Make sure you are providing enough power." msgstr "" +"Die Spannung ist eingebrochen. Stelle sicher, dass genügend Leistung " +"verfügbar ist." #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -2073,7 +2082,7 @@ msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's channel count does not match the mixer's" -msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mixers überein" +msgstr "Die Kanalanzahl des Samples stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's sample rate does not match the mixer's" @@ -2081,12 +2090,11 @@ msgstr "Die Abtastrate der Probe stimmt nicht mit der des Mischers überein" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's signedness does not match the mixer's" -msgstr "" -"Die Art des Vorzeichens des Samples stimmt nicht mit dem des Mixers überein" +msgstr "Der Vorzeichentyp des Samples stimmt nicht mit dem des Mixers überein" #: supervisor/shared/safe_mode.c msgid "Third-party firmware fatal error." -msgstr "" +msgstr "Fataler Fehler bei Drittanbieter-Firmware." #: shared-module/imagecapture/ParallelImageCapture.c msgid "This microcontroller does not support continuous capture." @@ -2106,7 +2114,7 @@ msgstr "Die Kachelhöhe muss die Bitmaphöhe genau teilen" #: shared-bindings/displayio/TileGrid.c shared-module/displayio/TileGrid.c msgid "Tile index out of bounds" -msgstr "Kachel index außerhalb der Grenzen" +msgstr "Kachelindex außerhalb der Grenzen" #: shared-bindings/displayio/TileGrid.c msgid "Tile width must exactly divide bitmap width" @@ -2133,7 +2141,7 @@ msgstr "Zu viele Kanäle im sample." #: shared-module/displayio/__init__.c msgid "Too many display busses" -msgstr "Zu viele Display Busse" +msgstr "Zu viele Anzeigebusse" #: shared-module/displayio/__init__.c msgid "Too many displays" @@ -2169,7 +2177,7 @@ msgstr "UART-Initialisierung" #: ports/raspberrypi/common-hal/busio/UART.c msgid "UART peripheral in use" -msgstr "" +msgstr "UART-Endgerät in Benutzung" #: ports/stm/common-hal/busio/UART.c msgid "UART re-init" @@ -2220,12 +2228,12 @@ msgstr "Konnte keine Buffer für Vorzeichenumwandlung allozieren" #: supervisor/shared/safe_mode.c msgid "Unable to allocate the heap." -msgstr "" +msgstr "Keine Allokation auf dem Heap möglich." #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to configure ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht konfiguriert werden, Fehlercode: %d" #: ports/espressif/common-hal/busio/I2C.c msgid "Unable to create lock" @@ -2248,7 +2256,7 @@ msgstr "Parser konnte nicht gestartet werden" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to initialize ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht initialisiert werden, Fehlercode: %d" #: shared-module/displayio/OnDiskBitmap.c msgid "Unable to read color palette data" @@ -2257,7 +2265,7 @@ msgstr "Konnte Farbpalettendaten nicht lesen" #: ports/espressif/common-hal/analogbufio/BufferedIn.c #, c-format msgid "Unable to start ADC DMA controller, ErrorCode:%d" -msgstr "" +msgstr "ADC-DMA-Controller konnte nicht gestartet werden, Fehlercode: %d" #: ports/espressif/common-hal/mdns/Server.c #: ports/raspberrypi/common-hal/mdns/Server.c @@ -2298,7 +2306,7 @@ msgstr "Unbekannter BLE-Fehler: %d" #: ports/raspberrypi/common-hal/wifi/__init__.c #, c-format msgid "Unknown error code %d" -msgstr "" +msgstr "Unbekannter Fehlercode %d" #: shared-bindings/wifi/Radio.c #, c-format @@ -2376,7 +2384,7 @@ msgstr "Update fehlgeschlagen" #: ports/nrf/common-hal/_bleio/Characteristic.c #: ports/nrf/common-hal/_bleio/Descriptor.c msgid "Value length != required fixed length" -msgstr "Wert Länge != Erforderliche feste Länge" +msgstr "Länge des Wertes != Erforderliche feste Länge" #: ports/espressif/common-hal/_bleio/Characteristic.c #: ports/espressif/common-hal/_bleio/Descriptor.c @@ -2437,11 +2445,11 @@ msgstr "Wi-Fi: " #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in access point mode." -msgstr "" +msgstr "Das Wifi ist im Accesspoint-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is in station mode." -msgstr "" +msgstr "Das Wifi ist im Station-Modus." #: ports/raspberrypi/common-hal/wifi/Radio.c msgid "Wifi is not enabled" @@ -2454,59 +2462,59 @@ msgstr "Aufgeweckt durch Alarm.\n" #: ports/espressif/common-hal/_bleio/PacketBuffer.c #: ports/nrf/common-hal/_bleio/PacketBuffer.c msgid "Writes not supported on Characteristic" -msgstr "Schreiben nicht unterstüzt für diese Charakteristik" +msgstr "Schreiben für diese Charakteristik nicht unterstützt" #: ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h #: ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h #: ports/atmel-samd/boards/meowmeow/mpconfigboard.h msgid "You pressed both buttons at start up." -msgstr "" +msgstr "Beide Knöpfe wurden beim Starten gedrückt." #: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h #: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h #: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h msgid "You pressed button A at start up." -msgstr "" +msgstr "Knopf A wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the BOOT button at start up" -msgstr "" +msgstr "Der BOOT-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_huzzah32_breakout/mpconfigboard.h msgid "You pressed the GPIO0 button at start up." -msgstr "" +msgstr "Der GPIO0-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/espressif_esp32_lyrat/mpconfigboard.h msgid "You pressed the Rec button at start up." -msgstr "" +msgstr "Der Rec-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h msgid "You pressed the SW38 button at start up." -msgstr "" +msgstr "Der SW38-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/hardkernel_odroid_go/mpconfigboard.h msgid "You pressed the VOLUME button at start up." -msgstr "" +msgstr "Der VOLUME-Knopf wurde beim Starten gedrückt." #: ports/espressif/boards/m5stack_atom_echo/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_lite/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_matrix/mpconfigboard.h #: ports/espressif/boards/m5stack_atom_u/mpconfigboard.h msgid "You pressed the central button at start up." -msgstr "" +msgstr "Der zentrale Knopf wurde beim Starten gedrückt." #: ports/nrf/boards/aramcon2_badge/mpconfigboard.h msgid "You pressed the left button at start up." -msgstr "" +msgstr "Der linke Knopf wurde beim Starten gedrückt." #: supervisor/shared/safe_mode.c msgid "You pressed the reset button during boot." -msgstr "" +msgstr "Der Reset-Knopf wurde beim Booten gedrückt." #: supervisor/shared/micropython.c msgid "[truncated due to length]" -msgstr "" +msgstr "[abgeschnitten wegen der Länge]" #: py/objtype.c msgid "__init__() should return None" @@ -2579,7 +2587,7 @@ msgstr "Das Array hat zu viele Dimensionen" #: extmod/ulab/code/ndarray.c msgid "array is too big" -msgstr "" +msgstr "Array ist zu groß" #: py/objarray.c shared-bindings/alarm/SleepMemory.c #: shared-bindings/memorymap/AddressRange.c shared-bindings/nvm/ByteArray.c @@ -2794,8 +2802,8 @@ msgstr "kann keinen relativen Import durchführen" #: py/objgenerator.c msgid "can't send non-None value to a just-started generator" msgstr "" -"Nicht \"None\" Werte können nicht an einen gerade gestarteten Generator " -"gesendet werden" +"Nicht-None-Wert kann nicht an einen gerade gestarteten Generator gesendet " +"werden" #: shared-module/sdcardio/SDCard.c msgid "can't set 512 block size" @@ -2807,7 +2815,7 @@ msgstr "kann Attribut nicht setzen" #: py/runtime.c shared-bindings/supervisor/Runtime.c msgid "can't set attribute '%q'" -msgstr "" +msgstr "Attribut '%q' kann nicht gesetzt werden" #: py/emitnative.c msgid "can't store '%q'" @@ -2877,7 +2885,7 @@ msgstr "Kanal wird erneut initialisiert" #: shared-bindings/_stage/Text.c msgid "chars buffer too small" -msgstr "(char) Zeichenpuffer zu klein" +msgstr "Zeichenpuffer zu klein" #: py/modbuiltins.c msgid "chr() arg not in range(0x110000)" @@ -2943,7 +2951,7 @@ msgstr "Convolve-Argumente müssen ndarrays sein" #: extmod/ulab/code/numpy/filter.c msgid "convolve arguments must not be empty" -msgstr "Convolve Argumente dürfen nicht leer sein" +msgstr "Faltungsargumente dürfen nicht leer sein" #: extmod/ulab/code/numpy/io/io.c msgid "corrupted file" @@ -2994,8 +3002,8 @@ msgstr "default ist keine Funktion" msgid "" "destination buffer must be a bytearray or array of type 'B' for bit_depth = 8" msgstr "" -"Der Zielbuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = " -"8 sein" +"Zielpuffer muss ein Bytearray oder ein Array vom Typ 'B' für bit_depth = 8 " +"sein" #: shared-bindings/audiobusio/PDMIn.c msgid "destination buffer must be an array of type 'H' for bit_depth = 16" @@ -3055,7 +3063,7 @@ msgstr "leere Sequenz" #: py/objstr.c msgid "end of format while looking for conversion specifier" -msgstr "Ende des Formats wärend der Suche nach einem conversion specifier" +msgstr "Ende des Formats bei der Suche nach einem Konvertierungsspezifizierer" #: shared-bindings/alarm/time/TimeAlarm.c msgid "epoch_time not supported on this board" @@ -3071,6 +3079,8 @@ msgid "" "espcamera.Camera requires reserved PSRAM to be configured. See the " "documentation for instructions." msgstr "" +"espcamera.Camera benötigt reservierten PSRAM um konfiguriert zu werden. " +"Siehe Dokumentation für Anweisungen." #: py/runtime.c msgid "exceptions must derive from BaseException" @@ -3290,7 +3300,7 @@ msgstr "Index ist außerhalb der Grenzen" #: shared-bindings/_pixelmap/PixelMap.c msgid "index must be tuple or int" -msgstr "" +msgstr "Index muss tuple oder int sein" #: extmod/ulab/code/numpy/numerical.c extmod/ulab/code/ulab_tools.c #: ports/espressif/common-hal/pulseio/PulseIn.c @@ -3482,7 +3492,7 @@ msgstr "issubclass() arg 2 muss eine Klasse oder ein Tupel von Klassen sein" #: extmod/ulab/code/numpy/linalg/linalg.c msgid "iterations did not converge" -msgstr "Iterationen sind nicht konvergiert (converged)" +msgstr "Iterationen sind nicht konvergiert" #: py/objstr.c msgid "join expects a list of str/bytes objects consistent with self object" @@ -3550,7 +3560,7 @@ msgstr "mDNS funktioniert nur mit integriertem WiFi" #: py/parse.c msgid "malformed f-string" -msgstr "fehlformatierter f-string" +msgstr "fehlerhafter F-String" #: shared-bindings/_stage/Layer.c msgid "map buffer too small" @@ -3634,7 +3644,7 @@ msgstr "Mehrfache Vererbung nicht unterstützt" #: py/emitnative.c msgid "must raise an object" -msgstr "muss ein Objekt verursachen (raise)" +msgstr "muss ein Objekt aufwerfen (raise)" #: py/modbuiltins.c msgid "must use keyword argument for key function" @@ -3654,7 +3664,7 @@ msgstr "native Methode zu groß" #: py/emitnative.c msgid "native yield" -msgstr "native Ausbeute (yield)" +msgstr "natives yield" #: py/runtime.c #, c-format @@ -3667,15 +3677,15 @@ msgstr "negative Fakultät" #: py/objint_longlong.c py/objint_mpz.c py/runtime.c msgid "negative power with no float support" -msgstr "negative Potenz ohne Gleitkomma (float) Unterstützung" +msgstr "negative Potenz ohne Gleitkomma(float)-Unterstützung" #: py/objint_mpz.c py/runtime.c msgid "negative shift count" -msgstr "Negative shift Anzahl" +msgstr "Negative Anzahl an Verschiebungen" #: shared-bindings/_pixelmap/PixelMap.c msgid "nested index must be int" -msgstr "" +msgstr "verschachtelter Index muss int sein" #: shared-module/sdcardio/SDCard.c msgid "no SD card" @@ -3683,11 +3693,11 @@ msgstr "keine SD-Karte" #: py/vm.c msgid "no active exception to reraise" -msgstr "Keine aktive Ausnahme zu verusachen (raise)" +msgstr "Keine aktive Ausnahme zum Wiederaufwerfen (reraise)" #: py/compile.c msgid "no binding for nonlocal found" -msgstr "Kein Binding für nonlocal gefunden" +msgstr "Keine Bindung für nichtlokale Variable gefunden" #: shared-module/msgpack/__init__.c msgid "no default packer" @@ -3717,7 +3727,7 @@ msgstr "kein solches Attribut" #: ports/espressif/common-hal/_bleio/Connection.c #: ports/nrf/common-hal/_bleio/Connection.c msgid "non-UUID found in service_uuids_whitelist" -msgstr "non-UUID gefunden in service_uuids_whitelist" +msgstr "Nicht-UUID in service_uuids_whitelist gefunden" #: py/compile.c msgid "non-default argument follows default argument" @@ -3733,7 +3743,7 @@ msgstr "Nicht-Schlüsselwort arg nach * / **" #: py/compile.c msgid "non-keyword arg after keyword arg" -msgstr "Nicht-Schlüsselwort Argument nach Schlüsselwort Argument" +msgstr "Nicht-Schlüsselwort-Argument nach Schlüsselwort-Argument" #: ports/nrf/common-hal/_bleio/Adapter.c msgid "non-zero timeout must be > 0.01" @@ -3750,11 +3760,12 @@ msgstr "keine 128-bit UUID" #: py/objstr.c msgid "not all arguments converted during string formatting" msgstr "" -"Nicht alle Argumente wurden während der Formatierung des Strings konvertiert" +"Nicht alle Argumente wurden während der Formatierung der Zeichenfolge " +"konvertiert" #: py/objstr.c msgid "not enough arguments for format string" -msgstr "Nicht genügend Argumente für den Formatierungs-String" +msgstr "Nicht genügend Argumente für die Formatzeichenfolge" #: extmod/ulab/code/numpy/carray/carray_tools.c msgid "not implemented for complex dtype" @@ -3850,11 +3861,11 @@ msgstr "nur Mono wird unterstützt" #: extmod/ulab/code/numpy/create.c msgid "only ndarrays can be concatenated" -msgstr "" +msgstr "nur ndarrays können aneinandergehängt werden" #: ports/stm/common-hal/audiobusio/PDMIn.c msgid "only oversample=64 is supported" -msgstr "" +msgstr "nur oversample=64 wird unterstützt" #: ports/nrf/common-hal/audiobusio/PDMIn.c #: ports/stm/common-hal/audiobusio/PDMIn.c @@ -3891,7 +3902,7 @@ msgstr "Operation wird nur für boolesche 1D-Arrays implementiert" #: extmod/ulab/code/numpy/numerical.c msgid "operation is not implemented on ndarrays" -msgstr "Die Operation ist für ndarrays nicht implementiert" +msgstr "Operation ist auf ndarrays nicht implementiert" #: extmod/ulab/code/ndarray.c msgid "operation is not supported for given type" @@ -3943,7 +3954,7 @@ msgstr "Die Parameter müssen Register der Reihenfolge a2 bis a5 sein" #: py/emitinlinethumb.c msgid "parameters must be registers in sequence r0 to r3" -msgstr "Die Parameter müssen Register der Reihenfolge r0 bis r3 sein" +msgstr "Parameter müssen Register im Bereich von r0 bis r3 sein" #: shared-bindings/bitmaptools/__init__.c shared-bindings/displayio/Bitmap.c msgid "pixel coordinates out of bounds" @@ -3984,7 +3995,7 @@ msgstr "pow() drittes Argument darf nicht 0 sein" #: py/objint_mpz.c msgid "pow() with 3 arguments requires integers" -msgstr "pow() mit 3 Argumenten erfordert Integer" +msgstr "pow() mit 3 Argumenten erfordert ganze Zahlen" #: ports/raspberrypi/common-hal/rp2pio/StateMachine.c msgid "pull masks conflict with direction masks" @@ -4016,7 +4027,7 @@ msgstr "Rückgabewert-Beschreibung muss ein Identifier sein" #: py/emitnative.c msgid "return expected '%q' but got '%q'" -msgstr "Rückgabe erwartet '%q', aber '%q' erhalten" +msgstr "Rückgabe (return) erwartet '%q', hat aber '%q' erhalten" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format @@ -4026,7 +4037,7 @@ msgstr "rgb_pins[%d] dupliziert eine andere Pinbelegung" #: shared-bindings/rgbmatrix/RGBMatrix.c #, c-format msgid "rgb_pins[%d] is not on the same port as clock" -msgstr "rgb_pins [%d] befindet sich nicht am selben Port wie clock" +msgstr "rgb_pins[%d] befindet sich nicht am selben Port wie clock" #: extmod/ulab/code/numpy/numerical.c msgid "roll argument must be an ndarray" @@ -4063,7 +4074,7 @@ msgstr "kurze Lektüre" #: py/objstr.c msgid "sign not allowed in string format specifier" -msgstr "Vorzeichen nicht erlaubt in einem String formatierungs specifier" +msgstr "Vorzeichen im Zeichenfolgenformatbezeichner nicht zulässig" #: py/objstr.c msgid "sign not allowed with integer format specifier 'c'" @@ -4095,7 +4106,7 @@ msgstr "weicher reboot\n" #: extmod/ulab/code/numpy/numerical.c msgid "sort argument must be an ndarray" -msgstr "sortierungs Argument muss ein ndarray sein" +msgstr "Sortierungsargument muss ein ndarray sein" #: extmod/ulab/code/scipy/signal/signal.c msgid "sos array must be of shape (n_section, 6)" @@ -4215,7 +4226,7 @@ msgstr "zu viele Lokale für die native Methode" #: py/runtime.c #, c-format msgid "too many values to unpack (expected %d)" -msgstr "zu viele Werte zum Auspacken (erwartet %d)" +msgstr "zu viele Werte zum Auspacken (%d erwartet)" #: extmod/ulab/code/numpy/approx.c msgid "trapz is defined for 1D arrays of equal length" @@ -4249,7 +4260,7 @@ msgstr "Typ ist kein akzeptierter Basis-Typ" #: py/objgenerator.c py/runtime.c msgid "type object '%q' has no attribute '%q'" -msgstr "Typ vom Objekt '%q' hat kein Attribut '%q'" +msgstr "Typ-Objekt '%q' hat kein Attribut '%q'" #: py/objtype.c msgid "type takes 1 or 3 arguments" @@ -4279,7 +4290,7 @@ msgstr "unerwartetes Schlüsselwort-Argument '%q'" #: py/lexer.c msgid "unicode name escapes" -msgstr "Unicode Name ausgebrochen (escaped)" +msgstr "Escaping von Unicode-Namen" #: py/parse.c msgid "unindent doesn't match any outer indent level" @@ -4288,7 +4299,7 @@ msgstr "unindent stimmt mit keiner äußeren Einrückungsebene überein" #: py/objstr.c #, c-format msgid "unknown conversion specifier %c" -msgstr "unbekannter Konvertierungs specifier %c" +msgstr "unbekannter Konvertierungsspezifizierer %c" #: py/objstr.c msgid "unknown format code '%c' for object of type '%q'" @@ -4305,7 +4316,7 @@ msgstr "unbekannter Typ '%q'" #: py/objstr.c #, c-format msgid "unmatched '%c' in format" -msgstr "" +msgstr "'%c' in Format konnte nicht zugeordnet werden" #: py/objtype.c py/runtime.c msgid "unreadable attribute" From 128a4f9697de2c86668f4f3087536feca29f088c Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Tue, 28 Mar 2023 16:18:27 +0200 Subject: [PATCH 28/30] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: CircuitPython/main Translate-URL: https://hosted.weblate.org/projects/circuitpython/main/ --- locale/ID.po | 8 ++++---- locale/cs.po | 11 +++++++---- locale/de_DE.po | 15 +++++++++------ locale/el.po | 13 ++++++++----- locale/en_GB.po | 11 +++++++---- locale/es.po | 11 +++++++---- locale/fil.po | 8 ++++---- locale/fr.po | 11 +++++++---- locale/hi.po | 8 ++++---- locale/it_IT.po | 11 +++++++---- locale/ja.po | 8 ++++---- locale/ko.po | 8 ++++---- locale/nl.po | 8 ++++---- locale/pl.po | 8 ++++---- locale/pt_BR.po | 11 +++++++---- locale/ru.po | 11 +++++++---- locale/sv.po | 11 +++++++---- locale/tr.po | 11 +++++++---- locale/zh_Latn_pinyin.po | 11 +++++++---- 19 files changed, 115 insertions(+), 79 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 0affac3ed4..21d3e4a4c2 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -403,10 +403,6 @@ msgstr "0.0 ke kompleks berpangkat" msgid "3-arg pow() not supported" msgstr "pow() 3-arg tidak didukung" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ukuran potongan format tidak valid" diff --git a/locale/cs.po b/locale/cs.po index 7af7d489b1..a8d09ade34 100644 --- a/locale/cs.po +++ b/locale/cs.po @@ -404,10 +404,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "pow() nepodporuje 3 argumenty" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit typy" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Chybný data_pin[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Neplatná velikost bloku" @@ -4382,6 +4382,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit typy" + #~ msgid "No key was specified" #~ msgstr "Nebyl zadán klíč" diff --git a/locale/de_DE.po b/locale/de_DE.po index 98d4f651de..ab543ccea4 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -38,8 +38,8 @@ msgid "" "circuitpython/issues." msgstr "" "\n" -"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://github" -".com/adafruit/circuitpython/issues." +"Bitte erstellen Sie ein Problem (Issue) für Ihr Programm unter https://" +"github.com/adafruit/circuitpython/issues." #: supervisor/shared/safe_mode.c msgid "" @@ -414,10 +414,6 @@ msgstr "0.0 zu einer komplexen Potenz" msgid "3-arg pow() not supported" msgstr "3-arg pow() wird nicht unterstützt" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit-Typen" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1307,6 +1303,10 @@ msgstr "Ungültiges Byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ungültige data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ungültige format chunk size" @@ -4469,6 +4469,9 @@ msgstr "zi muss eine Gleitkommazahl sein" msgid "zi must be of shape (n_section, 2)" msgstr "zi muss die Form (n_section, 2) haben" +#~ msgid "64 bit types" +#~ msgstr "64 bit-Typen" + #~ msgid "No key was specified" #~ msgstr "Es wurde kein Schlüssel angegeben" diff --git a/locale/el.po b/locale/el.po index ab4b2d9b90..3336cbae67 100644 --- a/locale/el.po +++ b/locale/el.po @@ -408,11 +408,6 @@ msgstr "0.0 σε μία σύνθετη δύναμη" msgid "3-arg pow() not supported" msgstr "pow() με 3 παραμέτρους δεν υποστηρίζεται" -#: shared-module/msgpack/__init__.c -#, fuzzy -msgid "64 bit types" -msgstr "64 bit τύποι" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1292,6 +1287,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -4390,6 +4389,10 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#, fuzzy +#~ msgid "64 bit types" +#~ msgstr "64 bit τύποι" + #~ msgid "%q pin invalid" #~ msgstr "%q άκυρο pin" diff --git a/locale/en_GB.po b/locale/en_GB.po index e2d9cd9f13..9c26f47d45 100644 --- a/locale/en_GB.po +++ b/locale/en_GB.po @@ -407,10 +407,6 @@ msgstr "0.0 to a complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() not supported" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit types" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1284,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Invalid data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Invalid format chunk size" @@ -4393,6 +4393,9 @@ msgstr "zi must be of float type" msgid "zi must be of shape (n_section, 2)" msgstr "zi must be of shape (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64 bit types" + #~ msgid "No key was specified" #~ msgstr "No key was specified" diff --git a/locale/es.po b/locale/es.po index 9578e4048a..d5db9c0c88 100644 --- a/locale/es.po +++ b/locale/es.po @@ -415,10 +415,6 @@ msgstr "0.0 a una potencia compleja" msgid "3-arg pow() not supported" msgstr "pow() con 3 argumentos no soportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "tipos de 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1317,6 +1313,10 @@ msgstr "byte %.*s Inválido" msgid "Invalid data_pins[%d]" msgstr "Inválidos los data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Formato de fragmento de formato no válido" @@ -4466,6 +4466,9 @@ msgstr "zi debe ser de tipo flotante" msgid "zi must be of shape (n_section, 2)" msgstr "zi debe ser una forma (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "tipos de 64 bit" + #~ msgid "No key was specified" #~ msgstr "No se especificó ninguna llave" diff --git a/locale/fil.po b/locale/fil.po index 86677af69b..f83cfb1173 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -402,10 +402,6 @@ msgstr "0.0 para sa complex power" msgid "3-arg pow() not supported" msgstr "3-arg pow() hindi suportado" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1283,6 +1279,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Mali ang format ng chunk size" diff --git a/locale/fr.po b/locale/fr.po index 812f09b454..e536cbd346 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -412,10 +412,6 @@ msgstr "0.0 à une puissance complexe" msgid "3-arg pow() not supported" msgstr "pow() non supporté avec 3 paramètres" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "types à 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1323,6 +1319,10 @@ msgstr "Octet invalide %.*s" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] invalide" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Taille de bloc de formatage invalide" @@ -4485,6 +4485,9 @@ msgstr "zi doit être de type float" msgid "zi must be of shape (n_section, 2)" msgstr "zi doit être de forme (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "types à 64 bit" + #~ msgid "No key was specified" #~ msgstr "Aucune clé n'a été spécifiée" diff --git a/locale/hi.po b/locale/hi.po index 75efddc294..977cd4986a 100644 --- a/locale/hi.po +++ b/locale/hi.po @@ -400,10 +400,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1271,6 +1267,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" diff --git a/locale/it_IT.po b/locale/it_IT.po index e8d32b163e..b4e998f698 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -405,10 +405,6 @@ msgstr "0.0 elevato alla potenza di un numero complesso" msgid "3-arg pow() not supported" msgstr "pow() con tre argmomenti non supportata" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipo 64 bits" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1285,6 +1281,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "" @@ -4415,6 +4415,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "Tipo 64 bits" + #~ msgid "too many arguments provided with the given format" #~ msgstr "troppi argomenti forniti con il formato specificato" diff --git a/locale/ja.po b/locale/ja.po index f90abd66da..ab8ca26d28 100644 --- a/locale/ja.po +++ b/locale/ja.po @@ -407,10 +407,6 @@ msgstr "0.0を複素数でべき乗" msgid "3-arg pow() not supported" msgstr "引数3つのpow()は非対応" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1284,6 +1280,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "フォーマットチャンクのサイズが不正" diff --git a/locale/ko.po b/locale/ko.po index fbb45ed195..21b5cdecd6 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -401,10 +401,6 @@ msgstr "" msgid "3-arg pow() not supported" msgstr "" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1274,6 +1270,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "형식 청크 크기가 잘못되었습니다" diff --git a/locale/nl.po b/locale/nl.po index f9faf2a6a5..50a0ab6d99 100644 --- a/locale/nl.po +++ b/locale/nl.po @@ -400,10 +400,6 @@ msgstr "0.0 tot een complexe macht" msgid "3-arg pow() not supported" msgstr "3-arg pow() niet ondersteund" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1279,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ongeldig formaat stuk grootte" diff --git a/locale/pl.po b/locale/pl.po index 4fc4337a55..e873e45a51 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -402,10 +402,6 @@ msgstr "0.0 do potęgi zespolonej" msgid "3-arg pow() not supported" msgstr "3-argumentowy pow() jest niewspierany" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1279,6 +1275,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Zła wielkość fragmentu formatu" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index a684aacfb1..6968cfbb84 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -417,10 +417,6 @@ msgstr "0,0 para uma potência complexa" msgid "3-arg pow() not supported" msgstr "3-arg pow() não compatível" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "Tipos 64 bit" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1313,6 +1309,10 @@ msgstr "Byte %.*s inválido" msgid "Invalid data_pins[%d]" msgstr "data_pins[%d] inválido" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Tamanho do pedaço de formato inválido" @@ -4466,6 +4466,9 @@ msgstr "zi deve ser de um tipo float" msgid "zi must be of shape (n_section, 2)" msgstr "zi deve estar na forma (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "Tipos 64 bit" + #~ msgid "No key was specified" #~ msgstr "Nenhuma chave foi definida" diff --git a/locale/ru.po b/locale/ru.po index c2e6ccc265..e2c1eae4f1 100644 --- a/locale/ru.po +++ b/locale/ru.po @@ -407,10 +407,6 @@ msgstr "0.0 в комплексную степень" msgid "3-arg pow() not supported" msgstr "3-аргументный pow() не поддерживается" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-битные типы" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1316,6 +1312,10 @@ msgstr "Неверный байт %.*s" msgid "Invalid data_pins[%d]" msgstr "Неверный data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Неверный размер блока формата" @@ -4430,6 +4430,9 @@ msgstr "zi должно быть типа float" msgid "zi must be of shape (n_section, 2)" msgstr "zi должен иметь форму (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-битные типы" + #~ msgid "No key was specified" #~ msgstr "Ключ не был указан" diff --git a/locale/sv.po b/locale/sv.po index bbbe1ad4fb..1cef8c6d7a 100644 --- a/locale/sv.po +++ b/locale/sv.po @@ -414,10 +414,6 @@ msgstr "0,0 till ett komplext nummer" msgid "3-arg pow() not supported" msgstr "3-arguments pow() stöds inte" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64-bitars typer" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1298,6 +1294,10 @@ msgstr "Ogiltig byte %.*s" msgid "Invalid data_pins[%d]" msgstr "Ogiltig data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Ogiltig formatsegmentstorlek" @@ -4428,6 +4428,9 @@ msgstr "zi måste vara av typ float" msgid "zi must be of shape (n_section, 2)" msgstr "zi måste vara i formen (n_section, 2)" +#~ msgid "64 bit types" +#~ msgstr "64-bitars typer" + #~ msgid "No key was specified" #~ msgstr "Ingen nyckel angavs" diff --git a/locale/tr.po b/locale/tr.po index 62c5fc9dc2..f785cff4fc 100644 --- a/locale/tr.po +++ b/locale/tr.po @@ -409,10 +409,6 @@ msgstr "0.0'dan bir karmaşık güce" msgid "3-arg pow() not supported" msgstr "3-argümanlı pow() desteklenmemektedir" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 bit tipler" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1290,6 +1286,10 @@ msgstr "" msgid "Invalid data_pins[%d]" msgstr "Geçersiz veri_pini [%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Geçersiz biçim yığın boyutu" @@ -4389,6 +4389,9 @@ msgstr "" msgid "zi must be of shape (n_section, 2)" msgstr "" +#~ msgid "64 bit types" +#~ msgstr "64 bit tipler" + #~ msgid "%q pin invalid" #~ msgstr "%q pini geçersiz" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 98876f3cdb..2246687ef3 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -416,10 +416,6 @@ msgstr "0.0 de fùshù cì mì" msgid "3-arg pow() not supported" msgstr "bù zhī chí 3-arg pow()" -#: shared-module/msgpack/__init__.c -msgid "64 bit types" -msgstr "64 wèi lèixíng" - #: ports/atmel-samd/common-hal/alarm/pin/PinAlarm.c #: ports/atmel-samd/common-hal/countio/Counter.c #: ports/atmel-samd/common-hal/rotaryio/IncrementalEncoder.c @@ -1305,6 +1301,10 @@ msgstr "wú xiào zì jié %.*s" msgid "Invalid data_pins[%d]" msgstr "wú xiào data_pins[%d]" +#: shared-module/msgpack/__init__.c +msgid "Invalid format" +msgstr "" + #: shared-module/audiocore/WaveFile.c msgid "Invalid format chunk size" msgstr "Géshì kuài dàxiǎo wúxiào" @@ -4434,6 +4434,9 @@ msgstr "zi bìxū wèi fú diǎn xíng" msgid "zi must be of shape (n_section, 2)" msgstr "zi bìxū jùyǒu xíngzhuàng (n_section,2)" +#~ msgid "64 bit types" +#~ msgstr "64 wèi lèixíng" + #~ msgid "No key was specified" #~ msgstr "Wèi zhǐdìng mì yào" From cb5e1a1e981a970744d0a53626addfb608c9091d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 28 Mar 2023 09:20:54 -0500 Subject: [PATCH 29/30] mimxrt: Fix output frequency for samples that don't divide 192kHz This makes all the samples from Dan's collection register as 440Hz when playing on pwmio or i2sout, using https://webaudiodemos.appspot.com/pitchdetect/index.html to detect the frequency played (all should show as A 440Hz; an error of up to 20 "cents" should be treated as OK) There's an audible carrier with PWM output and the 8kHz samples. This is probably a limitation of the peripheral which is documented as being for input signals of 44 kHz or 48 kHz; the carrier frequency is a fixed multiple of the sample frequency. Closes #7800 --- .../common-hal/audiobusio/__init__.c | 59 +++++++++++++++++-- shared-bindings/audiopwmio/PWMAudioOut.c | 4 ++ 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c index 515c39a268..13ae64d27c 100644 --- a/ports/mimxrt10xx/common-hal/audiobusio/__init__.c +++ b/ports/mimxrt10xx/common-hal/audiobusio/__init__.c @@ -42,18 +42,23 @@ /* * AUDIO PLL setting: Frequency = Fref * (DIV_SELECT + NUM / DENOM) - * = 24 * (32 + 77/100) - * = 786.48 MHz + * = 24 * (32 + 96 / 125) = 24 * (32.768) + * = 786.432 MHz = 48kHz * 16384 + * + * This default clocking is used during initial configuration; it also works well for + * frequencies that evenly divide 192kHz, such as 8/12/24/48kHz. However, it doesn't work + * well for 44.1/22/11kHz, so there's the possibility of using a different + * setting when playing a particular sample. */ const clock_audio_pll_config_t audioPllConfig = { .loopDivider = 32, /* PLL loop divider. Valid range for DIV_SELECT divider value: 27~54. */ .postDivider = 1, /* Divider after the PLL, should only be 1, 2, 4, 8, 16. */ - .numerator = 77, /* 30 bit numerator of fractional loop divider. */ - .denominator = 100, /* 30 bit denominator of fractional loop divider */ + .numerator = 96, /* 30 bit numerator of fractional loop divider. */ + .denominator = 125, /* 30 bit denominator of fractional loop divider */ }; static I2S_Type *const i2s_instances[] = I2S_BASE_PTRS; -static uint8_t i2s_in_use; +static uint8_t i2s_in_use, i2s_playing; static I2S_Type *SAI_GetPeripheral(int idx) { if (idx < 0 || idx >= (int)MP_ARRAY_SIZE(i2s_instances)) { @@ -344,7 +349,11 @@ void port_i2s_deinit(i2s_t *self) { } SAI_TransferAbortSend(self->peripheral, &self->handle); i2s_clock_off(self->peripheral); - i2s_in_use &= ~(1 << SAI_GetInstance(self->peripheral)); + + uint32_t instance_mask = 1 << SAI_GetInstance(self->peripheral); + i2s_in_use &= ~instance_mask; + i2s_playing &= ~instance_mask; + if (!i2s_in_use) { CCM_ANALOG->PLL_AUDIO = CCM_ANALOG_PLL_AUDIO_BYPASS_MASK | CCM_ANALOG_PLL_AUDIO_POWERDOWN_MASK | CCM_ANALOG_PLL_AUDIO_BYPASS_CLK_SRC(kCLOCK_PllClkSrc24M); } @@ -354,13 +363,51 @@ void port_i2s_deinit(i2s_t *self) { } } +static uint32_t gcd(uint32_t a, uint32_t b) { + while (b) { + uint32_t tmp = a % b; + a = b; + b = tmp; + } + return a; +} + +static void set_sai_clocking_for_sample_rate(uint32_t sample_rate) { + mp_arg_validate_int_range((mp_uint_t)sample_rate, 4000, 192000, MP_QSTR_sample_rate); + + uint32_t target_rate = sample_rate; + // ensure the PWM rate of MQS will be adequately high + while (target_rate < 175000) { + target_rate <<= 1; + } + target_rate *= 4096; // various prescalers divide by this much + uint32_t div = gcd(target_rate % 24000000, 24000000); + clock_audio_pll_config_t config = { + .loopDivider = target_rate / 24000000, + .postDivider = 1, + .numerator = (target_rate % 24000000) / div, + .denominator = 24000000 / div, + }; + CLOCK_InitAudioPll(&config); +} + void port_i2s_play(i2s_t *self, mp_obj_t sample, bool loop) { self->sample = sample; self->loop = loop; self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; self->channel_count = audiosample_channel_count(sample); + int instance = SAI_GetInstance(self->peripheral); + i2s_playing |= (1 << instance); uint32_t sample_rate = audiosample_sample_rate(sample); if (sample_rate != self->sample_rate) { + if (__builtin_popcount(i2s_playing) <= 1) { + // as this is the first/only i2s instance playing audio, we can + // safely change the overall clock used by the SAI peripheral, to + // get more accurate frequency reproduction. If another i2s + // instance is playing, then we can't touch the audio PLL and have + // to live with what we can get, which may be inaccurate + set_sai_clocking_for_sample_rate(sample_rate); + } SAI_TxSetBitClockRate(self->peripheral, SAI_CLOCK_FREQ, sample_rate, 16, 2); self->sample_rate = sample_rate; } diff --git a/shared-bindings/audiopwmio/PWMAudioOut.c b/shared-bindings/audiopwmio/PWMAudioOut.c index 56c6412bc6..f05fbfdfe9 100644 --- a/shared-bindings/audiopwmio/PWMAudioOut.c +++ b/shared-bindings/audiopwmio/PWMAudioOut.c @@ -56,6 +56,10 @@ //| :param int quiescent_value: The output value when no signal is present. Samples should start //| and end with this value to prevent audible popping. //| +//| **Limitations:** On mimxrt10xx, low sample rates may have an audible +//| "carrier" frequency. The manufacturer datasheet states that the "MQS" peripheral +//| is intended for 44 kHz or 48kHz input signals. +//| //| Simple 8ksps 440 Hz sin wave:: //| //| import audiocore From 2a4383e633766e01c4c07149161def59c11a576e Mon Sep 17 00:00:00 2001 From: Kattni Rembor Date: Tue, 28 Mar 2023 15:23:19 -0400 Subject: [PATCH 30/30] Add Feather RP2040 RFM, update DVI. --- .../mpconfigboard.h | 2 +- .../boards/adafruit_feather_rp2040_dvi/pins.c | 32 ++++++----- .../adafruit_feather_rp2040_rfm/board.c | 29 ++++++++++ .../mpconfigboard.h | 14 +++++ .../mpconfigboard.mk | 9 +++ .../pico-sdk-configboard.h | 4 ++ .../boards/adafruit_feather_rp2040_rfm/pins.c | 57 +++++++++++++++++++ 7 files changed, 131 insertions(+), 16 deletions(-) create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h create mode 100644 ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h index 06cfaf37f6..55b69b4ad8 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/mpconfigboard.h @@ -1,7 +1,7 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 DVI" #define MICROPY_HW_MCU_NAME "rp2040" -#define MICROPY_HW_NEOPIXEL (&pin_GPIO16) +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) #define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) #define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c index 368f96b6fe..c8b4e3474f 100644 --- a/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_dvi/pins.c @@ -9,22 +9,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, - - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, - - { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, - - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, @@ -32,6 +17,23 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c new file mode 100644 index 0000000000..331653173e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/board.c @@ -0,0 +1,29 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2021 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h new file mode 100644 index 0000000000..fff88cc1fa --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.h @@ -0,0 +1,14 @@ +#define MICROPY_HW_BOARD_NAME "Adafruit Feather RP2040 RFM" +#define MICROPY_HW_MCU_NAME "rp2040" + +#define MICROPY_HW_NEOPIXEL (&pin_GPIO4) + +#define DEFAULT_I2C_BUS_SCL (&pin_GPIO3) +#define DEFAULT_I2C_BUS_SDA (&pin_GPIO2) + +#define DEFAULT_SPI_BUS_SCK (&pin_GPIO14) +#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO15) +#define DEFAULT_SPI_BUS_MISO (&pin_GPIO8) + +#define DEFAULT_UART_BUS_RX (&pin_GPIO1) +#define DEFAULT_UART_BUS_TX (&pin_GPIO0) diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk new file mode 100644 index 0000000000..161a2b5c2e --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/mpconfigboard.mk @@ -0,0 +1,9 @@ +USB_VID = 0x239A +USB_PID = 0x812E +USB_PRODUCT = "Feather RP2040 RFM" +USB_MANUFACTURER = "Adafruit" + +CHIP_VARIANT = RP2040 +CHIP_FAMILY = rp2 + +EXTERNAL_FLASH_DEVICES = "GD25Q64C,W25Q64JVxQ" diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h new file mode 100644 index 0000000000..a41131dd22 --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pico-sdk-configboard.h @@ -0,0 +1,4 @@ +// Put board-specific pico-sdk definitions here. This file must exist. + +// Allow extra time for xosc to start. +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 diff --git a/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c new file mode 100644 index 0000000000..71679fb53b --- /dev/null +++ b/ports/raspberrypi/boards/adafruit_feather_rp2040_rfm/pins.c @@ -0,0 +1,57 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO29) }, + { MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO24) }, + { MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO25) }, + + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO12) }, + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO1) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO1) }, + + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO0) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO0) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO14) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO15) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO8) }, + + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO2) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO3) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_BOOT), MP_ROM_PTR(&pin_GPIO7) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) }, + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO13) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO4) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) }, + + { MP_ROM_QSTR(MP_QSTR_RFM_CS), MP_ROM_PTR(&pin_GPIO16) }, + { MP_ROM_QSTR(MP_QSTR_RFM_RST), MP_ROM_PTR(&pin_GPIO17) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO5), MP_ROM_PTR(&pin_GPIO18) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO3), MP_ROM_PTR(&pin_GPIO19) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO4), MP_ROM_PTR(&pin_GPIO20) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO0), MP_ROM_PTR(&pin_GPIO21) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO1), MP_ROM_PTR(&pin_GPIO22) }, + { MP_ROM_QSTR(MP_QSTR_RFM_IO2), MP_ROM_PTR(&pin_GPIO23) }, + + { 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_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);