Merge branch 'main' into nodemcu_esp32c2

This commit is contained in:
Bill Sideris 2024-06-05 21:38:44 +03:00
commit 2af48f2e65
No known key found for this signature in database
GPG key ID: 1BEF1BCEBA58EA33
84 changed files with 647 additions and 95 deletions

View file

@ -1,4 +1,4 @@
name: Custom board build
name: Build board (custom)
on:
workflow_dispatch:
@ -21,6 +21,11 @@ on:
description: 'Flags: Build flags (e.g. CIRCUITPY_WIFI=1)'
required: false
type: string
branch:
description: 'Branch (only if Version="latest")'
required: false
default: 'main'
type: string
debug:
description: 'Make a debug build'
required: false
@ -36,7 +41,22 @@ jobs:
- name: Set up repository
run: |
git clone --filter=tree:0 https://github.com/adafruit/circuitpython.git $GITHUB_WORKSPACE
- name: Checkout head / tag
run: |
git checkout ${{ inputs.version == 'latest' && 'HEAD' || inputs.version }}
- name: fork compatibility
if: github.repository_owner != 'adafruit'
run: |
git remote add fork https://github.com/${{github.repository}}.git
git fetch fork --filter=tree:0
- name: branch compatibility
if: inputs.branch != 'main' && inputs.version == 'latest' && github.repository_owner == 'adafruit'
run: |
git checkout ${{inputs.branch}}
- name: branch compatibility (fork)
if: inputs.branch != '' && inputs.version == 'latest' && github.repository_owner != 'adafruit'
run: |
git checkout -b fork-branch fork/${{inputs.branch}}
- name: Set up identifier
if: inputs.debug || inputs.flags != ''
run: |

View file

@ -33,7 +33,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gettext uncrustify
sudo apt-get install -y gettext
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
- name: Make patch

View file

