Skip to content

Add the Waveshare ESP32-S31-Touch-LCD-4.3C board config - #724

Merged
bdbarnett merged 1 commit into
mainfrom
s31-box-config
Nov 20, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
s31-box-config

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

This adds a board config for the Waveshare ESP32-S31-Touch-LCD-4.3C, modelled on the ESP32-S3-Touch-LCD-4.3's, and three drivers the board needs: es8389 (the audio codec), pcf85063 (the RTC) and bq27220 (the fuel gauge).

board_config brings up the 800x480 RGB panel and the GT911. board_peripherals describes the rest of the board: speaker out and the two mics through the ES8389, the SD slot, the QMI8658 as accelerometer and gyroscope, rtc, battery, i2c, led, boot_button, can, rs485, wlan and ble. There is no usb_device role because the S31 firmware leaves USB device mode out for now.

Two things about the codec are worth knowing. The board gives it no MCLK, so the driver clocks it from BCLK. Its ADC only gives clean samples with 32-bit I2S slots, so pcm_in reads 32-bit frames and narrows them to 16 bits.

What was run

All of this ran on the board, on the ESP32-S31 firmware from PyDevices/omnipython-builds#581.

  • tools/mark_tested.py passed every check it ran and wrote tested.json. can and sdcard were skipped.
  • The display: an LVGL label and red, green, blue and yellow blocks drawn through display_driver. A camera photo showed the colours in the right order.
  • Touch: the GT911 reported product ID 911 and an 800x480 config, and touch_read() returned no points.
  • Speaker: a 1 kHz tone through pcm_out and through audio_out. A microphone next to the board recorded 1000 Hz, about 50 dB above the room. While the tone played, the codec's registers showed the DAC unmuted and the amplifier enabled; after close() the amplifier was off.
  • The mics: pcm_in at 48 kHz stereo. A 700 Hz tone from a nearby speaker lifted both channels about tenfold over the quiet room, with the peak in the 700 Hz bin. Opening the speaker while the mics held I2S raised the OSError the config gives for that case.
  • The other chips:
    • The QMI8658 read 1 g on Z lying flat.
    • The PCF85063 kept time, and its countdown pulled the interrupt pin low.
    • The BQ27220 read 4.15 V, 100 %, "full".
  • The pins: the LED pin followed on() and off(). The BOOT button read released. GPIO48-53 on the header drove high and low.
  • The radios: the Wi-Fi scan found networks, and BLE went active.

Not verified

  • Touch with a finger.
  • The SD slot: no card answered, and the slot is likely empty.
  • can raises NotImplementedError, because this firmware has no machine.CAN.
  • rs485 opens and sends, but nothing was listening on the bus.
  • The fuel gauge reports a 1,000 mAh design capacity, its default, while the board's cell is 650 mAh. Its percentage is a rough guide until it learns the cell.

@bdbarnett

Copy link
Copy Markdown
Contributor Author

Checked on the board since the PR was opened: the microSD slot mounts a 7.7 GB FAT card through board_config.sdcard and writes, reads back and removes a file. Touch reports points under a finger (touch_read() returned ((67, 88, 56, 0),) while the screen was pressed near its top-left), and the BOOT button on GPIO61 reads low when pressed. The battery on this board is a 1,000 mAh cell, which matches the gauge's default capacity. CAN, RS485 to a second device and the J3 USB header remain unchecked.

@bdbarnett
bdbarnett merged commit 2b246dc into main Nov 20, 2026
7 checks passed
@bdbarnett
bdbarnett deleted the s31-box-config branch November 20, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant