SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
SensorPawA350_Reg.hpp
Go to the documentation of this file.
1
30#pragma once
31
32#include <stdint.h>
33
34namespace Paw350Regs
35{
36
37
38static constexpr uint8_t SOFTRESET_VAL = 0x5A;
39
40static constexpr uint8_t PAW_A350_DEFAULT_PID = 0x88;
41
42static constexpr uint8_t CPI_DEFAULT = 0x22;
43
44static constexpr uint8_t LED_DRV_13MA = 0;
45static constexpr uint8_t LED_DRV_9_6MA = 2;
46static constexpr uint8_t LED_DRV_27MA = 7;
47
48static constexpr uint16_t SHUTTER_MAX_DEFAULT = 0x0B71;
49
50static constexpr uint8_t MOTION_CTRL_THRESHOLD_MIN = 0;
51static constexpr uint8_t MOTION_CTRL_THRESHOLD_MAX = 7;
52
53static constexpr uint8_t REST1_PERIOD_MIN = 1;
54static constexpr uint16_t REST1_PERIOD_MAX = 256;
55
56static constexpr uint8_t REST2_PERIOD_MIN = 1;
57static constexpr uint16_t REST2_PERIOD_MAX = 256;
58
59static constexpr uint8_t REST3_PERIOD_MIN = 1;
60static constexpr uint16_t REST3_PERIOD_MAX = 256;
61
62static constexpr uint8_t DOWNSHIFT_TIME_MIN = 2;
63static constexpr uint8_t DOWNSHIFT_TIME_MAX = 242;
64
65// ==============================================
66// 0x00 (RO)
67// ==============================================
68// Register : PRODUCT_ID
69static constexpr uint8_t REG_PRODUCT_ID = 0x00;
70static constexpr uint8_t MASK_PID = 0xFF;
71static constexpr uint8_t SHIFT_PID = 0;
72
73// ==============================================
74// 0x01 (RO)
75// ==============================================
76// Register : REVISION_ID
77static constexpr uint8_t REG_REVISION_ID = 0x01;
78static constexpr uint8_t MASK_RID = 0xFF;
79static constexpr uint8_t SHIFT_RID = 0;
80
81// ==============================================
82// 0x02 (R/WC)
83// ==============================================
84// Register : EVENT
85static constexpr uint8_t REG_EVENT = 0x02;
86static constexpr uint8_t MASK_MOTION = 0x80;
87static constexpr uint8_t MASK_RESET_ST = 0x08;
88static constexpr uint8_t MASK_FPD_ST = 0x01;
89
90// ==============================================
91// 0x03 (RO)
92// ==============================================
93// Register : DELTA_X
94static constexpr uint8_t REG_DELTA_X = 0x03;
95static constexpr uint8_t MASK_DX = 0xFF;
96static constexpr uint8_t SHIFT_DX = 0;
97
98// ==============================================
99// 0x04 (RO)
100// ==============================================
101// Register : DELTA_Y
102static constexpr uint8_t REG_DELTA_Y = 0x04;
103static constexpr uint8_t MASK_DY = 0xFF;
104static constexpr uint8_t SHIFT_DY = 0;
105
106// ==============================================
107// 0x11 (RW)
108// ==============================================
109// Register : REST1_PERIOD
110static constexpr uint8_t REG_REST1_PERIOD = 0x11;
111static constexpr uint8_t MASK_R1R = 0xFF;
112static constexpr uint8_t SHIFT_R1R = 0;
113
114// ==============================================
115// 0x13 (RW)
116// ==============================================
117// Register : RUN_DOWNSHIFT
118static constexpr uint8_t REG_RUN_DOWNSHIFT = 0x13;
119static constexpr uint8_t MASK_RD = 0xFF;
120static constexpr uint8_t SHIFT_RD = 0;
121
122// ==============================================
123// 0x15 (RW)
124// ==============================================
125// Register : REST1_DOWNSHIFT
126static constexpr uint8_t REG_REST1_DOWNSHIFT = 0x15;
127static constexpr uint8_t MASK_R1D = 0xFF;
128static constexpr uint8_t SHIFT_R1D = 0;
129
130// ==============================================
131// 0x16 (RW)
132// ==============================================
133// Register : REST2_PERIOD
134static constexpr uint8_t REG_REST2_PERIOD = 0x16;
135static constexpr uint8_t MASK_R2R = 0xFF;
136static constexpr uint8_t SHIFT_R2R = 0;
137
138// ==============================================
139// 0x17 (RW)
140// ==============================================
141// Register : REST2_DOWNSHIFT
142static constexpr uint8_t REG_REST2_DOWNSHIFT = 0x17;
143static constexpr uint8_t MASK_R2D = 0xFF;
144static constexpr uint8_t SHIFT_R2D = 0;
145
146// ==============================================
147// 0x18 (RW)
148// ==============================================
149// Register : REST3_PERIOD
150static constexpr uint8_t REG_REST3_PERIOD = 0x18;
151static constexpr uint8_t MASK_R3R = 0xFF;
152static constexpr uint8_t SHIFT_R3R = 0;
153
154// ==============================================
155// 0x1A (RW)
156// ==============================================
157// Register : LED_CTRL
158static constexpr uint8_t REG_LED_CTRL = 0x1A;
159static constexpr uint8_t MASK_LED_ON = 0x08;
160static constexpr uint8_t MASK_LED_DRV = 0x07;
161static constexpr uint8_t SHIFT_LED_DRV = 0;
162
163// ==============================================
164// 0x3A (WO)
165// ==============================================
166// Register : SOFT_RESET
167static constexpr uint8_t REG_SOFT_RESET = 0x3A;
168static constexpr uint8_t MASK_SFRST = 0xFF;
169
170// ==============================================
171// 0x3B (RW)
172// ==============================================
173// Register : SHUTTER_MAX_HI
174static constexpr uint8_t REG_SHUTTER_MAX_HI = 0x3B;
175static constexpr uint8_t MASK_SMH = 0xFF;
176static constexpr uint8_t SHIFT_SMH = 0;
177
178// ==============================================
179// 0x3C (RW)
180// ==============================================
181// Register : SHUTTER_MAX_LO
182static constexpr uint8_t REG_SHUTTER_MAX_LO = 0x3C;
183static constexpr uint8_t MASK_SML = 0xFF;
184static constexpr uint8_t SHIFT_SML = 0;
185
186// ==============================================
187// 0x62 (RW)
188// ==============================================
189// Register : CPI_SEL
190static constexpr uint8_t REG_CPI_SEL = 0x62;
191static constexpr uint8_t MASK_CPI_SEL = 0x0F;
192static constexpr uint8_t SHIFT_CPI_SEL = 0;
193
194// ==============================================
195// 0x74 (RW)
196// ==============================================
197// Register : MOTION_CTRL
198static constexpr uint8_t REG_MOTION_CTRL = 0x74;
199static constexpr uint8_t MASK_MOTION_INT_THRES = 0x07;
200static constexpr uint8_t SHIFT_MOTION_INT_THRES = 0;
201
202// ==============================================
203// 0x7A (RO)
204// ==============================================
205// Register : FPD_FLAG
206static constexpr uint8_t REG_FPD_FLAG = 0x7A;
207static constexpr uint8_t MASK_FPD = 0x01;
208
209} // namespace Paw350Regs