@ -1181,6 +1181,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1173,6 +1173,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1193,6 +1193,7 @@ msgstr "Chyba přerušení."
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1204,6 +1204,7 @@ msgstr "Interrupt Fehler."
msgid "Interrupted by output function"
msgstr "Unterbrochen durch Ausgabefunktion"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1199,6 +1199,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1192,6 +1192,7 @@ msgstr "Interrupt error."
msgid "Interrupted by output function"
msgstr "Interrupted by output function"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1212,6 +1212,7 @@ msgstr "Error de interrupción."
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1183,6 +1183,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1221,6 +1221,7 @@ msgstr "Erreur d'interruption."
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1175,6 +1175,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1183,6 +1183,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1192,6 +1192,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1227,6 +1227,7 @@ msgstr "인터럽트 오류."
msgid "Interrupted by output function"
msgstr "출력 함수로 인해 종료되었다"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1178,6 +1178,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1197,6 +1197,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1208,6 +1208,7 @@ msgstr "Erro de interrupção."
msgid "Interrupted by output function"
msgstr "Interrompido pela função de saída"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1219,6 +1219,7 @@ msgstr "Прерванная ошибка."
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1200,6 +1200,7 @@ msgstr "Interrupt-fel."
msgid "Interrupted by output function"
msgstr "Avbruten av utgångsfunktion"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1188,6 +1188,7 @@ msgstr ""
msgid "Interrupted by output function"
msgstr ""
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -1206,6 +1206,7 @@ msgstr "zhōng duàn cuò wù."
msgid "Interrupted by output function"
msgstr "bèi shūchū gōngnéng zhōngduàn"
#: ports/espressif/common-hal/espulp/ULP.c
#: ports/mimxrt10xx/common-hal/audiobusio/__init__.c
#: ports/mimxrt10xx/common-hal/pwmio/PWMOut.c
#: ports/raspberrypi/bindings/picodvi/Framebuffer.c

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/busio/SPI.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80
#define HEIGHT 400

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
typedef struct {
const uint32_t *config_data;

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
fourwire_fourwire_obj_t board_display_obj;
digitalio_digitalinout_obj_t CTR_5V;
digitalio_digitalinout_obj_t CTR_3V3;
digitalio_digitalinout_obj_t USB_HOST_ENABLE;

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/busio/SPI.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -19,7 +19,8 @@
//| Raises an exception if another ULP has been instantiated. This
//| ensures that is is only used by one piece of code at a time.
//|
//| :param Architecture arch: The ulp arch"""
//| :param Architecture arch: The ulp arch.
//| """
//| ...
static mp_obj_t espulp_ulp_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {
enum { ARG_arch };
@ -70,21 +71,50 @@ static mp_obj_t espulp_ulp_obj___exit__(size_t n_args, const mp_obj_t *args) {
}
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espulp_ulp___exit___obj, 4, 4, espulp_ulp_obj___exit__);
//| def run(
//| self, program: ReadableBuffer, *, pins: Sequence[microcontroller.Pin] = ()
//| ) -> None:
//| """Loads the program into ULP memory and then runs the program. The given pins are
//| claimed and not reset until `halt()` is called.
//| def set_wakeup_period(self, period_index: int, period_us: int) -> None:
//| """Sets the wakeup period for the ULP.
//|
//| The program will continue to run even when the running Python is halted."""
//| :param int period_index: = 0..4. Up to 5 different wakeup periods can be stored
//| and used by the wakeup timer.
//| By default, the value stored in period index 0 is used.
//| :param int period_us: The wakeup period given in microseconds."""
//| ...
static mp_obj_t espulp_ulp_set_wakeup_period(mp_obj_t self_in, mp_obj_t period_index, mp_obj_t period_us) {
espulp_ulp_obj_t *self = MP_OBJ_TO_PTR(self_in);
check_for_deinit(self);
// period_index should be between 0 and 4 but bounds checking happens in esp-idf, so no need to do that here
common_hal_espulp_ulp_set_wakeup_period(self, mp_obj_get_int(period_index), mp_obj_get_int(period_us));
return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_3(espulp_ulp_set_wakeup_period_obj, espulp_ulp_set_wakeup_period);
//| def run(
//| self,
//| program: ReadableBuffer,
//| *,
//| entrypoint: int = 0,
//| pins: Sequence[microcontroller.Pin] = ()
//| ) -> None:
//| """Loads the program into ULP memory and then runs the program.
//|
//| The program will continue to run even Python is halted or in deep-sleep.
//|
//| :param ReadableBuffer program: the ULP binary.
//| :param int entrypoint: Specifies the offset (in bytes) of the first instruction
//| from the start of the program (Only used by FSM ULP).
//| :param Sequence[microcontroller.Pin] pins: Pins made available to the ULP.
//| The pins are claimed and not reset until `halt()` is called."""
//| ...
static mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
espulp_ulp_obj_t *self = MP_OBJ_TO_PTR(pos_args[0]);
check_for_deinit(self);
enum { ARG_program, ARG_pins };
enum { ARG_program, ARG_entrypoint, ARG_pins };
static const mp_arg_t allowed_args[] = {
{ MP_QSTR_program, MP_ARG_REQUIRED | MP_ARG_OBJ},
{ MP_QSTR_entrypoint, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0}},
{ MP_QSTR_pins, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_empty_tuple} },
};
@ -94,6 +124,8 @@ static mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t
mp_buffer_info_t bufinfo;
mp_get_buffer_raise(args[ARG_program].u_obj, &bufinfo, MP_BUFFER_READ);
mp_uint_t entrypoint = args[ARG_entrypoint].u_int;
mp_obj_t pins_in = args[ARG_pins].u_obj;
const size_t num_pins = (size_t)MP_OBJ_SMALL_INT_VALUE(mp_obj_len(pins_in));
@ -103,7 +135,9 @@ static mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t
for (mp_uint_t i = 0; i < num_pins; i++) {
mp_obj_t pin_obj = mp_obj_subscr(pins_in, MP_OBJ_NEW_SMALL_INT(i), MP_OBJ_SENTINEL);
validate_obj_is_free_pin(pin_obj, MP_QSTR_pin);
// common-hal checks that pin is free (that way a possible "ULP already running" error
// is triggered before a possible "Pin in use" error, if ulp.run is called twice with the same pins).
validate_obj_is_pin(pin_obj, MP_QSTR_pin);
const mcu_pin_obj_t *pin = ((const mcu_pin_obj_t *)pin_obj);
if (pin->number >= 32) {
raise_ValueError_invalid_pin();
@ -111,13 +145,15 @@ static mp_obj_t espulp_ulp_run(size_t n_args, const mp_obj_t *pos_args, mp_map_t
pin_mask |= 1 << pin->number;
}
common_hal_espulp_ulp_run(self, bufinfo.buf, bufinfo.len, pin_mask);
common_hal_espulp_ulp_run(self, bufinfo.buf, bufinfo.len, entrypoint, pin_mask);
return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_KW(espulp_ulp_run_obj, 2, espulp_ulp_run);
//| def halt(self) -> None:
//| """Halts the running program and releases the pins given in `run()`."""
//| """Halts the running program and releases the pins given in `run()`.
//| Note: for the FSM ULP, a running ULP program is not actually interrupted.
//| Instead, only the wakeup timer is stopped."""
//| ...
static mp_obj_t espulp_ulp_halt(mp_obj_t self_in) {
espulp_ulp_obj_t *self = MP_OBJ_TO_PTR(self_in);
@ -143,12 +179,13 @@ MP_PROPERTY_GETTER(espulp_ulp_arch_obj,
(mp_obj_t)&espulp_ulp_get_arch_obj);
static const mp_rom_map_elem_t espulp_ulp_locals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&espulp_ulp_deinit_obj) },
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&mp_identity_obj) },
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&espulp_ulp___exit___obj) },
{ MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&espulp_ulp_run_obj) },
{ MP_ROM_QSTR(MP_QSTR_halt), MP_ROM_PTR(&espulp_ulp_halt_obj) },
{ MP_ROM_QSTR(MP_QSTR_arch), MP_ROM_PTR(&espulp_ulp_arch_obj) },
{ MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&espulp_ulp_deinit_obj) },
{ MP_ROM_QSTR(MP_QSTR___enter__), MP_ROM_PTR(&mp_identity_obj) },
{ MP_ROM_QSTR(MP_QSTR___exit__), MP_ROM_PTR(&espulp_ulp___exit___obj) },
{ MP_ROM_QSTR(MP_QSTR_set_wakeup_period), MP_ROM_PTR(&espulp_ulp_set_wakeup_period_obj) },
{ MP_ROM_QSTR(MP_QSTR_run), MP_ROM_PTR(&espulp_ulp_run_obj) },
{ MP_ROM_QSTR(MP_QSTR_halt), MP_ROM_PTR(&espulp_ulp_halt_obj) },
{ MP_ROM_QSTR(MP_QSTR_arch), MP_ROM_PTR(&espulp_ulp_arch_obj) },
};
static MP_DEFINE_CONST_DICT(espulp_ulp_locals_dict, espulp_ulp_locals_table);

