A desktop window mirroring project for the ESP32-S3 and ILI9341 SPI display.
Captures a selected desktop window, scales it to 320×240, converts it to RGB565 and streams frames over USB Serial/JTAG to the ESP32-S3.
- Window capture using
kwcapture - 320×240 output resolution
- RGB565 colour (16-bit per pixel)
- USB Serial/JTAG frame transfer
- Direct SPI display updates in eight-row strips
- No full framebuffer required for mirroring
- ESP32-S3 N16R8 (16 MB flash, 8 MB PSRAM)
- ILI9341 320×240 SPI display
- 3.3 V logic
| Signal | GPIO |
|---|---|
| CS | 10 |
| RESET | 8 |
| DC | 9 |
| MOSI | 11 |
| SCK | 12 |
| MISO | 13 |
The display uses SPI2 at 20 MHz, in SPI mode 0.
Each frame consists of:
| Component | Size |
|---|---|
Magic header (0xA5C3F00F) |
4 bytes |
| RGB565 image data | 153,600 bytes |
Pixel data is transmitted in big-endian byte order.
The ESP32 synchronises on the magic header and receives the frame in 30 strips of eight rows (5,120 bytes each). Each strip is sent directly to the display.
- Resolution: 320×240
- Frame size: 150 KiB
- Capture target: 5 FPS
- Display interface: SPI at 20 MHz
The Python capture loop paces transmission to the configured FPS.
ESP32
- ESP-IDF
- Native SPI master driver
- USB Serial/JTAG driver
Host
- Python: ESP-IDF venv:
- PySerial
- NumPy
- Pillow
- kwcapture
The display driver also contains framebuffer and drawing functionality from the original ESP32 display project. The mirroring path itself uses a small internal-RAM strip buffer rather than allocating a full framebuffer.
