Skip to content

Hardware pin config settings#776

Open
kornpow wants to merge 3 commits intoSeedSigner:devfrom
lightningspore:hardware-pin-config-settings
Open

Hardware pin config settings#776
kornpow wants to merge 3 commits intoSeedSigner:devfrom
lightningspore:hardware-pin-config-settings

Conversation

@kornpow
Copy link

@kornpow kornpow commented Jun 19, 2025

Description

Describe the change simply. Provide a reason for the change.
This PR adds some new structures to the settings_definition.py which define what hardware/GPIOs are being used. Then it uses this structure for both the buttons and the 3 different LCD displays to configure GPIO.

It also cleans up the buttons.py code a bit so that GPIO pin numbers aren't defined in the same file twice.

Over time I have made various PRs for porting Seedsigner to the Luckfox Pico hardware, and the link below is the latest one. (Please look at the PR, commit by commit, if you are curious. I spent a lot of time making clean commit structure)
lightningspore#8

This PR is the first step in a series of PRs to enable that new hardware platform. But this PR has managed to limit the scope greatly, in order to provide some convenience without actually changing any underlying libraries.

Include screenshots of any new or modified screens (or at least explain why they were omitted)
This PR doesn't change any functionality, so no new screenshots.

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and made sure all unit tests pass before sumbitting the PR

The dev branch is currently failing some translation related tests, but it was like that before.

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

I tested it on a Raspberry Pi 3A+ running latest Bookworm 12, and commented out the camera imports. Also tested on a RPi 0.

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

@kornpow kornpow force-pushed the hardware-pin-config-settings branch from 807fef5 to 5c9ccfd Compare June 19, 2025 20:27
@kornpow
Copy link
Author

kornpow commented Jun 20, 2025

I might change this hardware configuration to visibility=SettingsConstants.VISIBILITY__HIDDEN, but looking for some feedback from you all about how people might be changing these hardware selection settings, in practice.

@newtonick newtonick added this to the 0.9.0 milestone Jul 5, 2025
@newtonick
Copy link
Collaborator

ACK and tested in RaspiOS. Still need to test with seedsigner-os. I also don't have a ili9341 screen/board to test on.

@kornpow
Copy link
Author

kornpow commented Sep 5, 2025

Appreciate the review @newtonick !

@newtonick
Copy link
Collaborator

Tested with SeedSignerOS

@newtonick
Copy link
Collaborator

The changes to st7789_mpy.py break the st7789 320x240 hardware display. When I try to enable st7789 320x240 I get this error on the Raspi OS build.

Traceback (most recent call last):
  File "/home/pi/seedsigner/src/seedsigner/controller.py", line 318, in start
    next_destination = next_destination.run()
  File "/home/pi/seedsigner/src/seedsigner/views/view.py", line 168, in run
    return self._run_view()
  File "/home/pi/seedsigner/src/seedsigner/views/view.py", line 163, in _run_view
    return self.view.run()
  File "/home/pi/seedsigner/src/seedsigner/views/settings_views.py", line 234, in run
    self.renderer.initialize_display()
  File "/home/pi/seedsigner/src/seedsigner/gui/renderer.py", line 43, in initialize_display
    self.disp = DisplayDriver(self.display_type, width=int(width), height=int(height))
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/display_driver.py", line 28, in __init__
    self.display = ST7789(width=height, height=width)
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/st7789_mpy.py", line 320, in __init__
    self.hard_reset()
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/st7789_mpy.py", line 389, in hard_reset
    if self.reset:
AttributeError: 'ST7789' object has no attribute 'reset'
2025-12-15 20:01:24,757    ERROR [seedsigner.controller handle_exception (446)]: 'ST7789' object has no attribute 'reset'
Traceback (most recent call last):
  File "/home/pi/seedsigner/src/seedsigner/controller.py", line 318, in start
    next_destination = next_destination.run()
  File "/home/pi/seedsigner/src/seedsigner/views/view.py", line 168, in run
    return self._run_view()
  File "/home/pi/seedsigner/src/seedsigner/views/view.py", line 163, in _run_view
    return self.view.run()
  File "/home/pi/seedsigner/src/seedsigner/views/settings_views.py", line 234, in run
    self.renderer.initialize_display()
  File "/home/pi/seedsigner/src/seedsigner/gui/renderer.py", line 43, in initialize_display
    self.disp = DisplayDriver(self.display_type, width=int(width), height=int(height))
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/display_driver.py", line 28, in __init__
    self.display = ST7789(width=height, height=width)
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/st7789_mpy.py", line 320, in __init__
    self.hard_reset()
  File "/home/pi/seedsigner/src/seedsigner/hardware/displays/st7789_mpy.py", line 389, in hard_reset
    if self.reset:
AttributeError: 'ST7789' object has no attribute 'reset'

@newtonick newtonick modified the milestones: 0.8.7, 0.9.0 Dec 15, 2025
@newtonick newtonick moved this from 0.8.7 Needs Code Review to 0.8.7 In Progress in @SeedSigner Development Board Dec 15, 2025
@newtonick newtonick moved this from 0.8.7 In Progress to 0.9.0 In Progress in @SeedSigner Development Board Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 0.9.0 In Progress

Development

Successfully merging this pull request may close these issues.

2 participants