Driver for the KeDei 3.5" SPI TFTLCD 480×320, Version 3.0 (2015/12/1) touchscreen on current Raspberry Pi OS (Debian 13 "Trixie", 64-bit).
KeDei only ever shipped this board with a patched 2015 Raspbian kernel, and
none of the usual drivers (piscreen, waveshare35a, LCD-show, fbtft
ILI9486) drive it: the screen stays white. kedei3-lcd is a small userspace
driver that talks to the board directly, so it needs no kernel module and
survives kernel updates.
- Mirrors
/dev/fb0to the LCD, pushing only the rows that change: the boot console, and in desktop mode the Raspberry Pi desktop (X11). - Exposes the resistive touchscreen as the input device "KeDei Touch", with on-screen calibration.
Tested on a Raspberry Pi 3 Model B with Raspberry Pi OS Trixie (2026-10-06, kernel 6.18). Other KeDei revisions use different protocols; see Other KeDei boards.
The back of the PCB says 3.5 inch SPI TFTLCD 480*320 and Version 3.0 2015/12/1. The board plugs onto the first 26 GPIO pins.
On Raspberry Pi OS with desktop:
git clone https://github.com/evolver79/kedei3-lcd.git
cd kedei3-lcd
sudo ./install.sh desktop # or "console" for the text console only
sudo rebootThen calibrate the touchscreen (tap the four crosses):
sudo systemctl stop kedei3-lcd && sudo kedei3-lcd calibrate && sudo systemctl start kedei3-lcdsudo ./install.sh uninstall removes everything again.
- Builds
/usr/local/bin/kedei3-lcdand enableskedei3-lcd.service. - Comments out
dtparam=spi=onif set: the driver uses SPI0 directly. - Adds
video=HDMI-A-1:480x320M@60Dtocmdline.txt, so the Pi creates a 480×320 framebuffer even without a monitor. - Desktop mode only: switches the desktop from Wayland to X11
(
raspi-config nonint do_wayland W1), installs/etc/X11/xorg.conf.d/99-kedei.confso X renders into/dev/fb0, and masksglamor-test.service, whose20-noglamor.confstops X from starting on the framebuffer. Don't switch back to Wayland: the compositor would bypass/dev/fb0and the LCD would only show the console.
Only the pixels that change are sent (runs within each row), so small updates are fast while full-screen changes are slow. Measured on a Pi 3:
| Update | 25 MHz (default) | 33 MHz |
|---|---|---|
| Full screen | 0.40 s | 0.32 s |
kedei3-lcd demo (four 40 px balls) |
39.6 fps | 51.1 fps |
Clocks, counters, menus and terminal text feel responsive; video and full-screen games are not realistic. Every pixel costs two 24-bit transfers through the shift registers, which caps full-screen updates at about 5–7 fps.
The tested board runs cleanly at 33 MHz but turns white (corrupted frames reset the panel) at 50 MHz. To use 33 MHz:
sudo systemctl edit kedei3-lcd # add the two lines below
[Service]
Environment=KEDEI_SPI_CDIV=12Run kedei3-lcd demo with the service stopped to check a setting first:
sudo systemctl stop kedei3-lcd && sudo KEDEI_SPI_CDIV=12 kedei3-lcd demo 30.
demos/demoscene.c is a small demoscene-style show built on the driver:
starfield with a sine scroller, a landscape moved with the panel's hardware
scrolling, sine waves, raster bars, plasma and blobs, each picked or tuned to
send as few pixels as possible.
make demoscene
sudo systemctl stop kedei3-lcd
sudo KEDEI_SPI_CDIV=12 ./demoscene # one run, about 90 s; "./demoscene 0" loops
sudo systemctl start kedei3-lcd| Part | fps at 33 MHz | Trick |
|---|---|---|
| Starfield + sine scroller | 38.5 | few pixels change per frame |
| Hardware-scrolled landscape | 58 (capped at 60) | the panel scrolls; 2 new columns per frame |
| Sine waves | 18.8 | thin lines |
| Raster bars | 16.2 | interlaced: every other row per frame |
| Plasma | 11.0 | 16 colour bands, only band edges change |
| Blobs | 12.5 | the dark background stays unchanged |
It reads its scroller font from the Terminus console fonts in
/usr/share/consolefonts (installed on Raspberry Pi OS).
kedei3-lcd test init and draw colour bars
kedei3-lcd demo [seconds] bouncing balls with an FPS counter
kedei3-lcd daemon <src> mirror a framebuffer device or raw 480x320 RGB565 file
kedei3-lcd calibrate touch calibration, saved to /etc/kedei-touch.conf
Environment: KEDEI_SPI_CDIV (SPI clock divider, default 16),
KEDEI_FRAME_BYTES (3, the default, or 4 to send the vendor's padding
byte) and KEDEI_INIT (v63 panel settings, the default, or v11).
Stop the service before running test, demo or calibrate: only one program may
drive SPI0 at a time.
- v6.3 (2018/4/9): use kolomiichenko/kedei-lcd.
- Anything else:
tools/kprobetries the known bus framings and draws a different number of white bars for each, so you can see which one your board speaks;tools/ktouchfinds the touch controller wiring. Build them withmakeand stop the service first. Issues and pull requests with results for other revisions are welcome.
The protocol is documented in docs/PROTOCOL.md.
- kolomiichenko/kedei-lcd: the v6.3 userspace driver this one is based on (register-level SPI, touch, uinput, X11 setup) and its panel init sequence.
- saper-2/rpi-spi-lcd35-kedei: the v1.1 schematic and bus framing that the v3 board turned out to share.
GPL-2.0-only, see LICENSE.