Skip to content

Commit f2846d9

Browse files
committed
Add QT Py Module
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent bb95ba7 commit f2846d9

File tree

9 files changed

+349
-5
lines changed

9 files changed

+349
-5
lines changed

.github/workflows/firmware.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,26 @@ jobs:
3232
- run: cargo install cargo-make
3333

3434
- run: cargo install flip-link
35+
# Debug version
3536
- run: cargo make --cwd b1display
3637
- run: cargo make --cwd c1minimal
38+
- run: cargo make --cwd ledmatrix
39+
- run: cargo make --cwd qtpy
40+
# Release version
3741
- run: cargo make --cwd ledmatrix build-release
3842
- run: cargo make --cwd ledmatrix build-release-10k
3943
- run: cargo make --cwd ledmatrix build-release-evt
4044
- run: cargo make --cwd b1display build-release
4145
- run: cargo make --cwd c1minimal build-release
46+
- run: cargo make --cwd qtpy build-release
4247

4348
- name: Convert to UF2 format
4449
run: |
4550
sudo apt-get update
4651
sudo apt-get install -y libudev-dev
4752
cargo make --cwd b1display uf2
4853
cargo make --cwd c1minimal uf2
54+
cargo make --cwd qtpy uf2
4955
cargo make --cwd ledmatrix build-release-10k-uf2
5056
cargo make --cwd ledmatrix build-release-evt-uf2
5157
cargo make --cwd ledmatrix uf2
@@ -55,6 +61,7 @@ jobs:
5561
sudo apt-get update
5662
sudo apt-get install -y llvm
5763
cargo make --cwd b1display bin
64+
cargo make --cwd qtpy bin
5865
cargo make --cwd c1minimal bin
5966
cargo make --cwd ledmatrix bin
6067
@@ -99,6 +106,7 @@ jobs:
99106
sudo apt-get update
100107
sudo apt-get install -y libudev-dev
101108
cargo make clippy --cwd b1display
109+
cargo make clippy --cwd qtpy
102110
cargo make clippy --cwd c1minimal
103111
cargo make clippy --cwd ledmatrix
104112
@@ -110,6 +118,7 @@ jobs:
110118
run: |
111119
cargo pkgid -p fl16-inputmodules | cut -d "#" -f2 >> versions.tmp
112120
cargo pkgid -p b1display | cut -d "#" -f2 >> versions.tmp
121+
cargo pkgid -p qtpy | cut -d "#" -f2 >> versions.tmp
113122
cargo pkgid -p c1minimal | cut -d "#" -f2 >> versions.tmp
114123
cargo pkgid -p ledmatrix | cut -d "#" -f2 >> versions.tmp
115124
uniq -c versions.tmp | [ $(wc -l) -eq 1 ]
@@ -127,4 +136,5 @@ jobs:
127136
cargo fmt -p b1display -- --check
128137
cargo fmt -p c1minimal -- --check
129138
cargo fmt -p ledmatrix -- --check
139+
cargo fmt -p qtpy -- --check
130140
cargo fmt -p fl16-inputmodules -- --check

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
"ledmatrix",
1111
"fl16-inputmodules",
1212
"inputmodule-control",
13+
"qtpy",
1314
]
1415
# Don't build all of them by default.
1516
# Because that'll lead to all features enabled in `fl16-inputmodules` and it
@@ -63,6 +64,12 @@ incremental = true
6364
# To allow single-stepping through code use 0. Will cause timing issues, though
6465
opt-level = 3
6566

67+
[profile.dev.package.qtpy]
68+
codegen-units = 1
69+
incremental = true
70+
# To allow single-stepping through code use 0. Will cause timing issues, though
71+
opt-level = 3
72+
6673
# Faster and smaller code but much slower to compile.
6774
# Increase in rebuild time from <1s to 20s
6875
[profile.release]

fl16-inputmodules/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ default = []
4747
ledmatrix = ["is31fl3741"]
4848
b1display = ["st7306", "embedded-graphics", "tinybmp"]
4949
c1minimal = ["smart-leds", "ws2812-pio"]
50+
qtpy = ["c1minimal"]

fl16-inputmodules/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub mod graphics;
2727
#[cfg(feature = "b1display")]
2828
pub mod lcd_hal;
2929

30-
#[cfg(feature = "c1minimal")]
30+
#[cfg(all(feature = "c1minimal", not(feature = "qtpy")))]
3131
pub mod minimal_hal;
3232

3333
pub mod control;

qtpy/Cargo.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
edition = "2021"
3+
name = "qtpy"
4+
version = "0.1.7"
5+
6+
[dependencies]
7+
cortex-m.workspace = true
8+
cortex-m-rt.workspace = true
9+
embedded-hal.workspace = true
10+
11+
defmt.workspace = true
12+
defmt-rtt.workspace = true
13+
14+
#panic-probe.workspace = true
15+
rp2040-panic-usb-boot.workspace = true
16+
17+
# Not using an external BSP, we've got the Framework Laptop 16 BSPs locally in this crate
18+
rp2040-hal.workspace = true
19+
rp2040-boot2.workspace = true
20+
21+
# USB Serial
22+
usb-device.workspace = true
23+
heapless.workspace = true
24+
usbd-serial.workspace = true
25+
usbd-hid.workspace = true
26+
fugit.workspace = true
27+
28+
# C1 Minimal
29+
smart-leds.workspace = true
30+
ws2812-pio.workspace = true
31+
32+
# QT Py
33+
adafruit-qt-py-rp2040 = "0.6.0"
34+
35+
[dependencies.fl16-inputmodules]
36+
path = "../fl16-inputmodules"
37+
# Same feature as c1minimal
38+
features = [ "c1minimal", "qtpy" ]

qtpy/Makefile.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extend = "../Makefile.toml"
2+
3+
[tasks.uf2]
4+
command = "elf2uf2-rs"
5+
args = ["../target/thumbv6m-none-eabi/release/qtpy", "../target/thumbv6m-none-eabi/release/qtpy.uf2"]
6+
dependencies = ["build-release"]
7+
install_crate = "elf2uf2-rs"
8+
9+
[tasks.bin]
10+
command = "llvm-objcopy"
11+
args = ["-Obinary", "../target/thumbv6m-none-eabi/release/qtpy", "../target/thumbv6m-none-eabi/release/qtpy.bin"]
12+
dependencies = ["build-release"]

qtpy/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## QT PY RP2040
2+
3+
Easy to get started with, without having a Framework module.
4+
Has GPIO and WS2812/Neopixel compatible RGB LED.
5+
6+
When booting up this LED is lit in green color.
7+
Its color and brightness can be controlled via the commands:
8+
9+
```sh
10+
> ./ledmatrix_control.py --brightness 255
11+
> ./ledmatrix_control.py --get-brightness
12+
Current brightness: 255
13+
14+
> ./ledmatrix_control.py --set-color yellow
15+
> ./ledmatrix_control.py --get-color
16+
Current color: RGB:(255, 255, 0)
17+
```

0 commit comments

Comments
 (0)