Skip to content

Commit 529ec08

Browse files
committed
qtpy: Clean up
And change PID to 0x001F Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 71dfc6e commit 529ec08

File tree

4 files changed

+12
-25
lines changed

4 files changed

+12
-25
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ See pages of the individual modules for details about how they work and how
1111
they're controlled.
1212

1313
- [LED Matrix](ledmatrix/README.md)
14-
- [2nd Display](b1display/README.md)
1514
- [Minimal C1 Input Module](c1minimal/README.md)
15+
- [2nd Display](b1display/README.md)
16+
- [QT PY RP2040](qtpy/README.md)
1617

1718
## Generic Features
1819

ledmatrix_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
FWK_MAGIC = [0x32, 0xAC]
2121
FWK_VID = 0x32AC
2222
LED_MATRIX_PID = 0x20
23-
QTPY_PID = 0x01AF
23+
QTPY_PID = 0x001F
2424
INPUTMODULE_PIDS = [LED_MATRIX_PID, QTPY_PID]
2525

2626

qtpy/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## QT PY RP2040
22

3-
Easy to get started with, without having a Framework module.
4-
Has GPIO and WS2812/Neopixel compatible RGB LED.
3+
**NOT** an official Framework module.
4+
Just reference firmware that's easy to get started with, without having a
5+
Framework module. Has GPIO and WS2812/Neopixel compatible RGB LED.
56

67
When booting up this LED is lit in green color.
78
Its color and brightness can be controlled via the commands:

qtpy/src/main.rs

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! C1 Minimal Input Module
1+
//! QT PY RP2040 with Framework 16 Input Module Firmware
22
//!
33
//! Neopixel/WS2812 compatible RGB LED is connected to GPIO12.
44
//! This pin doesn't support SPI TX.
@@ -53,15 +53,10 @@ pub type Ws2812<'a> = ws2812_pio::Ws2812<
5353
>;
5454

5555
use fl16_inputmodules::control::*;
56-
use fl16_inputmodules::serialnum::{device_release, get_serialnum};
56+
use fl16_inputmodules::serialnum::device_release;
5757

58-
// TODO: Need to adjust
59-
// FRA - Framwork
60-
// 000 - C1 Minimal Input Module (No assigned value)
61-
// AM - Atemitech
62-
// 00 - Default Configuration
63-
// 00000000 - Device Identifier
64-
const DEFAULT_SERIAL: &str = "FRA000AM0000000000";
58+
const FRAMEWORK_VID: u16 = 0x32AC;
59+
const COMMUNITY_PID: u16 = 0x001F;
6560

6661
#[entry]
6762
fn main() -> ! {
@@ -103,16 +98,9 @@ fn main() -> ! {
10398
// Set up the USB Communications Class Device driver
10499
let mut serial = SerialPort::new(&usb_bus);
105100

106-
let serialnum = if let Some(serialnum) = get_serialnum() {
107-
serialnum.serialnum
108-
} else {
109-
DEFAULT_SERIAL
110-
};
111-
112-
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x32ac, 0x01AF))
101+
let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(FRAMEWORK_VID, COMMUNITY_PID))
113102
.manufacturer("Adafruit")
114-
.product("QT PY")
115-
.serial_number(serialnum)
103+
.product("QT PY - Framework 16 Inputmodule FW")
116104
.max_power(500)
117105
.device_release(device_release())
118106
.device_class(USB_CLASS_CDC)
@@ -194,9 +182,6 @@ fn handle_sleep(
194182

195183
// Turn off LED
196184
ws2812.write([colors::BLACK].iter().cloned()).unwrap();
197-
198-
// TODO: Set up SLEEP# pin as interrupt and wfi
199-
//cortex_m::asm::wfi();
200185
}
201186
(SimpleSleepState::Sleeping, true) => (),
202187
(SimpleSleepState::Sleeping, false) => {

0 commit comments

Comments
 (0)