View file

@ -15,5 +15,6 @@ void common_hal_espulp_ulp_construct(espulp_ulp_obj_t *self, espulp_architecture
bool common_hal_espulp_ulp_deinited(espulp_ulp_obj_t *self);
void common_hal_espulp_ulp_deinit(espulp_ulp_obj_t *self);
void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t pin_mask);
void common_hal_espulp_ulp_set_wakeup_period(espulp_ulp_obj_t *self, size_t period_index, uint32_t period_us);
void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t entry_point, uint32_t pin_mask);
void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self);

View file

@ -18,7 +18,6 @@
#include "esp_err.h"
#include "driver/i2c.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -11,54 +11,71 @@ static const mp_rom_map_elem_t board_module_globals_table[] = {
// External pins are in silkscreen order, from top to bottom, left side, then right side
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_IO2), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_IO21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_IO22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_IO23), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_BUTTON), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO23) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9) },
// Right side
{ MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_IO15), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_IO0), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO7) },
// These two are shared with the left side!
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_IO19), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_I2C_POWER), MP_ROM_PTR(&pin_GPIO20) },

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -15,7 +15,6 @@
#include "esp_log.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -22,7 +22,6 @@
#include "py/ringbuf.h"
#include "shared/runtime/interrupt_char.h"
fourwire_fourwire_obj_t board_display_obj;
keypad_demux_demuxkeymatrix_obj_t board_keyboard;
void update_keyboard(keypad_eventqueue_obj_t *queue);

View file

@ -21,7 +21,6 @@
#include "../../pmic/axp192/axp192.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80
#define PMIC_POWER_SOURCE_USB 0

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
// display init sequence according to M5Gfx

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
// display init sequence according to M5Gfx

View file

