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