File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1
1
use hidapi:: { HidApi , HidDevice , HidError } ;
2
+ use log:: Level ;
2
3
3
4
pub const PIX_VID : u16 = 0x093A ;
4
5
pub const P274_REPORT_ID : u8 = 0x43 ;
@@ -67,6 +68,35 @@ pub fn print_touchpad_fw_ver() -> Result<(), HidError> {
67
68
} ;
68
69
println ! ( " Firmware Version: v{}" , ver) ;
69
70
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
+
70
100
// Linux does not expose a useful version number for I2C HID devices
71
101
#[ cfg( target_os = "linux" ) ]
72
102
debug ! ( " HID Version {:04X}" , hid_ver) ;
You can’t perform that action at this time.
0 commit comments