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
18 changes: 18 additions & 0 deletions board_configs/nodisplay/remote-display/tested.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,24 @@
],
"skipped": [],
"tool": "tools/mark_tested.py"
},
{
"hardware": "Seeed Studio XIAO ESP32C5 (ESP32-C5HR8, 8 MB flash, 8 MB PSRAM) with its seeed_xiao_esp32c5 package, nothing attached",
"firmware": "micropython 1.30.0 (Seeed XIAO ESP32C5 with ESP32-C5), v1.30.0-preview.322.gb9620707e3 on 2026-11-25",
"date": "2026-11-25",
"smoke": "passed",
"checks": [
"board_config imports",
"display draws",
"battery answers",
"ble answers",
"boot_button answers",
"i2c answers",
"led answers",
"wlan answers"
],
"skipped": [],
"tool": "tools/mark_tested.py"
}
]
}
108 changes: 108 additions & 0 deletions board_configs/nodisplay/seeed_xiao_esp32c5/board_peripherals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# SPDX-FileCopyrightText: 2026 Brad Barnett
#
# SPDX-License-Identifier: MIT

"""Lazy roles for the Seeed Studio XIAO ESP32C5. PERIPHERALS = lazy roles only.

The XIAO ESP32C5 is an ESP32-C5 (dual-band Wi-Fi 6, Bluetooth LE) with 8 MB
of flash and 8 MB of PSRAM, a USB-C port on the chip's own USB Serial/JTAG,
and a LiPo charger. Pins are from Seeed's pin table and the firmware's:

user LED GPIO27, yellow, low to light
BOOT button GPIO28, low when pressed
battery sense GPIO6, through a 1:2 divider that GPIO26 connects
I2C D4 SDA (GPIO23), D5 SCL (GPIO24)
antenna Wi-Fi and Bluetooth through the U.FL connector; fit
the antenna before using either

It has no display and no audio. 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.

Checked on a board with nothing attached: every role opens, BOOT reads high
when not pressed, the battery role reads the charger's 4.0 V with no battery
fitted, Wi-Fi joins on 2.4 GHz and on 5 GHz, BLE starts, and the
``remote-display`` board config draws beside this package. Not checked, for
want of hands or hardware: the LED by eye, a press of BOOT, a real battery,
and anything on the I2C pins.
"""

import sys

import boarddev

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

_LED = 27
_BOOT = 28
_BAT_ADC = 6 # battery divider tap
_BAT_EN = 26 # high connects the divider
_SDA = 23 # D4
_SCL = 24 # D5


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


def led():
"""The yellow user LED as a ``machine.Signal``: ``on()`` lights it."""
from machine import Pin, Signal

return Signal(Pin(_LED, Pin.OUT, value=1), invert=True)


def boot_button():
"""The BOOT button (GPIO28, ``value()`` 0 when pressed)."""
from machine import Pin

return Pin(_BOOT, Pin.IN, Pin.PULL_UP)


def keypad():
"""The BOOT button 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

return GPIOButtons({"boot": (Pin(_BOOT, Pin.IN, Pin.PULL_UP), keys.K_RETURN)})


def battery():
"""The LiPo's voltage through the 1:2 divider on GPIO6 (``voltage`` in volts).

GPIO26 connects the divider; it stays connected once this role is opened,
which draws about 20 uA from the battery. Without a battery the reading is
the charger's output.
"""
from battery_adc import BatteryADC
from machine import Pin

Pin(_BAT_EN, Pin.OUT, value=1)
return BatteryADC(_BAT_ADC, scale=2.0)


def i2c():
"""The I2C bus on D4 and D5, at 400 kHz."""
from machine import I2C, Pin

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


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.
# Without bledev (or aioble) installed, the raw radio.
try:
import bledev.mpble
except ImportError:
import bluetooth

return bluetooth.BLE()
return bledev.mpble.get()
15 changes: 15 additions & 0 deletions board_configs/nodisplay/seeed_xiao_esp32c5/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 seeed_xiao_esp32c5 board package: what mip.install("seeed_xiao_esp32c5") brings.
metadata(
description="board_peripherals for the Seeed Studio XIAO ESP32C5, 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/seeed_xiao_esp32c5/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/seeed_xiao_esp32c5/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 Seeed Studio XIAO ESP32C5, on MicroPython",
"generated": "from manifest.py by tools/libbuild.py installers; edit manifest.py, not this"
}
23 changes: 23 additions & 0 deletions board_configs/nodisplay/seeed_xiao_esp32c5/tested.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"board": "seeed_xiao_esp32c5",
"runs": [
{
"hardware": "Seeed Studio XIAO ESP32C5 (ESP32-C5HR8, 8 MB flash, 8 MB PSRAM), nothing attached, U.FL antenna",
"firmware": "micropython 1.30.0 (Seeed XIAO ESP32C5 with ESP32-C5), v1.30.0-preview.322.gb9620707e3 on 2026-11-25",
"date": "2026-11-25",
"smoke": "passed",
"checks": [
"board_config imports",
"display draws",
"battery answers",
"ble answers",
"boot_button answers",
"i2c answers",
"led answers",
"wlan answers"
],
"skipped": [],
"tool": "tools/mark_tested.py"
}
]
}
1 change: 1 addition & 0 deletions docs/boards/board-configs.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ that display's board config instead, and keeps its apps.
| `nodisplay/qtpy_esp32_pico_audio_bff` | QT Py ESP32 Pico + Adafruit Audio BFF (MicroPython; `audio_out` on I2S, `boot_button`) |
| `nodisplay/esp32-s31-zero` | Waveshare ESP32-S31-Zero (MicroPython; `pixels`, `boot_button`, `wlan`, `ble`) |
| `nodisplay/pimoroni_pico_plus2_w` | Pimoroni Pico Plus 2 W (MicroPython; `led`, `i2c`, `wlan`, `ble`; the BOOT switch as `keypad()`) |
| `nodisplay/seeed_xiao_esp32c5` | Seeed Studio XIAO ESP32C5 (MicroPython; `led`, `boot_button`, `battery`, `i2c`, `wlan`, `ble`; BOOT as `keypad()`) |
| `cp/nodisplay/qtpy_esp32_pico_audio_bff` | the same, on CircuitPython (`audio_out` is `audiobusio.I2SOut`) |

### Desktop and browser
Expand Down