Skip to content

Commit bd5f119

Browse files
Merge pull request #5 from FrameworkComputer/read-brightness
2 parents 1cfa950 + 0b58955 commit bd5f119

File tree

17 files changed

+1496
-130
lines changed

17 files changed

+1496
-130
lines changed

Cargo.lock

Lines changed: 93 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
3-
name = "led_matrix_fw"
4-
version = "0.1.1"
3+
name = "lotus_inputmodules"
4+
version = "0.1.2-pre"
55

66
[dependencies]
77
cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
@@ -24,9 +24,34 @@ usb-device= "0.2.9"
2424
heapless = "0.7.9"
2525
usbd-serial = "0.1.1"
2626
usbd-hid = "0.5.1"
27-
is31fl3741 = { git = "https://github.com/JohnAZoidberg/is31fl3741", branch = "all-at-once" }
2827
fugit = "0.3.6"
2928

29+
# LED Matrix
30+
is31fl3741 = { git = "https://github.com/JohnAZoidberg/is31fl3741", branch = "all-at-once", optional = true }
31+
32+
33+
# B1 Display
34+
display-interface-spi = { version = "0.4.1", optional = true }
35+
mipidsi = { version = "0.6.0", optional = true }
36+
embedded-graphics = { version = "0.7", optional = true }
37+
tinybmp = { version = "0.4.0", optional = true }
38+
39+
[lib]
40+
name = "lotus_input"
41+
path = "src/lib.rs"
42+
43+
[[bin]]
44+
name = "ledmatrix"
45+
required-features = ["ledmatrix"]
46+
47+
[[bin]]
48+
name = "b1display"
49+
required-features = ["b1display"]
50+
51+
[features]
52+
ledmatrix = [ "is31fl3741" ]
53+
b1display = [ "display-interface-spi", "mipidsi", "embedded-graphics", "tinybmp" ]
54+
3055
# cargo build/run
3156
[profile.dev]
3257
codegen-units = 1

README.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# Lotus LED Matrix Module
1+
# Lotus Input Module Firmware
22

3-
It's a 9x34 (306) LED matrix, controlled by RP2040 MCU and IS31FL3741A LED controller.
4-
5-
Connection to the host system is via USB 2.0 and currently there is a USB Serial API to control it without reflashing.
3+
See below sections for LED Matrix and LCD Display module details.
64

75
Rust project setup based off of: https://github.com/rp-rs/rp2040-project-template
86

@@ -63,6 +61,7 @@ options:
6361
--wpm WPM Demo
6462
--snake Snake
6563
--all-brightnesses Show every pixel in a different brightness
64+
-v, --version Get device version
6665
--serial-dev SERIAL_DEV
6766
Change the serial dev. Probably /dev/ttyACM0 on Linux, COM0 on Windows
6867
```
@@ -99,13 +98,15 @@ cargo install elf2uf2-rs --locked
9998
Build:
10099

101100
```sh
102-
cargo build
101+
cargo build --bin ledmatrix --features=ledmatrix
102+
cargo build --bin b1display --features=b1display
103103
```
104104

105105
Generate UF2 file:
106106

107107
```sh
108-
elf2uf2-rs target/thumbv6m-none-eabi/debug/led_matrix_fw led_matrix.uf2
108+
elf2uf2-rs target/thumbv6m-none-eabi/debug/ledmatrix ledmatrix.uf2
109+
elf2uf2-rs target/thumbv6m-none-eabi/debug/b1display b1dipslay.uf2
109110
```
110111

111112
## Flashing
@@ -121,6 +122,25 @@ cargo run
121122
Or by copying the above generated UF2 file to the partition mounted when the
122123
module is in the bootloder.
123124

125+
### Check the firmware version of the device
126+
127+
###### In-band using `control.py`
128+
129+
```sh
130+
> ./control.py --version
131+
Device version: 0.1.2
132+
```
133+
134+
###### By looking at the USB descriptor
135+
136+
On Linux:
137+
138+
```sh
139+
> lsusb -d 32ac: -v 2> /dev/null | grep -P 'ID 32ac|bcdDevice'
140+
Bus 003 Device 078: ID 32ac:0021 Framework Lotus B1 Display
141+
bcdDevice 0.10
142+
```
143+
124144
## Panic
125145

126146
On panic the RP2040 resets itself into bootloader mode.
@@ -132,3 +152,11 @@ Additionally the panic message is written to flash, which can be read as follows
132152
sudo picotool save -r 0x15000000 0x15004000 message.bin
133153
strings message.bin | head
134154
```
155+
156+
## LED Matrix
157+
158+
It's a 9x34 (306) LED matrix, controlled by RP2040 MCU and IS31FL3741A LED controller.
159+
160+
Connection to the host system is via USB 2.0 and currently there is a USB Serial API to control it without reflashing.
161+
162+
## B1 Display

assets/logo.bmp

26.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)