Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0145357
Merge commit '0f329f6fb568f1c7aaae6288ce33e38c566f3d1d' into initial_…
kdmukai Oct 24, 2024
061b7ea
fix: Remove ili9341 import that crashes on ST7789 displays
FreeOnlineUser Dec 18, 2025
3acb65b
Add touchscreen support for Waveshare 2.8" DPI LCD
FreeOnlineUser Dec 18, 2025
8130cf9
Touch bar UI refinements and documentation
FreeOnlineUser Dec 18, 2025
f07d567
Use icon fonts instead of text for touch bar buttons
FreeOnlineUser Dec 19, 2025
940bcf7
Add single-tap touch support for dice and coin flip screens
FreeOnlineUser Dec 19, 2025
55ff0a0
Fix TouchButtons.wait_for() parameter compatibility
FreeOnlineUser Dec 19, 2025
b4b1f3f
Fix keyboard key selection - use set_selected_key_indices
FreeOnlineUser Dec 19, 2025
0f28ff4
Fix Key attribute: use key.letter instead of key.text_content
FreeOnlineUser Dec 19, 2025
eb90967
Initialize cursor_position in dice/coin flip _run()
FreeOnlineUser Dec 19, 2025
a65f84e
Improve dice/coin flip touch handling with fallback to selected key
FreeOnlineUser Dec 19, 2025
8042363
Add touch support for passphrase screen, fix edge key detection
FreeOnlineUser Dec 19, 2025
9d418ac
Fix DPI28 framebuffer driver with mmap and BGR conversion
FreeOnlineUser Dec 20, 2025
085213d
Add cleanup on framebuffer init failure
FreeOnlineUser Dec 20, 2025
879a671
Fix touch bar hasattr check on ST7789 hardware
FreeOnlineUser Dec 20, 2025
533be69
Exclude scroll indicator zones from button tap detection
FreeOnlineUser Dec 23, 2025
34437d7
Fix DPI28 display: auto-detect and disable Cython
Dec 20, 2025
0a401af
Add DPI28 setup script for config.txt fix
Dec 20, 2025
1aa0983
Fix touch input for DPI28 display
Dec 20, 2025
97b55d7
Simplify touch input and add DPI28 boot config
FreeOnlineUser Jan 2, 2026
4382b78
Fix boot config for portable SD card use
FreeOnlineUser Jan 2, 2026
f317247
Add Waveshare DPI overlay files
FreeOnlineUser Jan 2, 2026
19adabb
Add config for 1.3" SPI display
FreeOnlineUser Jan 2, 2026
c7b2b0d
Rename and update display setup docs
FreeOnlineUser Jan 2, 2026
357225b
Remove PR_DESCRIPTION.md from repo (keep local only)
FreeOnlineUser Jan 2, 2026
cb91f42
Hide touch bar on power off screens
FreeOnlineUser Jan 3, 2026
722a2f4
Fix DPI28 console text overlay and touchscreen camera default
FreeOnlineUser Jan 20, 2026
e990f09
Remove .claude config and HANDOFF.md from repo
FreeOnlineUser Feb 10, 2026
f783d22
Add unit tests for touchscreen modules
FreeOnlineUser Feb 10, 2026
92374b9
Improve code quality: logging, exception handling, docs
FreeOnlineUser Feb 10, 2026
286a1c3
Add touch bar features, fix review items, improve emulator
FreeOnlineUser Feb 10, 2026
d0201e7
Fix touch bar back button, rename TOUCH_BAR_CAMERA, restore after scr…
FreeOnlineUser Feb 10, 2026
9f03328
Fix qrimage_io fallback to handle named colors like 'white'
FreeOnlineUser Feb 10, 2026
672fe99
Revert qrimage_io fallback change (emulator-only concern)
FreeOnlineUser Feb 10, 2026
9051fae
Extract _set_touch_bar() helper, fix hardcoded English strings
FreeOnlineUser Feb 11, 2026
679fd81
Remove emulator from PR (dev-only tool, not production code)
FreeOnlineUser Feb 11, 2026
fd32345
Fix KeyboardScreen touch input: direct tap on keys instead of d-pad m…
FreeOnlineUser Feb 13, 2026
dff1f3c
Fix KeyboardScreen touch: back button, save button, touch bar, dice h…
FreeOnlineUser Feb 13, 2026
e9bafd9
Fix edge taps triggering arrow key navigation in dice/coin flip screens
FreeOnlineUser Feb 13, 2026
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ src/seedsigner/models/settings_definition.json
.coverage*