@ -14,7 +14,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80
#define AXP2101_I2C_ADDRESS 0x34

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
uint8_t display_init_sequence[] = {
0xFE, 0x00, // Inter Register Enable1 (FEh)

View file

@ -0,0 +1,10 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "supervisor/board.h"
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

View file

@ -0,0 +1,29 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
// Micropython setup
#define MICROPY_HW_BOARD_NAME "ThingPulse Pendrive S3"
#define MICROPY_HW_MCU_NAME "ESP32S3"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO5)
#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)

View file

@ -0,0 +1,19 @@
USB_VID = 0x303A
USB_PID = 0x8204
USB_PRODUCT = "ThingPulse Pendrive S3"
USB_MANUFACTURER = "ThingPulse"
IDF_TARGET = esp32s3
CIRCUITPY_ESP_FLASH_SIZE = 4MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_PSRAM_SIZE = 2MB
CIRCUITPY_ESP_PSRAM_MODE = qio
CIRCUITPY_ESP_PSRAM_FREQ = 80m
CIRCUITPY_ESPCAMERA = 0
CIRCUITPY_DISPLAYIO = 1
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View file

@ -0,0 +1,42 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#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_D1), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_TouchIn), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_D33), MP_ROM_PTR(&pin_GPIO33) },
{ MP_ROM_QSTR(MP_QSTR_D34), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO34) },
{ MP_ROM_QSTR(MP_QSTR_D35), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO35) },
{ MP_ROM_QSTR(MP_QSTR_D36), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_SCLK), MP_ROM_PTR(&pin_GPIO36) },
{ MP_ROM_QSTR(MP_QSTR_D37), MP_ROM_PTR(&pin_GPIO37) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO37) },
{ 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_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View file

@ -0,0 +1,15 @@
#
# Espressif IoT Development Framework Configuration
#
#
# Component config
#
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="espressif-esp32s3"
# end of LWIP
# end of Component config
# end of Espressif IoT Development Framework Configuration

View file

@ -0,0 +1,9 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "supervisor/board.h"
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

View file

@ -0,0 +1,29 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2019 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
// Micropython setup
#define MICROPY_HW_BOARD_NAME "FeatherS3 Neo"
#define MICROPY_HW_MCU_NAME "ESP32S3"
#define MICROPY_HW_NEOPIXEL (&pin_GPIO40)
#define CIRCUITPY_STATUS_LED_POWER (&pin_GPIO39)
#define MICROPY_HW_LED_STATUS (&pin_GPIO13)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO9)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO8)
#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_GPIO44)
#define DEFAULT_UART_BUS_TX (&pin_GPIO43)
// #define DOUBLE_TAP_PIN (&pin_GPIO47)

View file

@ -0,0 +1,17 @@
USB_VID = 0x303A
USB_PID = 0x81FC
USB_PRODUCT = "FeatherS3 Neo"
USB_MANUFACTURER = "UnexpectedMaker"
IDF_TARGET = esp32s3
CIRCUITPY_ESP_FLASH_SIZE = 8MB
CIRCUITPY_ESP_FLASH_MODE = qio
CIRCUITPY_ESP_FLASH_FREQ = 80m
CIRCUITPY_ESP_PSRAM_SIZE = 2MB
CIRCUITPY_ESP_PSRAM_MODE = qio
CIRCUITPY_ESP_PSRAM_FREQ = 80m
# Include these Python libraries in firmware.
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_NeoPixel

View file

@ -0,0 +1,139 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2020 Scott Shawcroft for Adafruit
// Industries
//
// SPDX-License-Identifier: MIT
#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_IO0), MP_ROM_PTR(&pin_GPIO0)},
{MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_GPIO0)},
{MP_ROM_QSTR(MP_QSTR_IO18), MP_ROM_PTR(&pin_GPIO18)},
{MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO18)},
{MP_ROM_QSTR(MP_QSTR_D15), MP_ROM_PTR(&pin_GPIO18)},
{MP_ROM_QSTR(MP_QSTR_IO17), MP_ROM_PTR(&pin_GPIO17)},
{MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO17)},
{MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_GPIO17)},
{MP_ROM_QSTR(MP_QSTR_IO14), MP_ROM_PTR(&pin_GPIO14)},
{MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO14)},
{MP_ROM_QSTR(MP_QSTR_D16), MP_ROM_PTR(&pin_GPIO14)},
{MP_ROM_QSTR(MP_QSTR_IO12), MP_ROM_PTR(&pin_GPIO12)},
{MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_GPIO12)},
{MP_ROM_QSTR(MP_QSTR_D17), MP_ROM_PTR(&pin_GPIO12)},
{MP_ROM_QSTR(MP_QSTR_IO6), MP_ROM_PTR(&pin_GPIO6)},
{MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_GPIO6)},
{MP_ROM_QSTR(MP_QSTR_D18), MP_ROM_PTR(&pin_GPIO6)},
{MP_ROM_QSTR(MP_QSTR_IO5), MP_ROM_PTR(&pin_GPIO5)},
{MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_GPIO5)},
{MP_ROM_QSTR(MP_QSTR_D19), MP_ROM_PTR(&pin_GPIO5)},
{MP_ROM_QSTR(MP_QSTR_IO36), MP_ROM_PTR(&pin_GPIO36)},
{MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO36)},
{MP_ROM_QSTR(MP_QSTR_D25), MP_ROM_PTR(&pin_GPIO36)},
{MP_ROM_QSTR(MP_QSTR_IO35), MP_ROM_PTR(&pin_GPIO35)},
{MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO35)},
{MP_ROM_QSTR(MP_QSTR_D24), MP_ROM_PTR(&pin_GPIO35)},
{MP_ROM_QSTR(MP_QSTR_IO37), MP_ROM_PTR(&pin_GPIO37)},
{MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO37)},
{MP_ROM_QSTR(MP_QSTR_D23), MP_ROM_PTR(&pin_GPIO37)},
{MP_ROM_QSTR(MP_QSTR_IO44), MP_ROM_PTR(&pin_GPIO44)},
{MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_GPIO44)},
{MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO44)},
{MP_ROM_QSTR(MP_QSTR_IO43), MP_ROM_PTR(&pin_GPIO43)},
{MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_GPIO43)},
{MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO43)},
// { MP_ROM_QSTR(MP_QSTR_IO42), MP_ROM_PTR(&pin_GPIO42) },
// { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO42) },
{MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO8)},
{MP_ROM_QSTR(MP_QSTR_IO8), MP_ROM_PTR(&pin_GPIO8)},
{MP_ROM_QSTR(MP_QSTR_A11), MP_ROM_PTR(&pin_GPIO8)},
{MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO8)},
{MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO9)},
{MP_ROM_QSTR(MP_QSTR_IO9), MP_ROM_PTR(&pin_GPIO9)},
{MP_ROM_QSTR(MP_QSTR_A12), MP_ROM_PTR(&pin_GPIO9)},
{MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO9)},
{MP_ROM_QSTR(MP_QSTR_IO33), MP_ROM_PTR(&pin_GPIO33)},
{MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_GPIO33)},
{MP_ROM_QSTR(MP_QSTR_IO34), MP_ROM_PTR(&pin_GPIO34)},
{MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_GPIO34)},
{MP_ROM_QSTR(MP_QSTR_IO38), MP_ROM_PTR(&pin_GPIO38)},
{MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO38)},
{MP_ROM_QSTR(MP_QSTR_IO1), MP_ROM_PTR(&pin_GPIO1)},
{MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO1)},
{MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_GPIO1)},
{MP_ROM_QSTR(MP_QSTR_IO3), MP_ROM_PTR(&pin_GPIO3)},
{MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO3)},
{MP_ROM_QSTR(MP_QSTR_A7), MP_ROM_PTR(&pin_GPIO3)},
{MP_ROM_QSTR(MP_QSTR_IO7), MP_ROM_PTR(&pin_GPIO7)},
{MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO7)},
{MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_GPIO7)},
{MP_ROM_QSTR(MP_QSTR_IO10), MP_ROM_PTR(&pin_GPIO10)},
{MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_GPIO10)},
{MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_GPIO10)},
{MP_ROM_QSTR(MP_QSTR_IO11), MP_ROM_PTR(&pin_GPIO11)},
{MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_GPIO11)},
{MP_ROM_QSTR(MP_QSTR_A10), MP_ROM_PTR(&pin_GPIO11)},
// Blue LED
{MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_GPIO13)},
// Battery voltage sense pin
{MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_GPIO2)},
{MP_ROM_QSTR(MP_QSTR_VBAT), MP_ROM_PTR(&pin_GPIO2)},
{MP_ROM_QSTR(MP_QSTR_VBAT_SENSE), MP_ROM_PTR(&pin_GPIO2)},
{MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_GPIO2)},
// 5V present sense pin
{MP_ROM_QSTR(MP_QSTR_VBUS), MP_ROM_PTR(&pin_GPIO15)},
{MP_ROM_QSTR(MP_QSTR_VBUS_SENSE), MP_ROM_PTR(&pin_GPIO15)},
// Neopixel pins
{MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_GPIO40)},
{MP_ROM_QSTR(MP_QSTR_NEOPIXEL_MATRIX), MP_ROM_PTR(&pin_GPIO16)},
// Ambient Light Sensor
{MP_ROM_QSTR(MP_QSTR_IO4), MP_ROM_PTR(&pin_GPIO4)},
{MP_ROM_QSTR(MP_QSTR_AMB), MP_ROM_PTR(&pin_GPIO4)},
// Second LDO Enable control - also used for matrix and status RGB LED
{MP_ROM_QSTR(MP_QSTR_LDO2), MP_ROM_PTR(&pin_GPIO39)},
{MP_ROM_QSTR(MP_QSTR_IO39), MP_ROM_PTR(&pin_GPIO39)},
{MP_ROM_QSTR(MP_QSTR_NEOPIXEL_MATRIX_POWER), MP_ROM_PTR(&pin_GPIO39)},
{MP_ROM_QSTR(MP_QSTR_NEOPIXEL_POWER), MP_ROM_PTR(&pin_GPIO39)},
// I2C
{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)},
// SPI
{MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj)},
// UART
{MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj)},
};
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

