RKTK API Docs RKTK Home Repo

rktk_drivers_common/mouse/paw3395/
config.rs

1pub struct Config {
2    pub mode: Mode,
3    pub lift_cutoff: LiftCutoff,
4}
5
6impl Default for Config {
7    fn default() -> Self {
8        Self {
9            mode: HP_MODE,
10            lift_cutoff: LiftCutoff::_1mm,
11        }
12    }
13}
14
15pub struct Mode {
16    pub(super) commands: &'static [(u8, u8)],
17    pub(super) _0x40: Option<u8>,
18}
19
20pub const HP_MODE: Mode = Mode {
21    commands: &[
22        (0x7F, 0x05),
23        (0x51, 0x40),
24        (0x53, 0x40),
25        (0x61, 0x31),
26        (0x6E, 0x0F),
27        (0x7F, 0x07),
28        (0x42, 0x32),
29        (0x43, 0x00),
30        (0x7F, 0x0D),
31        (0x51, 0x00),
32        (0x52, 0x49),
33        (0x53, 0x00),
34        (0x54, 0x5B),
35        (0x55, 0x00),
36        (0x56, 0x64),
37        (0x57, 0x02),
38        (0x58, 0xA5),
39        (0x7F, 0x00),
40        (0x54, 0x54),
41        (0x78, 0x01),
42        (0x79, 0x9C),
43    ],
44    _0x40: Some(0x00),
45};
46
47pub const LP_MODE: Mode = Mode {
48    commands: &[
49        (0x7F, 0x05),
50        (0x51, 0x40),
51        (0x53, 0x40),
52        (0x61, 0x3B),
53        (0x6E, 0x1F),
54        (0x7F, 0x07),
55        (0x42, 0x32),
56        (0x43, 0x00),
57        (0x7F, 0x0D),
58        (0x51, 0x00),
59        (0x52, 0x49),
60        (0x53, 0x00),
61        (0x54, 0x5B),
62        (0x55, 0x00),
63        (0x56, 0x64),
64        (0x57, 0x02),
65        (0x58, 0xA5),
66        (0x7F, 0x00),
67        (0x54, 0x54),
68        (0x78, 0x01),
69        (0x79, 0x9C),
70    ],
71    _0x40: Some(0x01),
72};
73
74pub const OFFICE_MODE: Mode = Mode {
75    commands: &[
76        (0x7F, 0x05),
77        (0x51, 0x28),
78        (0x53, 0x30),
79        (0x61, 0x3B),
80        (0x6E, 0x1F),
81        (0x7F, 0x07),
82        (0x42, 0x32),
83        (0x43, 0x00),
84        (0x7F, 0x0D),
85        (0x51, 0x00),
86        (0x52, 0x49),
87        (0x53, 0x00),
88        (0x54, 0x5B),
89        (0x55, 0x00),
90        (0x56, 0x64),
91        (0x57, 0x02),
92        (0x58, 0xA5),
93        (0x7F, 0x00),
94        (0x54, 0x52),
95        (0x78, 0x0A),
96        (0x79, 0x0F),
97    ],
98    _0x40: Some(0x02),
99};
100
101pub const CORDED_GAMING_MODE: Mode = Mode {
102    commands: &[
103        (0x7F, 0x05),
104        (0x51, 0x40),
105        (0x53, 0x40),
106        (0x61, 0x31),
107        (0x6E, 0x0F),
108        (0x7F, 0x07),
109        (0x42, 0x2F),
110        (0x43, 0x00),
111        (0x7F, 0x0D),
112        (0x51, 0x12),
113        (0x52, 0xDB),
114        (0x53, 0x12),
115        (0x54, 0xDC),
116        (0x55, 0x12),
117        (0x56, 0xEA),
118        (0x57, 0x15),
119        (0x58, 0x2D),
120        (0x7F, 0x00),
121        (0x54, 0x55),
122        (0x40, 0x83),
123    ],
124    _0x40: None,
125};
126
127#[derive(Clone, Copy)]
128pub enum LiftCutoff {
129    _1mm = 0b00,
130    _2mm = 0b10,
131}