*.po
*.mo
*.mo
78 changes: 78 additions & 0 deletions DISPLAY_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# SeedSigner Display Setup Guide

This guide covers setting up SeedSigner with different displays.

## Supported Displays

| Display | Config File | Overlays Required |
|---------|-------------|-------------------|
| Waveshare 1.3" SPI LCD (240x240) | `config_spi13.txt` | None (standard) |
| Waveshare 2.8" DPI LCD (480x640) | `config_dpi28.txt` | Yes |

## Hardware

- Raspberry Pi Zero (or Zero W/2W)
- Waveshare display (1.3" SPI or 2.8" DPI)
- Compatible camera module

---

## 1.3" SPI Display Setup (Standard)

### Steps

1. Flash SeedSignerOS image to SD card
2. Copy `config_spi13.txt` → `config.txt` on boot partition
3. Boot

No additional overlays needed - this is the standard SeedSigner display.

---

## 2.8" DPI Touchscreen Setup

### Steps

1. Flash SeedSignerOS image to SD card
2. Copy `config_dpi28.txt` → `config.txt` on boot partition
3. Copy `cmdline_dpi28.txt` → `cmdline.txt` on boot partition
4. Copy overlay files from `overlays_dpi28/` to `overlays/` folder:
- `waveshare-28dpi-3b-4b.dtbo`
- `waveshare-28dpi-3b.dtbo`
- `waveshare-touch-28dpi.dtbo`
5. Boot

### Quick Setup (Linux/Mac)

```bash
cp config_dpi28.txt /path/to/boot/config.txt
cp cmdline_dpi28.txt /path/to/boot/cmdline.txt
cp overlays_dpi28/*.dtbo /path/to/boot/overlays/
```

---

## Troubleshooting

### DPI28: Display shows wrong colors (red/blue swapped)

The `dpi_output_format` value is wrong. Ensure it's set to `0x7F206` (not `0x7F216`).

### DPI28: Touch not working

1. Check I2C is enabled: `dtparam=i2c_arm=on` in config.txt
2. Verify touch device exists: `ls /sys/class/input/event*/device/name`

### DPI28: Display not detected

Ensure overlay files are copied to the `overlays/` folder.

---

## Files

- `config_spi13.txt` - Config for 1.3" SPI display (standard)
- `config_dpi28.txt` - Config for 2.8" DPI touchscreen
- `cmdline_dpi28.txt` - Cmdline for DPI28 (hides console cursor)
- `overlays_dpi28/` - Waveshare DPI overlay files
- `setup_dpi28.sh` - Script to fix dpi_output_format on existing setup
1 change: 1 addition & 0 deletions cmdline_dpi28.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console=serial0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait consoleblank=0 logo.nologo vt.global_cursor_default=0 modules-load=dwc2,g_ether spidev.bufsiz=131072
46 changes: 46 additions & 0 deletions config_dpi28.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# SeedSigner with Waveshare 2.8" DPI LCD
# Pi Zero - Buster legacy DPI (no KMS)

# Force LCD, disable HDMI
ignore_lcd=0
hdmi_ignore_hotplug=1
disable_hdmi=1

# DPI GPIO assignments for RGB666 (18-bit color)
gpio=0-9=a2
gpio=12-17=a2
gpio=20-25=a2

# Enable DPI display (legacy firmware mode)
enable_dpi_lcd=1
display_default_lcd=1

# DPI timing mode
dpi_group=2
dpi_mode=87

# RGB666 output format (18-bit)
dpi_output_format=0x7F206

# 480x640 @ 60Hz timing for 2.8" DPI
hdmi_timings=480 0 26 16 10 640 0 25 10 15 0 0 0 60 0 32000000 1

# Use Waveshare overlays (handles backlight GPIO 18 properly)
dtoverlay=waveshare-28dpi-3b-4b
dtoverlay=waveshare-28dpi-3b
dtoverlay=waveshare-touch-28dpi

extra_transpose_buffer=2

# I2C for touch
dtparam=i2c_arm=on

# Camera
start_x=1
gpu_mem=128

# Disable audio
dtparam=audio=off

# USB gadget mode for SSH over USB
dtoverlay=dwc2
31 changes: 31 additions & 0 deletions config_spi13.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SeedSigner with 1.3" SPI LCD (240x240)
# Standard Waveshare 1.3" ST7789 display with GPIO buttons

