Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
# The ili9341_esp32_audio_kit board package: what mip.install("ili9341_esp32_audio_kit") brings.
metadata(
description="Ai-Thinker ESP32-Audio-Kit V2.2 with a 2.8\" ILI9341 IPS touch module - MicroPython",
version="0.1",
version="0.2",
)

require("omnipython")
require("esp32_audio_kit")
require("ili9341")
require("ft6x36")
require("es8388")

module("board_config.py")
module("board_peripherals.py")
16 changes: 10 additions & 6 deletions board_configs/busdisplay/spi/ili9341_esp32_audio_kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
],
[
"board_peripherals.py",
"github:PyDevices/omnipython/board_configs/busdisplay/spi/ili9341_esp32_audio_kit/board_peripherals.py"
"github:PyDevices/omnipython/board_configs/nodisplay/esp32_audio_kit/board_peripherals.py"
],
[
"es8388.py",
"github:PyDevices/omnipython/drivers/codec/es8388.py"
],
[
"keypad_gpio.py",
"github:PyDevices/omnipython/drivers/input/keypad_gpio.py"
],
[
"ili9341.py",
Expand All @@ -15,10 +23,6 @@
[
"ft6x36.py",
"github:PyDevices/omnipython/drivers/touch/ft6x36.py"
],
[
"es8388.py",
"github:PyDevices/omnipython/drivers/codec/es8388.py"
]
],
"deps": [
Expand All @@ -27,7 +31,7 @@
"latest"
]
],
"version": "0.1",
"version": "0.2",
"description": "Ai-Thinker ESP32-Audio-Kit V2.2 with a 2.8\" ILI9341 IPS touch module - MicroPython",
"generated": "from manifest.py by tools/libbuild.py installers; edit manifest.py, not this"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: MIT

"""Adafruit 3.5" TFT FeatherWing (HX8357D) + STMPE610 on an Unexpected Maker Feather ESP32 V2
"""Adafruit 3.5" TFT FeatherWing (HX8357D) + STMPE610 on an Adafruit ESP32 Feather V2

The HX8357D takes the ILI9341 driver's init unchanged; only the size differs:
320x480 native, shown as 480x320 landscape. Pins are the Feather ESP32 V2's GPIO
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

# The pitft_hx8357_featherwing_on_feather_esp32_v2 board package: what mip.install("pitft_hx8357_featherwing_on_feather_esp32_v2") brings.
metadata(
description="Adafruit 3.5\" TFT FeatherWing (HX8357D) + STMPE610 on an Unexpected Maker Feather ESP32 V2",
version="0.1",
description="Adafruit 3.5\" TFT FeatherWing (HX8357D) + STMPE610 on an Adafruit ESP32 Feather V2",
version="0.2",
)

require("omnipython")
require("adafruit_feather_esp32_v2")
require("ili9341")
require("stmpe610")

module("board_config.py")
module("board_peripherals.py")
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
],
[
"board_peripherals.py",
"github:PyDevices/omnipython/board_configs/busdisplay/spi/pitft_hx8357_featherwing_on_feather_esp32_v2/board_peripherals.py"
"github:PyDevices/omnipython/board_configs/nodisplay/adafruit_feather_esp32_v2/board_peripherals.py"
],
[
"battery_adc.py",
"github:PyDevices/omnipython/drivers/power/battery_adc.py"
],
[
"keypad_gpio.py",
"github:PyDevices/omnipython/drivers/input/keypad_gpio.py"
],
[
"ili9341.py",
Expand All @@ -23,7 +31,7 @@
"latest"
]
],
"version": "0.1",
"description": "Adafruit 3.5\" TFT FeatherWing (HX8357D) + STMPE610 on an Unexpected Maker Feather ESP32 V2",
"version": "0.2",
"description": "Adafruit 3.5\" TFT FeatherWing (HX8357D) + STMPE610 on an Adafruit ESP32 Feather V2",
"generated": "from manifest.py by tools/libbuild.py installers; edit manifest.py, not this"
}
119 changes: 119 additions & 0 deletions board_configs/nodisplay/adafruit_feather_esp32_v2/board_peripherals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Lazy roles for the Adafruit ESP32 Feather V2. PERIPHERALS = lazy roles only.

The Feather V2 is a classic ESP32 (ESP32-PICO-MINI-02) with 8 MB of flash,
2 MB of PSRAM, a USB-C port through a CH9102, and a LiPo charger. Pins are
from Adafruit's pinout:

NeoPixel GPIO0, powered through GPIO2
STEMMA QT / I2C SDA GPIO22, SCL GPIO20, powered through GPIO2
red LED GPIO13, high = on
button SW38 GPIO38, input only, pulled up on the board: low
when pressed
battery monitor GPIO35, through a divider of two 200K resistors
reset button the chip's enable line; no GPIO

GPIO2 (``NEOPIXEL_I2C_POWER``) switches the regulator for both the
NeoPixel and the STEMMA QT connector's 3V3, so ``pixels`` and ``i2c`` each
drive it high. GPIO12 is a boot strap that must be low at reset.

It has no display. Install the ``remote-display`` board config beside this
package for a screen in a web browser, or a display's own board config
when one is fitted: the 3.5" TFT FeatherWing has
``pitft_hx8357_featherwing_on_feather_esp32_v2``, which brings this
package too.

