File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 11use hidapi:: { HidApi , HidDevice , HidError } ;
2+ use log:: Level ;
23
34pub const PIX_VID : u16 = 0x093A ;
45pub 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) ;
You can’t perform that action at this time.
0 commit comments