start_file=start_x.elf
fixup_file=fixup_x.dat

# Kernel location
kernel=zImage

# GPU memory
gpu_mem=64

# Enable Camera module
start_x=1

# Enable SPI for display
dtparam=spi=on

# Boot settings
boot_delay=0
disable_splash=1
force_turbo=1

# I2C (optional, for future peripherals)
dtparam=i2c_arm=on

# Disable audio (not used)
dtparam=audio=off

# USB gadget mode for SSH over USB (optional)
dtoverlay=dwc2
Binary file added overlays_dpi28/waveshare-28dpi-3b-4b.dtbo
Binary file not shown.
Binary file added overlays_dpi28/waveshare-28dpi-3b.dtbo
Binary file not shown.
Binary file added overlays_dpi28/waveshare-touch-28dpi.dtbo
Binary file not shown.
36 changes: 36 additions & 0 deletions setup_dpi28.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash
# Setup script for Waveshare 2.8" DPI LCD on SeedSigner
# Run this after flashing SeedSignerOS image

echo "=== SeedSigner DPI28 Display Setup ==="

# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Please run as root: sudo $0"
exit 1
fi

# Backup existing config
cp /boot/config.txt /boot/config.txt.backup
echo "Backed up /boot/config.txt"

# Update dpi_output_format for correct colors
if grep -q "dpi_output_format=0x7F216" /boot/config.txt; then
sed -i "s/dpi_output_format=0x7F216/dpi_output_format=0x7F206/" /boot/config.txt
echo "Fixed dpi_output_format (0x7F216 -> 0x7F206)"
elif grep -q "dpi_output_format=0x7F206" /boot/config.txt; then
echo "dpi_output_format already correct (0x7F206)"
else
echo "dpi_output_format=0x7F206" >> /boot/config.txt
echo "Added dpi_output_format=0x7F206"
fi

# Verify the setting
echo ""
echo "Current DPI settings:"
grep -E "dpi_output|dpi_group|dpi_mode" /boot/config.txt

echo ""
echo "=== Setup Complete ==="
echo "Reboot required for changes to take effect."
echo "Run: sudo reboot"
8 changes: 4 additions & 4 deletions src/seedsigner/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,8 @@ def start_screensaver(self):
if not self.screensaver:
# Do a lazy/late import and instantiation to reduce Controller initial startup time
from seedsigner.views.screensaver import ScreensaverScreen
from seedsigner.hardware.buttons import HardwareButtons
self.screensaver = ScreensaverScreen(HardwareButtons.get_instance())
from seedsigner.hardware.touchbuttons import get_buttons
self.screensaver = ScreensaverScreen(get_buttons())

# Start the screensaver, but it will block until it can acquire the Renderer.lock.
self.screensaver.start()
Expand All @@ -412,8 +412,8 @@ def reset_screensaver_timeout(self):
Reset the screensaver's timeout starting point to right now (i.e. make it think
that zero time has elapsed since the last user interaction).
"""
from seedsigner.hardware.buttons import HardwareButtons
HardwareButtons.get_instance().update_last_input_time()
from seedsigner.hardware.touchbuttons import get_buttons
get_buttons().update_last_input_time()


def activate_toast(self, toast_manager_thread: BaseToastOverlayManagerThread):
Expand Down
30 changes: 30 additions & 0 deletions src/seedsigner/gui/keyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,36 @@ def set_selected_key_indices(self, x, y):
self.get_key_at(self.selected_key["x"], self.selected_key["y"]).is_selected = True


def get_key_at_screen_coords(self, screen_x: int, screen_y: int):
"""
Find which key (if any) is at the given screen coordinates.

Args:
screen_x, screen_y: Screen coordinates in native space (240x240)

Returns:
Key object if found and active, None otherwise
"""
# Check if within keyboard rect
if not (self.rect[0] <= screen_x <= self.rect[2] and
self.rect[1] <= screen_y <= self.rect[3]):
return None

# Find the key at these coordinates
for row_keys in self.keys:
for key in row_keys:
key_right = key.screen_x + self.key_width * key.size
key_bottom = key.screen_y + self.key_height
if (key.screen_x <= screen_x <= key_right and
key.screen_y <= screen_y <= key_bottom):
# Only return active keys - greyed out keys should be ignored
if key.is_active:
return key
return None

return None



class TextEntryDisplayConstants:
CURSOR_MODE__BAR = "bar"
Expand Down
Loading