Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions docs/hardware_platform_support.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Current profiles in `io_config.json`:
- `FOX_22` (Luckfox Pico 22-pin)
- `FOX_40` (Luckfox Pico 40-pin)
- `FOX_PI` (Luckfox Pico Pi)
- `LC_LAFRITE` (Libre Computer La Frite AML-S805X-AC, USB camera)

## Button GPIO mapping format

Expand Down Expand Up @@ -166,3 +167,25 @@ This is a quick reference summary of the mappings currently defined in
- Device: `/dev/video12`
- Pixel format: `GREY`
- Framerate: `6`

### `LC_LAFRITE`

- Display (sysfs GPIO numbers; 7J1 header, Waveshare-compatible physical pin positions):
- `dc`: `[480]` (pin 22, GPIOX_0)
- `rst`: `[510]` (pin 13, GPIOAO_9)
- `bl`: `[495]` (pin 18, GPIOX_15)
- SPI: `bus 0`, `device 0`
- Buttons (all with `"pull_up"`; sysfs GPIO numbers):
- `KEY_UP`: `[498, "pull_up"]` (pin 31, GPIOX_18)
- `KEY_DOWN`: `[487, "pull_up"]` (pin 35, GPIOX_7)
- `KEY_LEFT`: `[497, "pull_up"]` (pin 29, GPIOX_17)
- `KEY_RIGHT`: `[485, "pull_up"]` (pin 37, GPIOX_5)
- `KEY_PRESS`: `[486, "pull_up"]` (pin 33, GPIOX_6)
- `KEY1`: `[484, "pull_up"]` (pin 40, GPIOX_4)
- `KEY2`: `[483, "pull_up"]` (pin 38, GPIOX_3)
- `KEY3`: `[482, "pull_up"]` (pin 36, GPIOX_2)
- Camera (USB):
- Device: `/dev/video0`
- Resolution: `1280x720`
- Pixel format: `YUYV`
- Framerate: `4`
1 change: 1 addition & 0 deletions docs/io_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Values shown are exactly how mappings are stored in `io_config.json`.
| `FOX_22` | `luckfox_22` | `[52] / [51] / [43]` | `KEY_UP [57,"pull_up"]`, `KEY_DOWN [59,"pull_up"]`, `KEY_LEFT [56,"pull_up"]`, `KEY_RIGHT [54,"pull_up"]`, `KEY_PRESS [58,"pull_up"]`, `KEY1 [55,"pull_up"]`, `KEY2 [4,"pull_up"]`, `KEY3 [53,"pull_up"]` | `/dev/video12`, `GREY`, `6fps` |
| `FOX_40` | `luckfox_40` | `[56] / [57] / [72]` | `KEY_UP [58,"pull_up"]`, `KEY_DOWN [53,"pull_up"]`, `KEY_LEFT [59,"pull_up"]`, `KEY_RIGHT [54,"pull_up"]`, `KEY_PRESS [52,"pull_up"]`, `KEY1 [55,"pull_up"]`, `KEY2 [43,"pull_up"]`, `KEY3 [42,"pull_up"]` | `/dev/video12`, `GREY`, `6fps` |
| `FOX_PI` | `luckfox_pi` | `[59] / [56] / [70]` | `KEY_UP [121,"pull_up"]`, `KEY_DOWN [1,"pull_up"]`, `KEY_LEFT [122,"pull_up"]`, `KEY_RIGHT [0,"pull_up"]`, `KEY_PRESS [52,"pull_up"]`, `KEY1 [145,"pull_up"]`, `KEY2 [123,"pull_up"]`, `KEY3 [55,"pull_up"]` | `/dev/video12`, `GREY`, `6fps` |
| `LC_LAFRITE` | `lc_lafrite` | `[480] / [510] / [495]` | `KEY_UP [498,"pull_up"]`, `KEY_DOWN [487,"pull_up"]`, `KEY_LEFT [497,"pull_up"]`, `KEY_RIGHT [485,"pull_up"]`, `KEY_PRESS [486,"pull_up"]`, `KEY1 [484,"pull_up"]`, `KEY2 [483,"pull_up"]`, `KEY3 [482,"pull_up"]` | `/dev/video0`, `1280x720`, `YUYV`, `4fps` |

---

Expand Down
65 changes: 65 additions & 0 deletions src/seedsigner/hardware/io_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,71 @@
"framerate": 6
}
},
{
"platform": "Libre Computer",
"variant": "La Frite (AML-S805X-AC)",
"shortname": "LC_LAFRITE",
"runtime_profile": "lc_lafrite",
"regex": [
"libre computer aml-s805x-ac"
],
"display": {
"dc": [
480
],
"rst": [
510
],
"bl": [
495
],
"spi_bus": 0,
"spi_device": 0
},
"buttons": {
"KEY_UP": [
498,
"pull_up"
],
"KEY_DOWN": [
487,
"pull_up"
],
"KEY_LEFT": [
497,
"pull_up"
],
"KEY_RIGHT": [
485,
"pull_up"
],
"KEY_PRESS": [
486,
"pull_up"
],
"KEY1": [
484,
"pull_up"
],
"KEY2": [
483,
"pull_up"
],
"KEY3": [
482,
"pull_up"
]
},
"camera": {
"device": "/dev/video0",
"resolution": [
1280,
720
],
"pixelformat": "YUYV",
"framerate": 4
}
},
{
"platform": "Luckfox Pico",
"variant": "Pi",
Expand Down
37 changes: 37 additions & 0 deletions tests/test_io_config_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,43 @@ def test_runtime_profile_to_hardware_profile_luckfox_pico_pi():
assert runtime_profile_to_hardware_profile("luckfox_pi") == "FOX_PI"


def test_detect_runtime_profile_libre_computer_lafrite():
assert detect_runtime_profile("Libre Computer AML-S805X-AC La Frite") == "lc_lafrite"


def test_runtime_profile_to_hardware_profile_libre_computer_lafrite():
assert runtime_profile_to_hardware_profile("lc_lafrite") == "LC_LAFRITE"


def test_lc_lafrite_display_control_lines():
mapping = get_hardware_pin_mapping("LC_LAFRITE")

assert mapping["display"]["dc"] == [480]
assert mapping["display"]["rst"] == [510]
assert mapping["display"]["bl"] == [495]


def test_lc_lafrite_buttons_use_pull_up_mapping():
mapping = get_hardware_pin_mapping("LC_LAFRITE")

assert mapping["buttons"]["KEY_UP"] == [498, "pull_up"]
assert mapping["buttons"]["KEY_DOWN"] == [487, "pull_up"]
assert mapping["buttons"]["KEY_LEFT"] == [497, "pull_up"]
assert mapping["buttons"]["KEY_RIGHT"] == [485, "pull_up"]
assert mapping["buttons"]["KEY_PRESS"] == [486, "pull_up"]
assert mapping["buttons"]["KEY1"] == [484, "pull_up"]
assert mapping["buttons"]["KEY2"] == [483, "pull_up"]
assert mapping["buttons"]["KEY3"] == [482, "pull_up"]


def test_lc_lafrite_camera_uses_usb_device():
mapping = get_hardware_pin_mapping("LC_LAFRITE")

assert mapping["camera"]["device"] == "/dev/video0"
assert mapping["camera"]["pixelformat"] == "YUYV"
assert mapping["camera"]["framerate"] == 4


def test_fox_pi_display_control_lines_match_waveshare_hat_pins():
mapping = get_hardware_pin_mapping("FOX_PI")

Expand Down