It has no audio output of its own, so there is no ``audio_out`` or ``bt``
receiver role: an I2S amplifier on its pins brings its own.

Checked on a board: a ``RemoteDisplay`` at 480x320 as its board config.
Not checked yet: each role below on the board, the button and LED by hand,
and the battery reading against a meter.
"""

import sys

import boarddev

PERIPHERALS = frozenset({"pixels", "led", "i2c", "battery", "wlan", "ble"})

_PIXEL = 0
_POWER = 2 # NEOPIXEL_I2C_POWER
_LED = 13
_BUTTON = 38
_BATTERY = 35
_SDA = 22
_SCL = 20


def load_peripherals(ns):
boarddev.bind_lazy(ns, sys.modules[__name__])


def _power_on():
from machine import Pin

Pin(_POWER, Pin.OUT, value=1)


def pixels():
"""The NeoPixel, as a one-pixel ``neopixel.NeoPixel``."""
from machine import Pin
from neopixel import NeoPixel

_power_on()
return NeoPixel(Pin(_PIXEL, Pin.OUT), 1)


def led():
"""The red LED on GPIO13, a ``machine.Pin``: ``led(1)`` turns it on."""
from machine import Pin

return Pin(_LED, Pin.OUT, value=0)


def i2c():
"""The STEMMA QT connector's I2C, at 400 kHz, with its power switched on."""
from machine import I2C, Pin

_power_on()
return I2C(0, sda=Pin(_SDA), scl=Pin(_SCL), freq=400_000)


def battery():
"""The LiPo's voltage, through the divider on GPIO35 (``voltage`` in volts)."""
from battery_adc import BatteryADC

return BatteryADC(_BATTERY, scale=2.0)


def keypad():
"""SW38 as the Enter key, for a board config to give the app as ``keypad``."""
import keys
from keypad_gpio import GPIOButtons
from machine import Pin

# GPIO38 has no internal pull-up; the board's own resistor holds it high.
return GPIOButtons({"sw38": (Pin(_BUTTON, Pin.IN), keys.K_RETURN)})


def wlan():
import network

return network.WLAN(network.STA_IF)


def ble():
# A bledev adapter (docs/guides/bluetooth-le.md). It also answers every
# bluetooth.BLE method, so code written for the raw radio keeps working.
# Firmware built with btclassic has no BLE: one Bluetooth host at a time.
try:
import bledev.mpble
except ImportError:
import bluetooth

return bluetooth.BLE()
return bledev.mpble.get()
15 changes: 15 additions & 0 deletions board_configs/nodisplay/adafruit_feather_esp32_v2/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

# The adafruit_feather_esp32_v2 board package: what mip.install("adafruit_feather_esp32_v2") brings.
metadata(
description="board_peripherals for the Adafruit ESP32 Feather V2, on MicroPython",
version="0.1.0",
)

require("omnipython")
require("battery_adc")
require("keypad_gpio")

module("board_peripherals.py")
25 changes: 25 additions & 0 deletions board_configs/nodisplay/adafruit_feather_esp32_v2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"urls": [
[
"board_peripherals.py",
"github:PyDevices/omnipython/board_configs/nodisplay/adafruit_feather_esp32_v2/board_peripherals.py"
],
[
"battery_adc.py",
"github:PyDevices/omnipython/drivers/power/battery_adc.py"
],
[
"keypad_gpio.py",
"github:PyDevices/omnipython/drivers/input/keypad_gpio.py"
]
],
"deps": [
[
"omnipython",
"latest"
]
],
"version": "0.1.0",
"description": "board_peripherals for the Adafruit ESP32 Feather V2, on MicroPython",
"generated": "from manifest.py by tools/libbuild.py installers; edit manifest.py, not this"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

"""board_peripherals for the Waveshare ESP32-P4-WIFI6-DEV-KIT, on MicroPython.

Headless, so there is no board_config.py; an app imports board_peripherals
directly. A display on the DSI connector brings its own board_config (see
fbdisplay/esp32-p4-wifi6-dev-kit_kedei-5in-dsi), which loads this file.
Headless: an app imports board_peripherals directly, or the
``remote-display`` board config installed beside it gives the board a
screen in a web browser. A display on the DSI connector brings its own
board_config instead (see fbdisplay/esp32-p4-wifi6-dev-kit_kedei-5in-dsi),
which loads this file.
PERIPHERALS = lazy roles only: nothing is constructed until it is asked for.

What the board carries, from Waveshare's schematic (ESP32-P4-WIFI6-DEV-KIT
Expand Down
5 changes: 3 additions & 2 deletions board_configs/nodisplay/esp32-s31-zero/board_peripherals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@

The Zero is an ESP32-S31 with 32 MB of flash and 16 MB of PSRAM, a USB-C
port, two buttons, an RGB LED, 18 edge pads and a 40-pin FPC connector.
Pins are from Waveshare's schematic. It has no display of its own, so there
is no ``board_config.py``: import this module.
Pins are from Waveshare's schematic. It has no display of its own: import this
module, or install the ``remote-display`` board config beside it for a
screen in a web browser.

RGB LED WS2812B on GPIO60, through a level shifter to 5 V
BOOT button GPIO61, low while pressed (a boot strap at reset)
Expand Down
Loading