Skip to content

Commit 6e1d411

Browse files
committed
touchpad: Dump whole config space
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent e85b0d3 commit 6e1d411

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

framework_lib/src/touchpad.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use hidapi::{HidApi, HidDevice, HidError};
2+
use log::Level;
23

34
pub const PIX_VID: u16 = 0x093A;
45
pub const P274_REPORT_ID: u8 = 0x43;
@@ -67,6 +68,35 @@ pub fn print_touchpad_fw_ver() -> Result<(), HidError> {
6768
};
6869
println!(" Firmware Version: v{}", ver);
6970

71+
if log_enabled!(Level::Debug) {
72+
println!(" Config space 1");
73+
print!(" ");
74+
for x in 0..16 {
75+
print!("0{:X} ", x);
76+
}
77+
println!();
78+
for y in 0..16 {
79+
print!("{:X}0 ", y);
80+
for x in 0..16 {
81+
print!("{:02X} ", read_byte(&device, 0x42, x + 16 * y)?);
82+
}
83+
println!();
84+
}
85+
println!(" Config space 2");
86+
print!(" ");
87+
for x in 0..16 {
88+
print!("0{:X} ", x);
89+
}
90+
println!();
91+
for y in 0..16 {
92+
print!("{:X}0 ", y);
93+
for x in 0..16 {
94+
print!("{:02X} ", read_byte(&device, 0x43, x + 16 * y)?);
95+
}
96+
println!();
97+
}
98+
}
99+
70100
// Linux does not expose a useful version number for I2C HID devices
71101
#[cfg(target_os = "linux")]
72102
debug!(" HID Version {:04X}", hid_ver);

0 commit comments

Comments
 (0)