View file

@ -0,0 +1,15 @@
#
# Espressif IoT Development Framework Configuration
#
#
# Component config
#
#
# LWIP
#
CONFIG_LWIP_LOCAL_HOSTNAME="UMFeatherS3 Neo"
# end of LWIP
# end of Component config
# end of Espressif IoT Development Framework Configuration

View file

@ -14,7 +14,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;

View file

@ -6,10 +6,13 @@
#include "bindings/espulp/__init__.h"
#include "bindings/espulp/ULP.h"
#include "bindings/espidf/__init__.h"
#include "py/runtime.h"
#include "shared-bindings/microcontroller/Pin.h"
#include "esp_sleep.h"
#if defined(CONFIG_IDF_TARGET_ESP32)
#include "esp32/ulp.h"
#define ULP_COPROC_RESERVE_MEM (CONFIG_ESP32_ULP_COPROC_RESERVE_MEM)
@ -34,7 +37,11 @@ void espulp_reset(void) {
ulp_used = false;
}
void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t pin_mask) {
void common_hal_espulp_ulp_set_wakeup_period(espulp_ulp_obj_t *self, size_t period_index, uint32_t period_us) {
CHECK_ESP_RESULT(ulp_set_wakeup_period(period_index, period_us));
}
void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t length, uint32_t entry_point, uint32_t pin_mask) {
if (length > CONFIG_ULP_COPROC_RESERVE_MEM) {
mp_raise_ValueError(MP_ERROR_TEXT("Program too long"));
}
@ -67,19 +74,31 @@ void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t
}
pins_used = pin_mask;
ulp_set_wakeup_period(0, 20000);
// Main purpose of ULP is to run while main cpu is in deep sleep, so
// ensure GPIO Power Domain remains enabled during deep sleep,
// if any GPIO were supplied here.
if (pins_used > 0) {
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
}
esp_err_t result;
switch (self->arch) {
#ifdef CONFIG_ULP_COPROC_TYPE_FSM
case FSM:
ulp_load_binary(0, (const uint8_t *)program, length);
ulp_run(0);
result = ulp_load_binary(0, (const uint8_t *)program, length / sizeof(uint32_t));
if (result != ESP_OK) {
mp_raise_ValueError_varg(MP_ERROR_TEXT("Invalid %q"), MP_QSTR_program);
}
CHECK_ESP_RESULT(ulp_run(entry_point / sizeof(uint32_t)));
break;
#endif
#ifdef CONFIG_ULP_COPROC_TYPE_RISCV
case RISCV:
ulp_riscv_load_binary((const uint8_t *)program, length);
ulp_riscv_run();
result = ulp_riscv_load_binary((const uint8_t *)program, length);
if (result != ESP_OK) {
mp_raise_ValueError_varg(MP_ERROR_TEXT("Invalid %q"), MP_QSTR_program);
}
CHECK_ESP_RESULT(ulp_riscv_run());
break;
#endif
default:
@ -90,12 +109,11 @@ void common_hal_espulp_ulp_run(espulp_ulp_obj_t *self, uint32_t *program, size_t
void common_hal_espulp_ulp_halt(espulp_ulp_obj_t *self) {
switch (self->arch) {
/*
#ifdef CONFIG_ULP_COPROC_TYPE_FSM
case FSM:
ulp_timer_stop();
break;
#endif
*/
#ifdef CONFIG_ULP_COPROC_TYPE_RISCV
case RISCV:
ulp_riscv_timer_stop();

@ -1 +1 @@
Subproject commit da9dc379bede0bd684ddf7d95be4630897ca522e
Subproject commit 0b28b79fafa75d36348d84d9eaccdbcd73220571

View file

@ -83,6 +83,7 @@ CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y
# Ultra Low Power (ULP) Co-processor
#
CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_TYPE_FSM=y
CONFIG_ULP_COPROC_RESERVE_MEM=4080
# end of Ultra Low Power (ULP) Co-processor

View file

@ -52,6 +52,9 @@ CONFIG_NEWLIB_NANO_FORMAT=y
# Ultra Low Power (ULP) Co-processor
#
CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_TYPE_FSM=y
CONFIG_ULP_COPROC_TYPE_RISCV=y # Note: enabling both ULPs simultaneously only works due to a modification of adafruit/esp-idf
# (see adafruit/esp-idf/pull/16) until espressif/esp-idf/issues/12999 is fixed.
CONFIG_ULP_COPROC_RESERVE_MEM=8176
# end of Ultra Low Power (ULP) Co-processor

View file

@ -92,6 +92,9 @@ CONFIG_NEWLIB_NANO_FORMAT=y
# Ultra Low Power (ULP) Co-processor
#
CONFIG_ULP_COPROC_ENABLED=y
CONFIG_ULP_COPROC_TYPE_FSM=y
CONFIG_ULP_COPROC_TYPE_RISCV=y # Note: enabling both ULPs simultaneously only works due to a modification of adafruit/esp-idf
# (see adafruit/esp-idf/pull/16) until espressif/esp-idf/issues/12999 is fixed.
CONFIG_ULP_COPROC_RESERVE_MEM=8176
# end of Ultra Low Power (ULP) Co-processor

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -13,7 +13,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/__init__.h"
#include "shared-module/displayio/mipi_constants.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -14,7 +14,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "shared-bindings/board/__init__.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -14,7 +14,6 @@
#include "supervisor/board.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
// display init sequence from CircuitPython library https://github.com/adafruit/Adafruit_CircuitPython_ST7735R/blob/dfae353330cf051d1f31db9e4b681c8d70900cc5/adafruit_st7735r.py
uint8_t display_init_sequence[] = {

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -0,0 +1,9 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "supervisor/board.h"
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.

View file

@ -0,0 +1,26 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
#define MICROPY_HW_BOARD_NAME "Oak Dev Tech RPGA Feather"
#define MICROPY_HW_MCU_NAME "rp2040"
#define MICROPY_HW_LED_STATUS (&pin_GPIO25)
#define DEFAULT_I2C_BUS_SCL (&pin_GPIO11)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO10)
#define CIRCUITPY_BOARD_I2C (2)
#define CIRCUITPY_BOARD_I2C_PIN {{.scl = &pin_GPIO11, .sda = &pin_GPIO10}, \
{.scl = &pin_GPIO9, .sda = &pin_GPIO8}}
#define DEFAULT_SPI_BUS_SCK (&pin_GPIO2)
#define DEFAULT_SPI_BUS_MOSI (&pin_GPIO3)
#define DEFAULT_SPI_BUS_MISO (&pin_GPIO0)
#define DEFAULT_UART_BUS_RX (&pin_GPIO9)
#define DEFAULT_UART_BUS_TX (&pin_GPIO8)

View file

@ -0,0 +1,12 @@
USB_VID = 0x1209
USB_PID = 0x4DF6
USB_PRODUCT = "RPGA Feather"
USB_MANUFACTURER = "Oak Dev Tech"
CHIP_VARIANT = RP2040
CHIP_FAMILY = rp2
EXTERNAL_FLASH_DEVICES = "W25Q16JVxQ"
CIRCUITPY__EVE = 1
CIRCUITPY_FLOPPYIO = 0

View file

@ -0,0 +1,11 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#pragma once
// 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

View file

@ -0,0 +1,73 @@
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2021 Scott Shawcroft for Adafruit Industries
//
// SPDX-License-Identifier: MIT
#include "shared-bindings/board/__init__.h"
CIRCUITPY_BOARD_BUS_SINGLETON(stemma_i2c, i2c, 2)
static const mp_rom_map_elem_t board_global_dict_table[] = {
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
{ MP_ROM_QSTR(MP_QSTR_D26), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_GPIO26) },
{ MP_ROM_QSTR(MP_QSTR_D27), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_GPIO27) },
{ MP_ROM_QSTR(MP_QSTR_D28), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_GPIO28) },
{ MP_ROM_QSTR(MP_QSTR_A29), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_GPIO29) },
{ MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_GPIO2) },
{ MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_GPIO3) },
{ MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_GPIO0) },
{ MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_GPIO1) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_SDA), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_GPIO8) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_SCL), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_GPIO9) },
{ MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_F45), MP_ROM_PTR(&pin_GPIO10) },
{ MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_F46), MP_ROM_PTR(&pin_GPIO11) },
{ MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_F47), MP_ROM_PTR(&pin_GPIO6) },
{ MP_ROM_QSTR(MP_QSTR_D20), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_F48), MP_ROM_PTR(&pin_GPIO20) },
{ MP_ROM_QSTR(MP_QSTR_F2), MP_ROM_PTR(&pin_GPIO16) },
{ MP_ROM_QSTR(MP_QSTR_F3), MP_ROM_PTR(&pin_GPIO17) },
{ MP_ROM_QSTR(MP_QSTR_F4), MP_ROM_PTR(&pin_GPIO18) },
{ MP_ROM_QSTR(MP_QSTR_F6), MP_ROM_PTR(&pin_GPIO19) },
{ MP_ROM_QSTR(MP_QSTR_CDONE), MP_ROM_PTR(&pin_GPIO5) },
{ MP_ROM_QSTR(MP_QSTR_F_RST), MP_ROM_PTR(&pin_GPIO4) },
{ MP_ROM_QSTR(MP_QSTR_F_SCK), MP_ROM_PTR(&pin_GPIO14) },
{ MP_ROM_QSTR(MP_QSTR_F_MOSI), MP_ROM_PTR(&pin_GPIO15) },
{ MP_ROM_QSTR(MP_QSTR_F_MISO), MP_ROM_PTR(&pin_GPIO12) },
{ MP_ROM_QSTR(MP_QSTR_F_CSN), MP_ROM_PTR(&pin_GPIO13) },
{ MP_ROM_QSTR(MP_QSTR_D21), MP_ROM_PTR(&pin_GPIO21) },
{ MP_ROM_QSTR(MP_QSTR_D22), MP_ROM_PTR(&pin_GPIO22) },
{ MP_ROM_QSTR(MP_QSTR_DD23), MP_ROM_PTR(&pin_GPIO23) },
{ 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_LED), MP_ROM_PTR(&pin_GPIO25) },
{ MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) },
{ MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) },
{ MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) },
{ MP_ROM_QSTR(MP_QSTR_STEMMA_I2C), MP_ROM_PTR(&board_stemma_i2c_obj) },
};
MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table);

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -12,7 +12,6 @@
#include "shared-module/displayio/mipi_constants.h"
#include "supervisor/shared/board.h"
fourwire_fourwire_obj_t board_display_obj;
#define DELAY 0x80

View file

@ -14,7 +14,6 @@
#define DELAY 0x80
fourwire_fourwire_obj_t board_display_obj;
// display init sequence according to https://github.com/adafruit/Adafruit_CircuitPython_ST7789
uint8_t display_init_sequence[] = {

View file

@ -17,6 +17,7 @@ polib
black
pyyaml
pre-commit
micropython-uncrustify
# for combining the Nordic SoftDevice with CircuitPython
intelhex
@ -35,3 +36,6 @@ jsmin
# for Silicon Labs Configurator (SLC)
websockets
colorama
# for silabs builds
setuptools

View file

@ -277,9 +277,11 @@ MP_DEFINE_CONST_FUN_OBJ_1(epaperdisplay_epaperdisplay_refresh_obj, epaperdisplay
//| """Time, in fractional seconds, until the ePaper display can be refreshed."""
static mp_obj_t epaperdisplay_epaperdisplay_obj_get_time_to_refresh(mp_obj_t self_in) {
epaperdisplay_epaperdisplay_obj_t *self = native_display(self_in);
// band aid fix for <https://github.com/adafruit/circuitpython/issues/9129>
// sleeping for display.time_to_refresh might not be long enough due to rounding error (?)
uint32_t refresh_ms = common_hal_epaperdisplay_epaperdisplay_get_time_to_refresh(self);
if (refresh_ms == 0) {
return mp_obj_new_float(0.0);
}
// Make sure non-zero values are always more than zero (the float conversion may round down.)
return mp_obj_new_float((refresh_ms + 100) / 1000.0);
}
MP_DEFINE_CONST_FUN_OBJ_1(epaperdisplay_epaperdisplay_get_time_to_refresh_obj, epaperdisplay_epaperdisplay_obj_get_time_to_refresh);

View file

@ -131,7 +131,8 @@ static void wait_for_busy(epaperdisplay_epaperdisplay_obj_t *self) {
if (self->busy.base.type == &mp_type_NoneType) {
return;
}
while (common_hal_digitalio_digitalinout_get_value(&self->busy) == self->busy_state) {
while (common_hal_digitalio_digitalinout_get_value(&self->busy) == self->busy_state &&
!mp_hal_is_interrupted()) {
RUN_BACKGROUND_TASKS;
}
}
@ -165,6 +166,9 @@ static void send_command_sequence(epaperdisplay_epaperdisplay_obj_t *self,
if (should_wait_for_busy) {
wait_for_busy(self);
}
if (mp_hal_is_interrupted()) {
return;
}
i += 2 + data_size;
if (self->two_byte_sequence_length) {
i++;
@ -191,6 +195,9 @@ static void epaperdisplay_epaperdisplay_start_refresh(epaperdisplay_epaperdispla
common_hal_time_delay_ms(self->start_up_time_ms);
send_command_sequence(self, true, self->start_sequence, self->start_sequence_len);
if (mp_hal_is_interrupted()) {
return;
}
displayio_display_core_start_refresh(&self->core);
}