Skip to content

Add Waveshare ESP32-C5-WIFI6-KIT + ILI9341 touch and ESP32-S3 N16R8 + ST7735 boards - #3083

Open
J-Hou-ss wants to merge 2 commits into
BruceDevices:devfrom
J-Hou-ss:add-waveshare-c5-kit-and-s3-st7735
Open

J-Hou-ss wants to merge 2 commits into
BruceDevices:devfrom
J-Hou-ss:add-waveshare-c5-kit-and-s3-st7735

Conversation

@J-Hou-ss

Copy link
Copy Markdown

Proposed Changes

Two new board targets for common DIY builds, plus a small TFT_eSPI fix that one of them needs.

waveshare-c5-kit-ili9341: Waveshare ESP32-C5-WIFI6-KIT (WROOM-1 / -1U) with the 2.8" ILI9341 + XPT2046 SPI module (MSP2807).
The existing esp32-c5-tft env shows a white screen on this kit: the kit ties GPIO6 (R39, 0 ohm) to its battery-sense divider, which has a 100 nF capacitor to GND, and esp32-c5-tft uses GPIO6 as the SPI clock. The new env uses the display pins from Waveshare's own ILI9341 demo for this kit (SCK 1, MOSI 2, CS 5, DC 3, RST 4) and keeps GPIO6 for the backlight. It is otherwise a copy of esp32-c5-tft (same touch HAL and calibration). Module defaults are moved off the display pins: I2C / GPS / CH9329 on 24/25 and the IR LED on 0, because 3, 4 and 5 are display pins here.

esp32-s3-n16r8-st7735: ESP32-S3 N16R8 DevKitC-1 style board with a 1.8" ST7735 128x160 SPI screen and three buttons (HAL 3-button layout: previous + next = back). The screen is on its own HSPI bus; SD / CC1101 / NRF24 share the usual 11/12/13 bus. I2C uses GPIO47 instead of GPIO46 (strapping pin).

TFT_eSPI ST7735_Defines.h: the bundled header hard-codes ST7735_GREENTAB160x80. Because of the order of the tab #if chain, that default wins over -DST7735_REDTAB, -DST7735_BLACKTAB and -DST7735_REDTAB160x80 given as build flags, which gives inverted colours and a 26-pixel shift on 128x160 panels. The change only defines the 160x80 default when no tab flag is set, so boards that set no flag (and Marauder-Mini, which sets GREENTAB3, already ahead of the default in the chain) are unchanged.

Each board folder has a connections.md with wiring, module defaults and pins to avoid.

Types of Changes

New feature (two board targets). Small bug fix in the bundled TFT_eSPI (ST7735_Defines.h).

Verification

  • The branch is on dev 97de7f8. pio run -e waveshare-c5-kit-ili9341 and pio run -e esp32-s3-n16r8-st7735 build cleanly there, with no warnings from the new board files. pio run -e Marauder-Mini (the existing ST7735 board, as a check on the shared change) also builds cleanly with the change (checked on dev 22e72a1).

  • ST7735_Defines.h change, checked by preprocessing the header with each tab flag (value of TAB_COLOUR):

    Build flag Before After
    none 0x6 (GREENTAB160x80) 0x6
    ST7735_GREENTAB / GREENTAB2 / GREENTAB3 / GREENTAB128 0x0 / 0x3 / 0x4 / 0x5 unchanged
    ST7735_REDTAB160x80 0x6 (wrong) 0x7
    ST7735_REDTAB 0x6 (wrong) 0x1
    ST7735_BLACKTAB 0x6 (wrong) 0x2
  • Hardware (tested on dev 22e72a1; the dev changes since then are in the I2C / RFID code):

    • Waveshare ESP32-C5-WIFI6-KIT (WROOM-1, N16R8, chip v1.0) + MSP2807, flashed after a full erase: touch calibration on first boot, normal UI, touch navigation, brightness control. PASS.
    • ESP32-S3 N16R8 + red 1.8" ST7735 module + 3 buttons, flashed after a full erase: correct colours and no offset or noise strip with ST7735_GREENTAB2, previous / next / select and previous + next = back, brightness control. PASS.
  • Both boards ran the same pin maps on a pre-refactor build of main before this port.

Testing

Manual testing on the hardware above. Not tested yet: SD card, CC1101, NRF24, PN532 (default pins set, nothing wired).

Linked Issues

None. Board layout follows boards/README.md and boards/_New-Device-Model; waveshare-c5-kit-ili9341 is based on ESP32-C5-tft.

User-Facing Change

New boards: Waveshare ESP32-C5-WIFI6-KIT with a 2.8" ILI9341 touch screen (waveshare-c5-kit-ili9341), and ESP32-S3 N16R8 with a 1.8" ST7735 screen and 3 buttons (esp32-s3-n16r8-st7735).

Further Comments

The ST7735 build defaults to ST7735_GREENTAB2, which suits the common red 1.8" module; connections.md says which tab flags to try if a module shows a noise strip or wrong colours.

🤖 Generated with Claude Code

J-Hou-ss and others added 2 commits November 13, 2026 13:04
ST7735_Defines.h hard-codes ST7735_GREENTAB160x80. Because of the order
of the tab #if chain, that default wins over -DST7735_REDTAB,
-DST7735_BLACKTAB and -DST7735_REDTAB160x80 given as build flags, which
gives inverted colours and a 26-pixel shift on 128x160 panels.

Only define the 160x80 default when no tab flag is set. Boards that set
no flag are unchanged.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…16R8 ST7735

waveshare-c5-kit-ili9341: Waveshare ESP32-C5-WIFI6-KIT with the 2.8"
ILI9341 + XPT2046 SPI module. The kit ties GPIO6 to its battery-sense
divider (100 nF to GND), so esp32-c5-tft, which clocks the display on
GPIO6, shows a white screen on it. This env uses the display pins from
Waveshare's ILI9341 demo and keeps GPIO6 for the backlight.

esp32-s3-n16r8-st7735: ESP32-S3 N16R8 DevKitC-1 style board with a 1.8"
ST7735 128x160 SPI screen and three buttons.

Both are added to the build matrix and the README board table, and each
board folder has a connections.md with wiring and pins to avoid.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant