no-OS
adpd410x.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef ADPD410X_H_
34 #define ADPD410X_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 
40 #include <stdbool.h>
41 #include "no_os_spi.h"
42 #include "no_os_i2c.h"
43 #include "no_os_gpio.h"
44 
45 /******************************************************************************/
46 /********************** Macros and Constants Definitions **********************/
47 /******************************************************************************/
48 
49 #define ADPD410X_REG_FIFO_STATUS 0x0000
50 #define ADPD410X_REG_INT_STATUS_DATA 0x0001
51 #define ADPD410X_REG_INT_STATUS_LEV0 0x0002
52 #define ADPD410X_REG_INT_STATUS_LEV1 0x0003
53 #define ADPD410X_REG_FIFO_TH 0x0006
54 #define ADPD410X_REG_INT_ACLEAR 0x0007
55 #define ADPD410X_REG_CHIP_ID 0x0008
56 #define ADPD410X_REG_OSC32M 0x0009
57 #define ADPD410X_REG_OSC32M_CAL 0x000A
58 #define ADPD410X_REG_OSC1M 0x000B
59 #define ADPD410X_REG_OSC32K 0x000C
60 #define ADPD410X_REG_TS_FREQ 0x000D
61 #define ADPD410X_REG_TS_FREQH 0x000E
62 #define ADPD410X_REG_SYS_CTL 0x000F
63 #define ADPD410X_REG_OPMODE 0x0010
64 #define ADPD410X_REG_STAMP_L 0x0011
65 #define ADPD410X_REG_STAMP_H 0x0012
66 #define ADPD410X_REG_STAMPDELTA 0x0013
67 #define ADPD410X_REG_INT_ENABLE_XD 0x0014
68 #define ADPD410X_REG_INT_ENABLE_YD 0x0015
69 #define ADPD410X_REG_INT_ENABLE_XL0 0x0016
70 #define ADPD410X_REG_INT_ENABLE_XL1 0x0017
71 #define ADPD410X_REG_INT_ENABLE_YL0 0x001a
72 #define ADPD410X_REG_INT_ENABLE_YL1 0x001b
73 #define ADPD410X_REG_FIFO_STATUS_BYTES 0x001e
74 #define ADPD410X_REG_INPUT_SLEEP 0x0020
75 #define ADPD410X_REG_INPUT_CFG 0x0021
76 #define ADPD410X_REG_GPIO_CFG 0x0022
77 #define ADPD410X_REG_GPIO01 0x0023
78 #define ADPD410X_REG_GPIO23 0x0024
79 #define ADPD410X_REG_GPIO_IN 0x0025
80 #define ADPD410X_REG_GPIO_EXT 0x0026
81 #define ADPD410X_REG_DATA_HOLD_FLAG 0x002E
82 #define ADPD410X_REG_FIFO_DATA 0x002F
83 #define ADPD410X_REG_SIGNAL1_L(ts) (0x0030 + (ts) * 0x08)
84 #define ADPD410X_REG_SIGNAL1_H(ts) (0x0031 + (ts) * 0x08)
85 #define ADPD410X_REG_SIGNAL2_L(ts) (0x0032 + (ts) * 0x08)
86 #define ADPD410X_REG_SIGNAL2_H(ts) (0x0033 + (ts) * 0x08)
87 #define ADPD410X_REG_DARK1_L(ts) (0x0034 + (ts) * 0x08)
88 #define ADPD410X_REG_DARK1_H(ts) (0x0035 + (ts) * 0x08)
89 #define ADPD410X_REG_DARK2_L(ts) (0x0036 + (ts) * 0x08)
90 #define ADPD410X_REG_DARK2_H(ts) (0x0037 + (ts) * 0x08)
91 #define ADPD410X_REG_IO_ADJUST 0x00B4
92 #define ADPD410X_REG_I2C_KEY 0x00B6
93 #define ADPD410X_REG_I2C_ADDR 0x00B7
94 #define ADPD410X_REG_TS_CTRL(ts) (0x0100 + (ts) * 0x20)
95 #define ADPD410X_REG_TS_PATH(ts) (0x0101 + (ts) * 0x20)
96 #define ADPD410X_REG_INPUTS(ts) (0x0102 + (ts) * 0x20)
97 #define ADPD410X_REG_CATHODE(ts) (0x0103 + (ts) * 0x20)
98 #define ADPD410X_REG_AFE_TRIM(ts) (0x0104 + (ts) * 0x20)
99 #define ADPD410X_REG_LED_POW12(ts) (0x0105 + (ts) * 0x20)
100 #define ADPD410X_REG_LED_POW34(ts) (0x0106 + (ts) * 0x20)
101 #define ADPD410X_REG_COUNTS(ts) (0x0107 + (ts) * 0x20)
102 #define ADPD410X_REG_PERIOD(ts) (0x0108 + (ts) * 0x20)
103 #define ADPD410X_REG_LED_PULSE(ts) (0x0109 + (ts) * 0x20)
104 #define ADPD410X_REG_INTEG_WIDTH(ts) (0x010A + (ts) * 0x20)
105 #define ADPD410X_REG_INTEG_OFFSET(ts) (0x010B + (ts) * 0x20)
106 #define ADPD410X_REG_MOD_PULSE(ts) (0x010C + (ts) * 0x20)
107 #define ADPD410X_REG_PATTERN(ts) (0x010D + (ts) * 0x20)
108 #define ADPD410X_REG_ADC_OFF1(ts) (0x010E + (ts) * 0x20)
109 #define ADPD410X_REG_ADC_OFF2(ts) (0x010F + (ts) * 0x20)
110 #define ADPD410X_REG_DATA1(ts) (0x0110 + (ts) * 0x20)
111 #define ADPD410X_REG_DATA2(ts) (0x0111 + (ts) * 0x20)
112 #define ADPD410X_REG_DECIMATE(ts) (0x0112 + (ts) * 0x20)
113 #define ADPD410X_REG_DIGINT_LIT(ts) (0x0113 + (ts) * 0x20)
114 #define ADPD410X_REG_DIGINT_DARK(ts) (0x0114 + (ts) * 0x20)
115 #define ADPD410X_REG_THRESH_CFG(ts) (0x0115 + (ts) * 0x20)
116 #define ADPD410X_REG_THRESH0(ts) (0x0116 + (ts) * 0x20)
117 #define ADPD410X_REG_THRESH1(ts) (0x0117 + (ts) * 0x20)
118 
119 
120 /* ADPD410X_REG_FIFO_STATUS */
121 #define BITP_INT_STATUS_FIFO_FIFO_BYTE_COUNT 0
122 #define BITP_INT_STATUS_FIFO_INT_FIFO_OFLOW 13
123 #define BITP_INT_STATUS_FIFO_INT_FIFO_UFLOW 14
124 #define BITP_INT_STATUS_FIFO_CLEAR_FIFO 15
125 #define BITM_INT_STATUS_FIFO_FIFO_BYTE_COUNT 0x07ff
126 #define BITM_INT_STATUS_FIFO_INT_FIFO_OFLOW 0x2000
127 #define BITM_INT_STATUS_FIFO_INT_FIFO_UFLOW 0x4000
128 #define BITM_INT_STATUS_FIFO_CLEAR_FIFO 0x8000
129 
130 
131 /* ADPD410X_REG_INT_STATUS_DATA */
132 #define BITP_INT_STATUS_DATA_INT_DATA_A 0
133 #define BITP_INT_STATUS_DATA_INT_DATA_B 1
134 #define BITP_INT_STATUS_DATA_INT_DATA_C 2
135 #define BITP_INT_STATUS_DATA_INT_DATA_D 3
136 #define BITP_INT_STATUS_DATA_INT_DATA_E 4
137 #define BITP_INT_STATUS_DATA_INT_DATA_F 5
138 #define BITP_INT_STATUS_DATA_INT_DATA_G 6
139 #define BITP_INT_STATUS_DATA_INT_DATA_H 7
140 #define BITP_INT_STATUS_DATA_INT_DATA_I 8
141 #define BITP_INT_STATUS_DATA_INT_DATA_J 9
142 #define BITP_INT_STATUS_DATA_INT_DATA_K 10
143 #define BITP_INT_STATUS_DATA_INT_DATA_L 11
144 #define BITP_INT_STATUS_DATA_INT_FIFO_TH 15
145 #define BITM_INT_STATUS_DATA_INT_DATA_A 0x0001
146 #define BITM_INT_STATUS_DATA_INT_DATA_B 0x0002
147 #define BITM_INT_STATUS_DATA_INT_DATA_C 0x0004
148 #define BITM_INT_STATUS_DATA_INT_DATA_D 0x0008
149 #define BITM_INT_STATUS_DATA_INT_DATA_E 0x0010
150 #define BITM_INT_STATUS_DATA_INT_DATA_F 0x0020
151 #define BITM_INT_STATUS_DATA_INT_DATA_G 0x0040
152 #define BITM_INT_STATUS_DATA_INT_DATA_H 0x0080
153 #define BITM_INT_STATUS_DATA_INT_DATA_I 0x0100
154 #define BITM_INT_STATUS_DATA_INT_DATA_J 0x0200
155 #define BITM_INT_STATUS_DATA_INT_DATA_K 0x0400
156 #define BITM_INT_STATUS_DATA_INT_DATA_L 0x0800
157 #define BITM_INT_STATUS_DATA_INT_FIFO_TH 0x8000
158 
159 /* ADPD410X_REG_INT_STATUS_LEV0 */
160 #define BITP_INT_STATUS_LEV0_INT_LEV0_A 0
161 #define BITP_INT_STATUS_LEV0_INT_LEV0_B 1
162 #define BITP_INT_STATUS_LEV0_INT_LEV0_C 2
163 #define BITP_INT_STATUS_LEV0_INT_LEV0_D 3
164 #define BITP_INT_STATUS_LEV0_INT_LEV0_E 4
165 #define BITP_INT_STATUS_LEV0_INT_LEV0_F 5
166 #define BITP_INT_STATUS_LEV0_INT_LEV0_G 6
167 #define BITP_INT_STATUS_LEV0_INT_LEV0_H 7
168 #define BITP_INT_STATUS_LEV0_INT_LEV0_I 8
169 #define BITP_INT_STATUS_LEV0_INT_LEV0_J 9
170 #define BITP_INT_STATUS_LEV0_INT_LEV0_K 10
171 #define BITP_INT_STATUS_LEV0_INT_LEV0_L 11
172 #define BITM_INT_STATUS_LEV0_INT_LEV0_A 0x0001
173 #define BITM_INT_STATUS_LEV0_INT_LEV0_B 0x0002
174 #define BITM_INT_STATUS_LEV0_INT_LEV0_C 0x0004
175 #define BITM_INT_STATUS_LEV0_INT_LEV0_D 0x0008
176 #define BITM_INT_STATUS_LEV0_INT_LEV0_E 0x0010
177 #define BITM_INT_STATUS_LEV0_INT_LEV0_F 0x0020
178 #define BITM_INT_STATUS_LEV0_INT_LEV0_G 0x0040
179 #define BITM_INT_STATUS_LEV0_INT_LEV0_H 0x0080
180 #define BITM_INT_STATUS_LEV0_INT_LEV0_I 0x0100
181 #define BITM_INT_STATUS_LEV0_INT_LEV0_J 0x0200
182 #define BITM_INT_STATUS_LEV0_INT_LEV0_K 0x0400
183 #define BITM_INT_STATUS_LEV0_INT_LEV0_L 0x0800
184 
185 /* ADPD410X_REG_INT_STATUS_LEV1 */
186 #define BITP_INT_STATUS_LEV1_INT_LEV1_A 0
187 #define BITP_INT_STATUS_LEV1_INT_LEV1_B 1
188 #define BITP_INT_STATUS_LEV1_INT_LEV1_C 2
189 #define BITP_INT_STATUS_LEV1_INT_LEV1_D 3
190 #define BITP_INT_STATUS_LEV1_INT_LEV1_E 4
191 #define BITP_INT_STATUS_LEV1_INT_LEV1_F 5
192 #define BITP_INT_STATUS_LEV1_INT_LEV1_G 6
193 #define BITP_INT_STATUS_LEV1_INT_LEV1_H 7
194 #define BITP_INT_STATUS_LEV1_INT_LEV1_I 8
195 #define BITP_INT_STATUS_LEV1_INT_LEV1_J 9
196 #define BITP_INT_STATUS_LEV1_INT_LEV1_K 10
197 #define BITP_INT_STATUS_LEV1_INT_LEV1_L 11
198 #define BITM_INT_STATUS_LEV1_INT_LEV1_A 0x0001
199 #define BITM_INT_STATUS_LEV1_INT_LEV1_B 0x0002
200 #define BITM_INT_STATUS_LEV1_INT_LEV1_C 0x0004
201 #define BITM_INT_STATUS_LEV1_INT_LEV1_D 0x0008
202 #define BITM_INT_STATUS_LEV1_INT_LEV1_E 0x0010
203 #define BITM_INT_STATUS_LEV1_INT_LEV1_F 0x0020
204 #define BITM_INT_STATUS_LEV1_INT_LEV1_G 0x0040
205 #define BITM_INT_STATUS_LEV1_INT_LEV1_H 0x0080
206 #define BITM_INT_STATUS_LEV1_INT_LEV1_I 0x0100
207 #define BITM_INT_STATUS_LEV1_INT_LEV1_J 0x0200
208 #define BITM_INT_STATUS_LEV1_INT_LEV1_K 0x0400
209 #define BITM_INT_STATUS_LEV1_INT_LEV1_L 0x0800
210 
211 
212 /* ADPD410X_REG_FIFO_TH */
213 #define BITP_FIFO_CTL_FIFO_TH 0
214 #define BITM_FIFO_CTL_FIFO_TH 0x03ff
215 
216 /* ADPD410X_REG_INT_ACLEAR */
217 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_A 0
218 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_B 1
219 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_C 2
220 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_D 3
221 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_E 4
222 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_F 5
223 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_G 6
224 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_H 7
225 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_I 8
226 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_J 9
227 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_K 10
228 #define BITP_INT_ACLEAR_INT_ACLEAR_DATA_L 11
229 #define BITP_INT_ACLEAR_INT_ACLEAR_FIFO 15
230 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_A 0x0001
231 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_B 0x0002
232 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_C 0x0004
233 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_D 0x0008
234 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_E 0x0010
235 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_F 0x0020
236 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_G 0x0040
237 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_H 0x0080
238 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_I 0x0100
239 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_J 0x0200
240 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_K 0x0400
241 #define BITM_INT_ACLEAR_INT_ACLEAR_DATA_L 0x0800
242 #define BITM_INT_ACLEAR_INT_ACLEAR_FIFO 0x8000
243 
244 /* ADPD410X_REG_CHIP_ID */
245 #define BITP_CHIP_ID 0
246 #define BITP_CHIP_VERSION 8
247 #define BITM_CHIP_ID 0x00ff
248 #define BITM_CHIP_VERSION 0xff00
249 #define ADPD410X_CHIP_ID 0xC2
250 
251 /* ADPD410X_REG_OSC32M */
252 #define BITP_OSC32M_OSC_32M_FREQ_ADJ 0
253 #define BITM_OSC32M_OSC_32M_FREQ_ADJ 0x00ff
254 
255 /* ADPD410X_REG_OSC32M_CAL */
256 #define BITP_OSC32M_CAL_OSC_32M_CAL_COUNT 0
257 #define BITP_OSC32M_CAL_OSC_32M_CAL_START 15
258 #define BITM_OSC32M_CAL_OSC_32M_CAL_COUNT 0x7fff
259 #define BITM_OSC32M_CAL_OSC_32M_CAL_START 0x8000
260 
261 /* ADPD410X_REG_OSC1M */
262 #define BITP_OSC1M_OSC_1M_FREQ_ADJ 0
263 #define BITP_OSC1M_OSC_CLK_CAL_ENA 10
264 #define BITM_OSC1M_OSC_1M_FREQ_ADJ 0x03ff
265 #define BITM_OSC1M_OSC_CLK_CAL_ENA 0x0400
266 
267 /* ADPD410X_REG_OSC32K */
268 #define BITP_OSC32K_OSC_32K_ADJUST 0
269 #define BITP_OSC32K_CAPTURE_TIMESTAMP 15
270 #define BITM_OSC32K_OSC_32K_ADJUST 0x003f
271 #define BITM_OSC32K_CAPTURE_TIMESTAMP 0x8000
272 
273 /* ADPD410X_REG_TS_FREQ */
274 #define BITP_TS_FREQ_TIMESLOT_PERIOD_L 0
275 #define BITM_TS_FREQ_TIMESLOT_PERIOD_L 0xffff
276 
277 /* ADPD410X_REG_TS_FREQH */
278 #define BITP_TS_FREQH_TIMESLOT_PERIOD_H 0
279 #define BITM_TS_FREQH_TIMESLOT_PERIOD_H 0x007f
280 
281 /* ADPD410X_REG_SYS_CTL */
282 #define BITP_SYS_CTL_OSC_32K_EN 0
283 #define BITP_SYS_CTL_OSC_1M_EN 1
284 #define BITP_SYS_CTL_LFOSC_SEL 2
285 #define BITP_SYS_CTL_RANDOM_SLEEP 3
286 #define BITP_SYS_CTL_GO_SLEEP 4
287 #define BITP_SYS_CTL_ALT_CLK_GPIO 6
288 #define BITP_SYS_CTL_ALT_CLOCKS 8
289 #define BITP_SYS_CTL_SW_RESET 15
290 #define BITM_SYS_CTL_OSC_32K_EN 0x0001
291 #define BITM_SYS_CTL_OSC_1M_EN 0x0002
292 #define BITM_SYS_CTL_LFOSC_SEL 0x0004
293 #define BITM_SYS_CTL_RANDOM_SLEEP 0x0008
294 #define BITM_SYS_CTL_GO_SLEEP 0x0010
295 #define BITM_SYS_CTL_ALT_CLK_GPIO 0x00c0
296 #define BITM_SYS_CTL_ALT_CLOCKS 0x0300
297 #define BITM_SYS_CTL_SW_RESET 0x8000
298 
299 /* ADPD410X_REG_OPMODE */
300 #define BITP_OPMODE_OP_MODE 0
301 #define BITP_OPMODE_TIMESLOT_EN 8
302 #define BITM_OPMODE_OP_MODE 0x0001
303 #define BITM_OPMODE_TIMESLOT_EN 0x0f00
304 
305 /* ADPD410X_REG_STAMP_L */
306 #define BITP_STAMP_L_TIMESTAMP_COUNT_L 0
307 #define BITM_STAMP_L_TIMESTAMP_COUNT_L 0xffff
308 
309 /* ADPD410X_REG_STAMP_H */
310 #define BITP_STAMP_H_TIMESTAMP_COUNT_H 0
311 #define BITM_STAMP_H_TIMESTAMP_COUNT_H 0xffff
312 
313 /* ADPD410X_REG_STAMPDELTA */
314 #define BITP_STAMPDELTA_TIMESTAMP_SLOT_DELTA 0
315 #define BITM_STAMPDELTA_TIMESTAMP_SLOT_DELTA 0xffff
316 
317 /* ADPD410X_REG_INT_ENABLE_XD */
318 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_A 0
319 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_B 1
320 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_C 2
321 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_D 3
322 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_E 4
323 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_F 5
324 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_G 6
325 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_H 7
326 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_I 8
327 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_J 9
328 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_K 10
329 #define BITP_INT_ENABLE_XD_INTX_EN_DATA_L 11
330 #define BITP_INT_ENABLE_XD_INTX_EN_FIFO_OFLOW 13
331 #define BITP_INT_ENABLE_XD_INTX_EN_FIFO_UFLOW 14
332 #define BITP_INT_ENABLE_XD_INTX_EN_FIFO_TH 15
333 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_A 0x0001
334 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_B 0x0002
335 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_C 0x0004
336 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_D 0x0008
337 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_E 0x0010
338 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_F 0x0020
339 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_G 0x0040
340 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_H 0x0080
341 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_I 0x0100
342 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_J 0x0200
343 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_K 0x0400
344 #define BITM_INT_ENABLE_XD_INTX_EN_DATA_L 0x0800
345 #define BITM_INT_ENABLE_XD_INTX_EN_FIFO_OFLOW 0x2000
346 #define BITM_INT_ENABLE_XD_INTX_EN_FIFO_UFLOW 0x4000
347 #define BITM_INT_ENABLE_XD_INTX_EN_FIFO_TH 0x8000
348 
349 /* ADPD410X_REG_INT_ENABLE_YD */
350 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_A 0
351 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_B 1
352 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_C 2
353 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_D 3
354 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_E 4
355 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_F 5
356 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_G 6
357 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_H 7
358 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_I 8
359 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_J 9
360 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_K 10
361 #define BITP_INT_ENABLE_YD_INTY_EN_DATA_L 11
362 #define BITP_INT_ENABLE_YD_INTY_EN_FIFO_OFLOW 13
363 #define BITP_INT_ENABLE_YD_INTY_EN_FIFO_UFLOW 14
364 #define BITP_INT_ENABLE_YD_INTY_EN_FIFO_TH 15
365 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_A 0x0001
366 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_B 0x0002
367 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_C 0x0004
368 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_D 0x0008
369 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_E 0x0010
370 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_F 0x0020
371 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_G 0x0040
372 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_H 0x0080
373 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_I 0x0100
374 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_J 0x0200
375 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_K 0x0400
376 #define BITM_INT_ENABLE_YD_INTY_EN_DATA_L 0x0800
377 #define BITM_INT_ENABLE_YD_INTY_EN_FIFO_OFLOW 0x2000
378 #define BITM_INT_ENABLE_YD_INTY_EN_FIFO_UFLOW 0x4000
379 #define BITM_INT_ENABLE_YD_INTY_EN_FIFO_TH 0x8000
380 
381 /* ADPD410X_REG_INT_ENABLE_XL0 */
382 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_A 0
383 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_B 1
384 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_C 2
385 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_D 3
386 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_E 4
387 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_F 5
388 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_G 6
389 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_H 7
390 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_I 8
391 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_J 9
392 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_K 10
393 #define BITP_INT_ENABLE_XL0_INTX_EN_LEV0_L 11
394 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_A 0x0001
395 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_B 0x0002
396 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_C 0x0004
397 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_D 0x0008
398 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_E 0x0010
399 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_F 0x0020
400 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_G 0x0040
401 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_H 0x0080
402 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_I 0x0100
403 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_J 0x0200
404 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_K 0x0400
405 #define BITM_INT_ENABLE_XL0_INTX_EN_LEV0_L 0x0800
406 
407 /* ADPD410X_REG_INT_ENABLE_XL1 */
408 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_A 0
409 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_B 1
410 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_C 2
411 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_D 3
412 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_E 4
413 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_F 5
414 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_G 6
415 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_H 7
416 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_I 8
417 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_J 9
418 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_K 10
419 #define BITP_INT_ENABLE_XL1_INTX_EN_LEV1_L 11
420 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_A 0x0001
421 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_B 0x0002
422 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_C 0x0004
423 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_D 0x0008
424 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_E 0x0010
425 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_F 0x0020
426 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_G 0x0040
427 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_H 0x0080
428 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_I 0x0100
429 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_J 0x0200
430 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_K 0x0400
431 #define BITM_INT_ENABLE_XL1_INTX_EN_LEV1_L 0x0800
432 
433 /* ADPD410X_REG_INT_ENABLE_YL0 */
434 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_A 0
435 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_B 1
436 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_C 2
437 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_D 3
438 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_E 4
439 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_F 5
440 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_G 6
441 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_H 7
442 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_I 8
443 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_J 9
444 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_K 10
445 #define BITP_INT_ENABLE_YL0_INTY_EN_LEV0_L 11
446 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_A 0x0001
447 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_B 0x0002
448 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_C 0x0004
449 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_D 0x0008
450 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_E 0x0010
451 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_F 0x0020
452 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_G 0x0040
453 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_H 0x0080
454 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_I 0x0100
455 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_J 0x0200
456 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_K 0x0400
457 #define BITM_INT_ENABLE_YL0_INTY_EN_LEV0_L 0x0800
458 
459 /* ADPD410X_REG_INT_ENABLE_YL1 */
460 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_A 0
461 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_B 1
462 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_C 2
463 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_D 3
464 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_E 4
465 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_F 5
466 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_G 6
467 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_H 7
468 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_I 8
469 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_J 9
470 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_K 10
471 #define BITP_INT_ENABLE_YL1_INTY_EN_LEV1_L 11
472 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_A 0x0001
473 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_B 0x0002
474 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_C 0x0004
475 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_D 0x0008
476 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_E 0x0010
477 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_F 0x0020
478 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_G 0x0040
479 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_H 0x0080
480 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_I 0x0100
481 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_J 0x0200
482 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_K 0x0400
483 #define BITM_INT_ENABLE_YL1_INTY_EN_LEV1_L 0x0800
484 
485 /* ADPD410X_REG_FIFO_STATUS_BYTES */
486 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_SUM 0
487 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_D1 1
488 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_D2 2
489 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_L0 3
490 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_L1 4
491 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_LX 5
492 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_TS1 6
493 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_TS2 7
494 #define BITP_FIFO_STATUS_BYTES_ENA_STAT_TSX 8
495 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_SUM 0x0001
496 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_D1 0x0002
497 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_D2 0x0004
498 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_L0 0x0008
499 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_L1 0x0010
500 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_LX 0x0020
501 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_TS1 0x0040
502 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_TS2 0x0080
503 #define BITM_FIFO_STATUS_BYTES_ENA_STAT_TSX 0x0100
504 
505 /* ADPD410X_REG_INPUT_SLEEP */
506 #define BITP_INPUT_SLEEP_INP_SLEEP_12 0
507 #define BITP_INPUT_SLEEP_INP_SLEEP_34 4
508 #define BITP_INPUT_SLEEP_INP_SLEEP_56 8
509 #define BITP_INPUT_SLEEP_INP_SLEEP_78 12
510 #define BITM_INPUT_SLEEP_INP_SLEEP_12 0x000f
511 #define BITM_INPUT_SLEEP_INP_SLEEP_34 0x00f0
512 #define BITM_INPUT_SLEEP_INP_SLEEP_56 0x0f00
513 #define BITM_INPUT_SLEEP_INP_SLEEP_78 0xf000
514 
515 /* ADPD410X_REG_INPUT_CFG */
516 #define BITP_INPUT_CFG_PAIR12 0
517 #define BITP_INPUT_CFG_PAIR34 1
518 #define BITP_INPUT_CFG_PAIR56 2
519 #define BITP_INPUT_CFG_PAIR78 3
520 #define BITP_INPUT_CFG_VC1_SLEEP 4
521 #define BITP_INPUT_CFG_VC2_SLEEP 6
522 #define BITM_INPUT_CFG_PAIR12 0
523 #define BITM_INPUT_CFG_PAIR34 0x0002
524 #define BITM_INPUT_CFG_PAIR56 0x0004
525 #define BITM_INPUT_CFG_PAIR78 0x0008
526 #define BITM_INPUT_CFG_VC1_SLEEP 0x0030
527 #define BITM_INPUT_CFG_VC2_SLEEP 0x00c0
528 
529 /* ADPD410X_REG_GPIO_CFG */
530 #define BITP_GPIO_CFG_GPIO_PIN_CFG0 0
531 #define BITP_GPIO_CFG_GPIO_PIN_CFG1 3
532 #define BITP_GPIO_CFG_GPIO_PIN_CFG2 6
533 #define BITP_GPIO_CFG_GPIO_PIN_CFG3 9
534 #define BITP_GPIO_CFG_GPIO_DRV 12
535 #define BITP_GPIO_CFG_GPIO_SLEW 14
536 #define BITM_GPIO_CFG_GPIO_PIN_CFG0 0x0007
537 #define BITM_GPIO_CFG_GPIO_PIN_CFG1 0x0038
538 #define BITM_GPIO_CFG_GPIO_PIN_CFG2 0x01c0
539 #define BITM_GPIO_CFG_GPIO_PIN_CFG3 0x0e00
540 #define BITM_GPIO_CFG_GPIO_DRV 0x3000
541 #define BITM_GPIO_CFG_GPIO_SLEW 0xc000
542 
543 /* ADPD410X_REG_GPIO01 */
544 #define BITP_GPIO01_GPIOOUT0 0
545 #define BITP_GPIO01_GPIOOUT1 8
546 #define BITP_GPIO01_TIMESTAMP_INV 14
547 #define BITP_GPIO01_TIMESTAMP_ALWAYS_EN 15
548 #define BITM_GPIO01_GPIOOUT0 0x001f
549 #define BITM_GPIO01_GPIOOUT1 0x1f00
550 #define BITM_GPIO01_TIMESTAMP_INV 0x4000
551 #define BITM_GPIO01_TIMESTAMP_ALWAYS_EN 0x8000
552 
553 /* ADPD410X_REG_GPIO23 */
554 #define BITP_GPIO23_GPIOOUT2 0
555 #define BITP_GPIO23_GPIOOUT3 8
556 #define BITP_GPIO23_EXT_SYNC_EN 14
557 #define BITM_GPIO23_GPIOOUT2 0x001f
558 #define BITM_GPIO23_GPIOOUT3 0x1f00
559 #define BITM_GPIO23_EXT_SYNC_EN 0x4000
560 
561 /* ADPD410X_REG_GPIO_IN */
562 #define BITP_GPIO_IN_GPIO_INPUT 0
563 #define BITM_GPIO_IN_GPIO_INPUT 0x000f
564 
565 /* ADPD410X_REG_GPIO_EXT */
566 #define BITP_GPIO_EXT_EXT_SYNC_GPIO 0
567 #define BITP_GPIO_EXT_EXT_SYNC_EN 2
568 #define BITP_GPIO_EXT_TIMESTAMP_GPIO 4
569 #define BITP_GPIO_EXT_TIMESTAMP_ALWAYS_EN 6
570 #define BITP_GPIO_EXT_TIMESTAMP_INV 7
571 #define BITP_GPIO_EXT_TS_GPIO_SLEEP 8
572 #define BITM_GPIO_EXT_EXT_SYNC_GPIO 0x0003
573 #define BITM_GPIO_EXT_EXT_SYNC_EN 0x0004
574 #define BITM_GPIO_EXT_TIMESTAMP_GPIO 0x0030
575 #define BITM_GPIO_EXT_TIMESTAMP_ALWAYS_EN 0x0040
576 #define BITM_GPIO_EXT_TIMESTAMP_INV 0x0080
577 #define BITM_GPIO_EXT_TS_GPIO_SLEEP 0x0100
578 
579 /* ADPD410X_REG_DATA_HOLD_FLAG */
580 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_A 0
581 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_B 1
582 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_C 2
583 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_D 3
584 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_E 4
585 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_F 5
586 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_G 6
587 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_H 7
588 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_I 8
589 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_J 9
590 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_K 10
591 #define BITP_DATA_HOLD_FLAG_HOLD_REGS_L 11
592 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_A 0x0001
593 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_B 0x0002
594 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_C 0x0004
595 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_D 0x0008
596 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_E 0x0010
597 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_F 0x0020
598 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_G 0x0040
599 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_H 0x0080
600 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_I 0x0100
601 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_J 0x0200
602 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_K 0x0400
603 #define BITM_DATA_HOLD_FLAG_HOLD_REGS_L 0x0800
604 
605 /* ADPD410X_REG_FIFO_DATA */
606 #define BITP_FIFO_DATA_FIFO_DATA 0
607 #define BITM_FIFO_DATA_FIFO_DATA 0xffff
608 
609 /* ADPD410X_REG_SIGNAL1_L */
610 #define BITP_SIGNAL1_L_A_SIGNAL1_L 0
611 #define BITM_SIGNAL1_L_A_SIGNAL1_L 0xffff
612 
613 /* ADPD410X_REG_SIGNAL1_H */
614 #define BITP_SIGNAL1_H_A_SIGNAL1_H 0
615 #define BITM_SIGNAL1_H_A_SIGNAL1_H 0xffff
616 
617 /* ADPD410X_REG_SIGNAL2_L */
618 #define BITP_SIGNAL2_L_A_SIGNAL2_L 0
619 #define BITM_SIGNAL2_L_A_SIGNAL2_L 0xffff
620 
621 /* ADPD410X_REG_SIGNAL2_H */
622 #define BITP_SIGNAL2_H_A_SIGNAL2_H 0
623 #define BITM_SIGNAL2_H_A_SIGNAL2_H 0xffff
624 
625 /* ADPD410X_REG_DARK1_L */
626 #define BITP_DARK1_L_A_DARK1_L 0
627 #define BITM_DARK1_L_A_DARK1_L 0xffff
628 
629 /* ADPD410X_REG_DARK1_H */
630 #define BITP_DARK1_H_A_DARK1_H 0
631 #define BITM_DARK1_H_A_DARK1_H 0xffff
632 
633 /* ADPD410X_REG_DARK2_L */
634 #define BITP_DARK2_L_A_DARK2_L 0
635 #define BITM_DARK2_L_A_DARK2_L 0xffff
636 
637 /* ADPD410X_REG_DARK2_H */
638 #define BITP_DARK2_H_A_DARK2_H 0
639 #define BITM_DARK2_H_A_DARK2_H 0xffff
640 
641 /* ADPD410X_REG_IO_ADJUST */
642 #define BITP_IO_ADJUST_SPI_DRV 0
643 #define BITP_IO_ADJUST_SPI_SLEW 2
644 #define BITM_IO_ADJUST_SPI_DRV 0x0003
645 #define BITM_IO_ADJUST_SPI_SLEW 0x000c
646 
647 /* ADPD410X_REG_I2C_KEY */
648 #define BITP_I2C_KEY_I2C_KEY 0
649 #define BITP_I2C_KEY_I2C_KEY_MATCH 12
650 #define BITM_I2C_KEY_I2C_KEY 0x0fff
651 #define BITM_I2C_KEY_I2C_KEY_MATCH 0xf000
652 
653 /* ADPD410X_REG_I2C_ADDR */
654 #define BITP_I2C_ADDR_I2C_SLAVE_ADDR 1
655 #define BITP_I2C_ADDR_I2C_SLAVE_KEY2 8
656 #define BITM_I2C_ADDR_I2C_SLAVE_ADDR 0x00fe
657 #define BITM_I2C_ADDR_I2C_SLAVE_KEY2 0xff00
658 
659 /* ADPD410X_REG_TS_CTRL */
660 #define BITP_TS_CTRL_A_TIMESLOT_OFFSET 0
661 #define BITP_TS_CTRL_A_INPUT_R_SELECT 10
662 #define BITP_TS_CTRL_A_SAMPLE_TYPE 12
663 #define BITP_TS_CTRL_A_CH2_EN 14
664 #define BITP_TS_CTRL_A_SUBSAMPLE 15
665 #define BITM_TS_CTRL_A_TIMESLOT_OFFSET 0x03ff
666 #define BITM_TS_CTRL_A_INPUT_R_SELECT 0x0c00
667 #define BITM_TS_CTRL_A_SAMPLE_TYPE 0x3000
668 #define BITM_TS_CTRL_A_CH2_EN 0x4000
669 #define BITM_TS_CTRL_A_SUBSAMPLE 0x8000
670 
671 /* ADPD410X_REG_TS_PATH */
672 #define BITP_TS_PATH_A_AFE_PATH_CFG 0
673 #define BITP_TS_PATH_A_PRE_WIDTH 12
674 #define BITM_TS_PATH_A_AFE_PATH_CFG 0x01ff
675 #define BITM_TS_PATH_A_PRE_WIDTH 0xf000
676 
677 /* ADPD410X_REG_INPUTS */
678 #define BITP_INPUTS_A_INP12 0
679 #define BITP_INPUTS_A_INP34 4
680 #define BITP_INPUTS_A_INP56 8
681 #define BITP_INPUTS_A_INP78 12
682 #define BITM_INPUTS_A_INP12 0x000f
683 #define BITM_INPUTS_A_INP34 0x00f0
684 #define BITM_INPUTS_A_INP56 0x0f00
685 #define BITM_INPUTS_A_INP78 0xf000
686 
687 /* ADPD410X_REG_CATHODE */
688 #define BITP_CATHODE_A_VC1_SEL 0
689 #define BITP_CATHODE_A_VC1_ALT 2
690 #define BITP_CATHODE_A_VC1_PULSE 4
691 #define BITP_CATHODE_A_VC2_SEL 6
692 #define BITP_CATHODE_A_VC2_ALT 8
693 #define BITP_CATHODE_A_VC2_PULSE 10
694 #define BITP_CATHODE_A_PRECON 12
695 #define BITM_CATHODE_A_VC1_SEL 0x0003
696 #define BITM_CATHODE_A_VC1_ALT 0x000c
697 #define BITM_CATHODE_A_VC1_PULSE 0x0030
698 #define BITM_CATHODE_A_VC2_SEL 0x00c0
699 #define BITM_CATHODE_A_VC2_ALT 0x0300
700 #define BITM_CATHODE_A_VC2_PULSE 0x0c00
701 #define BITM_CATHODE_A_PRECON 0x7000
702 
703 /* ADPD410X_REG_AFE_TRIM */
704 #define BITP_AFE_TRIM_A_TIA_GAIN_CH1 0
705 #define BITP_AFE_TRIM_A_TIA_GAIN_CH2 3
706 #define BITP_AFE_TRIM_A_VREF_PULSE_VAL 6
707 #define BITP_AFE_TRIM_A_AFE_TRIM_VREF 8
708 #define BITP_AFE_TRIM_A_VREF_PULSE 10
709 #define BITP_AFE_TRIM_A_CH1_TRIM_INT 11
710 #define BITP_AFE_TRIM_A_CH2_TRIM_INT 13
711 #define BITP_AFE_TRIM_A_TIA_CEIL_DETECT_EN 15
712 #define BITM_AFE_TRIM_A_TIA_GAIN_CH1 0x0007
713 #define BITM_AFE_TRIM_A_TIA_GAIN_CH2 0x0038
714 #define BITM_AFE_TRIM_A_VREF_PULSE_VAL 0x00c0
715 #define BITM_AFE_TRIM_A_AFE_TRIM_VREF 0x0300
716 #define BITM_AFE_TRIM_A_VREF_PULSE 0x0400
717 #define BITM_AFE_TRIM_A_CH1_TRIM_INT 0x1800
718 #define BITM_AFE_TRIM_A_CH2_TRIM_INT 0x6000
719 #define BITM_AFE_TRIM_A_TIA_CEIL_DETECT_EN 0x8000
720 
721 /* ADPD410X_REG_LED_POW12 */
722 #define BITP_LED_POW12_A_LED_CURRENT1 0
723 #define BITP_LED_POW12_A_LED_DRIVESIDE1 7
724 #define BITP_LED_POW12_A_LED_CURRENT2 8
725 #define BITP_LED_POW12_A_LED_DRIVESIDE2 15
726 #define BITM_LED_POW12_A_LED_CURRENT1 0x007f
727 #define BITM_LED_POW12_A_LED_DRIVESIDE1 0x0080
728 #define BITM_LED_POW12_A_LED_CURRENT2 0x7f00
729 #define BITM_LED_POW12_A_LED_DRIVESIDE2 0x8000
730 
731 /* ADPD410X_REG_LED_POW34 */
732 #define BITP_LED_POW34_A_LED_CURRENT3 0
733 #define BITP_LED_POW34_A_LED_DRIVESIDE3 7
734 #define BITP_LED_POW34_A_LED_CURRENT4 8
735 #define BITP_LED_POW34_A_LED_DRIVESIDE4 15
736 #define BITM_LED_POW34_A_LED_CURRENT3 0x007f
737 #define BITM_LED_POW34_A_LED_DRIVESIDE3 0x0080
738 #define BITM_LED_POW34_A_LED_CURRENT4 0x7f00
739 #define BITM_LED_POW34_A_LED_DRIVESIDE4 0x8000
740 
741 /* ADPD410X_REG_COUNTS */
742 #define BITP_COUNTS_A_NUM_REPEAT 0
743 #define BITP_COUNTS_A_NUM_INT 8
744 #define BITM_COUNTS_A_NUM_REPEAT 0x00ff
745 #define BITM_COUNTS_A_NUM_INT 0xff00
746 
747 /* ADPD410X_REG_PERIOD */
748 #define BITP_PERIOD_A_MIN_PERIOD 0
749 #define BITP_PERIOD_A_MOD_TYPE 12
750 #define BITM_PERIOD_A_MIN_PERIOD 0x03ff
751 #define BITM_PERIOD_A_MOD_TYPE 0x3000
752 
753 /* ADPD410X_REG_LED_PULSE */
754 #define BITP_LED_PULSE_A_LED_OFFSET 0
755 #define BITP_LED_PULSE_A_LED_WIDTH 8
756 #define BITM_LED_PULSE_A_LED_OFFSET 0x00ff
757 #define BITM_LED_PULSE_A_LED_WIDTH 0xff00
758 
759 /* ADPD410X_REG_INTEG_WIDTH */
760 #define BITP_INTEG_WIDTH_A_INTEG_WIDTH 0
761 #define BITP_INTEG_WIDTH_A_ADC_COUNT 6
762 #define BITP_INTEG_WIDTH_A_CH1_AMP_DISABLE 8
763 #define BITP_INTEG_WIDTH_A_AFE_INT_C_BUF 11
764 #define BITP_INTEG_WIDTH_A_CH2_AMP_DISABLE 12
765 #define BITP_INTEG_WIDTH_A_SINGLE_INTEG 15
766 #define BITM_INTEG_WIDTH_A_INTEG_WIDTH 0x001f
767 #define BITM_INTEG_WIDTH_A_ADC_COUNT 0x00c0
768 #define BITM_INTEG_WIDTH_A_CH1_AMP_DISABLE 0x0700
769 #define BITM_INTEG_WIDTH_A_AFE_INT_C_BUF 0x0800
770 #define BITM_INTEG_WIDTH_A_CH2_AMP_DISABLE 0x7000
771 #define BITM_INTEG_WIDTH_A_SINGLE_INTEG 0x8000
772 
773 /* ADPD410X_REG_INTEG_OFFSET */
774 #define BITP_INTEG_OFFSET_A_INTEG_OFFSET 0
775 #define BITM_INTEG_OFFSET_A_INTEG_OFFSET 0x1fff
776 #define BITP_INTEG_OFFSET_A_INTEG_OFFSET_UPPER 5
777 #define BITM_INTEG_OFFSET_A_INTEG_OFFSET_UPPER 0xff
778 
779 /* ADPD410X_REG_MOD_PULSE */
780 #define BITP_MOD_PULSE_A_MOD_OFFSET 0
781 #define BITP_MOD_PULSE_A_MOD_WIDTH 8
782 #define BITM_MOD_PULSE_A_MOD_OFFSET 0x00ff
783 #define BITM_MOD_PULSE_A_MOD_WIDTH 0xff00
784 
785 /* ADPD410X_REG_PATTERN */
786 #define BITP_PATTERN_A_REVERSE_INTEG 0
787 #define BITP_PATTERN_A_SUBTRACT 4
788 #define BITP_PATTERN_A_MOD_DISABLE 8
789 #define BITP_PATTERN_A_LED_DISABLE 12
790 #define BITM_PATTERN_A_REVERSE_INTEG 0x000f
791 #define BITM_PATTERN_A_SUBTRACT 0x00f0
792 #define BITM_PATTERN_A_MOD_DISABLE 0x0f00
793 #define BITM_PATTERN_A_LED_DISABLE 0xf000
794 
795 /* ADPD410X_REG_ADC_OFF1 */
796 #define BITP_ADC_OFF1_A_CH1_ADC_ADJUST 0
797 #define BITM_ADC_OFF1_A_CH1_ADC_ADJUST 0x3fff
798 
799 /* ADPD410X_REG_ADC_OFF2 */
800 #define BITP_ADC_OFF2_A_CH2_ADC_ADJUST 0
801 #define BITP_ADC_OFF2_A_ZERO_ADJUST 15
802 #define BITM_ADC_OFF2_A_CH2_ADC_ADJUST 0x3fff
803 #define BITM_ADC_OFF2_A_ZERO_ADJUST 0x8000
804 
805 /* ADPD410X_REG_DATA1 */
806 #define BITP_DATA1_A_SIGNAL_SIZE 0
807 #define BITP_DATA1_A_SIGNAL_SHIFT 3
808 #define BITP_DATA1_A_DARK_SIZE 8
809 #define BITP_DATA1_A_DARK_SHIFT 11
810 #define BITM_DATA1_A_SIGNAL_SIZE 0x0007
811 #define BITM_DATA1_A_SIGNAL_SHIFT 0x00f8
812 #define BITM_DATA1_A_DARK_SIZE 0x0700
813 #define BITM_DATA1_A_DARK_SHIFT 0xf800
814 
815 /* ADPD410X_REG_DATA2 */
816 #define BITP_DATA2_A_LIT_SIZE 0
817 #define BITP_DATA2_A_LIT_SHIFT 3
818 #define BITM_DATA2_A_LIT_SIZE 0x0007
819 #define BITM_DATA2_A_LIT_SHIFT 0x00f8
820 
821 /* ADPD410X_REG_DECIMATE */
822 #define BITP_DECIMATE_A_DECIMATE_TYPE 0
823 #define BITP_DECIMATE_A_DECIMATE_FACTOR 4
824 #define BITM_DECIMATE_A_DECIMATE_TYPE 0x000f
825 #define BITM_DECIMATE_A_DECIMATE_FACTOR 0x07f0
826 
827 /* ADPD410X_REG_DIGINT_LIT */
828 #define BITP_DIGINT_LIT_A_LIT_OFFSET 0
829 #define BITM_DIGINT_LIT_A_LIT_OFFSET 0x01ff
830 
831 /* ADPD410X_REG_DIGINT_DARK */
832 #define BITP_DIGINT_DARK_A_DARK1_OFFSET 0
833 #define BITP_DIGINT_DARK_A_DARK2_OFFSET 7
834 #define BITM_DIGINT_DARK_A_DARK1_OFFSET 0x007f
835 #define BITM_DIGINT_DARK_A_DARK2_OFFSET 0xff80
836 
837 /* ADPD410X_REG_THRESH_CFG */
838 #define BITP_THRESH_CFG_A_THRESH0_TYPE 0
839 #define BITP_THRESH_CFG_A_THRESH0_DIR 2
840 #define BITP_THRESH_CFG_A_THRESH0_CHAN 3
841 #define BITP_THRESH_CFG_A_THRESH1_TYPE 4
842 #define BITP_THRESH_CFG_A_THRESH1_DIR 6
843 #define BITP_THRESH_CFG_A_THRESH1_CHAN 7
844 #define BITM_THRESH_CFG_A_THRESH0_TYPE 0x0003
845 #define BITM_THRESH_CFG_A_THRESH0_DIR 0x0004
846 #define BITM_THRESH_CFG_A_THRESH0_CHAN 0x0008
847 #define BITM_THRESH_CFG_A_THRESH1_TYPE 0x0030
848 #define BITM_THRESH_CFG_A_THRESH1_DIR 0x0040
849 #define BITM_THRESH_CFG_A_THRESH1_CHAN 0x0080
850 
851 /* ADPD410X_REG_THRESH0 */
852 #define BITP_THRESH0_A_THRESH0_VALUE 0
853 #define BITP_THRESH0_A_THRESH0_SHIFT 8
854 #define BITM_THRESH0_A_THRESH0_VALUE 0x00ff
855 #define BITM_THRESH0_A_THRESH0_SHIFT 0x1f00
856 
857 /* ADPD410X_REG_THRESH1 */
858 #define BITP_THRESH1_A_THRESH1_VALUE 0
859 #define BITP_THRESH1_A_THRESH1_SHIFT 8
860 #define BITM_THRESH1_A_THRESH1_VALUE 0x00ff
861 #define BITM_THRESH1_A_THRESH1_SHIFT 0x1f00
862 
863 #define ADPD410X_LOW_FREQ_OSCILLATOR_FREQ1 1000000
864 #define ADPD410X_LOW_FREQ_OSCILLATOR_FREQ2 32768
865 #define ADPD410X_HIGH_FREQ_OSCILLATOR_FREQ 32000000
866 
867 #define ADPD410X_MAX_SLOT_NUMBER 12
868 #define ADPD410X_LED_CURR_LSB 1.333
869 #define ADPD410X_MAX_NUM_INT 255
870 #define ADPD410X_MAX_PULSE_LENGTH 255
871 #define ADPD410X_MAX_INTEG_OS 255
872 #define ADPD410X_FIFO_DEPTH 512
873 #define ADPD410X_MAX_SAMPLING_FREQ 9000
874 
875 #define ADPD410X_UPPDER_BYTE_SPI_MASK 0x7f80
876 #define ADPD410X_LOWER_BYTE_SPI_MASK 0xfe
877 #define ADPD410X_UPPDER_BYTE_I2C_MASK 0x7f00
878 #define ADPD410X_LOWER_BYTE_I2C_MASK 0xff
879 
880 /******************************************************************************/
881 /*************************** Types Declarations *******************************/
882 /******************************************************************************/
883 
893 };
894 
904 };
905 
913 };
914 
924 };
925 
939 };
940 
964 };
965 
975 };
976 
996 };
997 
1011 };
1012 
1028 };
1029 
1039 };
1040 
1047  uint8_t let_current_select : 7;
1050 };
1051 
1060  uint8_t value;
1061 };
1062 
1092 };
1093 
1118  uint8_t byte_no;
1120  uint8_t dec_factor;
1130  uint8_t adc_cycles;
1132  uint8_t repeats_no;
1133 };
1134 
1149 };
1150 
1171  uint32_t ext_lfo_freq;
1172 };
1173 
1194  uint32_t ext_lfo_freq;
1195 };
1196 
1197 /******************************************************************************/
1198 /************************ Functions Declarations ******************************/
1199 /******************************************************************************/
1200 
1202 int32_t adpd410x_reg_read(struct adpd410x_dev *dev, uint16_t address,
1203  uint16_t *data);
1204 
1206 int32_t adpd410x_reg_read_bytes(struct adpd410x_dev *dev, uint16_t address,
1207  uint8_t *data, uint16_t num_bytes);
1208 
1210 int32_t adpd410x_reg_write(struct adpd410x_dev *dev, uint16_t address,
1211  uint16_t data);
1212 
1214 int32_t adpd410x_reg_write_mask(struct adpd410x_dev *dev, uint16_t address,
1215  uint16_t data, uint16_t mask);
1216 
1218 int32_t adpd410x_reset(struct adpd410x_dev *dev);
1219 
1221 int32_t adpd410x_set_opmode(struct adpd410x_dev *dev,
1222  enum adpd410x_opmode mode);
1223 
1225 int32_t adpd410x_get_opmode(struct adpd410x_dev *dev,
1226  enum adpd410x_opmode *mode);
1227 
1229 int32_t adpd410x_set_last_timeslot(struct adpd410x_dev *dev,
1230  uint8_t timeslot_no);
1231 
1233 int32_t adpd410x_get_last_timeslot(struct adpd410x_dev *dev,
1234  enum adpd410x_timeslots *timeslot_no);
1235 
1237 int32_t adpd410x_set_sampling_freq(struct adpd410x_dev *dev,
1238  uint32_t sampling_freq);
1239 
1241 int32_t adpd410x_get_sampling_freq(struct adpd410x_dev *dev,
1242  uint32_t *sampling_freq);
1243 
1245 int32_t adpd410x_timeslot_setup(struct adpd410x_dev *dev,
1246  enum adpd410x_timeslots timeslot_no,
1247  struct adpd410x_timeslot_init *init);
1248 
1250 int32_t adpd410x_get_fifo_bytecount(struct adpd410x_dev *dev, uint16_t *bytes);
1251 
1253 int32_t adpd410x_read_fifo(struct adpd410x_dev *dev, uint32_t *data,
1254  uint16_t num_samples,
1255  uint8_t datawidth);
1256 
1259 int32_t adpd410x_get_data(struct adpd410x_dev *dev, uint32_t *data);
1260 
1262 int32_t adpd410x_setup(struct adpd410x_dev **device,
1264 
1266 int32_t adpd410x_remove(struct adpd410x_dev *dev);
1267 
1268 #endif /* ADPD410X_H_ */
ADPD410X_INP34
@ ADPD410X_INP34
Definition: adpd410x.h:934
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
phy_comm_dev::i2c_phy_dev
struct no_os_i2c_desc * i2c_phy_dev
Definition: adpd410x.h:892
adpd410x_timeslot_init::pulse4_reverse
uint8_t pulse4_reverse
Definition: adpd410x.h:1114
ADPD410X_SHORT_INS
@ ADPD410X_SHORT_INS
Definition: adpd410x.h:995
BITM_INT_STATUS_FIFO_FIFO_BYTE_COUNT
#define BITM_INT_STATUS_FIFO_FIFO_BYTE_COUNT
Definition: adpd410x.h:125
ADPD410X_INaCH2_INbCH1
@ ADPD410X_INaCH2_INbCH1
Definition: adpd410x.h:959
_adpd410x_led_control::led_output_select
enum adpd410x_led_output_opt led_output_select
Definition: adpd410x.h:1049
BITM_SYS_CTL_ALT_CLOCKS
#define BITM_SYS_CTL_ALT_CLOCKS
Definition: adpd410x.h:296
ADPD410X_GENLFO_EXTHFO
@ ADPD410X_GENLFO_EXTHFO
Definition: adpd410x.h:1148
no_os_i2c_write
int32_t no_os_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Write data to slave device.
Definition: no_os_i2c.c:159
ADPD410X_INP78
@ ADPD410X_INP78
Definition: adpd410x.h:938
ADPD410X_FLOAT_INS
@ ADPD410X_FLOAT_INS
Definition: adpd410x.h:983
no_os_i2c_init
int32_t no_os_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: no_os_i2c.c:52
phy_comm_dev::spi_phy_dev
struct no_os_spi_desc * spi_phy_dev
Definition: adpd410x.h:890
ADPD410X_TS_E
@ ADPD410X_TS_E
Definition: adpd410x.h:1077
ADPD410X_INaDIS_INbCH1
@ ADPD410X_INaDIS_INbCH1
Definition: adpd410x.h:953
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ADPD410X_TS_D
@ ADPD410X_TS_D
Definition: adpd410x.h:1075
ADPD410X_INP56
@ ADPD410X_INP56
Definition: adpd410x.h:936
sampling_freq
uint64_t sampling_freq
Definition: headless.c:73
adpd410x_led_control::value
uint8_t value
Definition: adpd410x.h:1060
ADPD410X_TIA_VREF_100K
@ ADPD410X_TIA_VREF_100K
Definition: adpd410x.h:1021
ADPD410X_INaCH1_INbCH1
@ ADPD410X_INaCH1_INbCH1
Definition: adpd410x.h:961
NO_OS_GPIO_HIGH_Z
@ NO_OS_GPIO_HIGH_Z
Definition: no_os_gpio.h:119
ADPD410X_TIA_VREF_1V256
@ ADPD410X_TIA_VREF_1V256
Definition: adpd410x.h:1010
adpd410x_dev::gpio1
struct no_os_gpio_desc * gpio1
Definition: adpd410x.h:1188
adpd410x_timeslot_init::dec_factor
uint8_t dec_factor
Definition: adpd410x.h:1120
no_os_spi.h
Header file of SPI Interface.
adpd410x_timeslot_init::byte_no
uint8_t byte_no
Definition: adpd410x.h:1118
BITP_LED_POW34_A_LED_CURRENT4
#define BITP_LED_POW34_A_LED_CURRENT4
Definition: adpd410x.h:734
ADPD410X_REG_TS_FREQH
#define ADPD410X_REG_TS_FREQH
Definition: adpd410x.h:61
adpd410x_get_opmode
int32_t adpd410x_get_opmode(struct adpd410x_dev *dev, enum adpd410x_opmode *mode)
Get operation mode.
Definition: adpd410x.c:244
adpd410x_timeslot_init::ts_inputs
struct adpd410x_ts_inputs ts_inputs
Definition: adpd410x.h:1102
ADPD410X_TS_L
@ ADPD410X_TS_L
Definition: adpd410x.h:1091
ADPD410X_VC2
@ ADPD410X_VC2
Definition: adpd410x.h:987
no_os_i2c_remove
int32_t no_os_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: no_os_i2c.c:113
adpd410x_init_param::dev_ops_init
union phy_comm_init_param dev_ops_init
Definition: adpd410x.h:1157
adpd410x_timeslot_init::led4
union adpd410x_led_control led4
Definition: adpd410x.h:1126
BITM_TS_CTRL_A_CH2_EN
#define BITM_TS_CTRL_A_CH2_EN
Definition: adpd410x.h:668
ADPD410X_REG_TS_FREQ
#define ADPD410X_REG_TS_FREQ
Definition: adpd410x.h:60
BITP_AFE_TRIM_A_TIA_GAIN_CH1
#define BITP_AFE_TRIM_A_TIA_GAIN_CH1
Definition: adpd410x.h:704
adpd410x_timeslot_init
Initialization structure for time slots.
Definition: adpd410x.h:1098
adpd410x_ts_inputs::pair
enum adpd410x_ts_input_pair pair
Definition: adpd410x.h:972
adpd410x_timeslot_init::led1
union adpd410x_led_control led1
Definition: adpd410x.h:1124
ADPD410X_TS_J
@ ADPD410X_TS_J
Definition: adpd410x.h:1087
ADPD410X_TS_A
@ ADPD410X_TS_A
Definition: adpd410x.h:1069
ADPD410X_TIA_VREF_12K5
@ ADPD410X_TIA_VREF_12K5
Definition: adpd410x.h:1027
ADPD410X_REG_FIFO_DATA
#define ADPD410X_REG_FIFO_DATA
Definition: adpd410x.h:82
phy_comm_init_param::i2c_phy_init
struct no_os_i2c_init_param i2c_phy_init
Definition: adpd410x.h:903
adpd410x_set_opmode
int32_t adpd410x_set_opmode(struct adpd410x_dev *dev, enum adpd410x_opmode mode)
Set operation mode.
Definition: adpd410x.c:231
adpd410x_init_param::gpio2
struct no_os_gpio_init_param gpio2
Definition: adpd410x.h:1167
ADPD410X_GOMODE
@ ADPD410X_GOMODE
Definition: adpd410x.h:923
phy_comm_init_param
Contains physical communication initialization structure.
Definition: adpd410x.h:899
adpd410x_ts_inputs
Structure holding time slot input configuration.
Definition: adpd410x.h:970
device
Definition: ad9361_util.h:69
adpd410x_dev::gpio0
struct no_os_gpio_desc * gpio0
Definition: adpd410x.h:1186
ADPD410X_UPPDER_BYTE_SPI_MASK
#define ADPD410X_UPPDER_BYTE_SPI_MASK
Definition: adpd410x.h:875
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
adpd410x_timeslot_init::chan1
enum adpd410x_tia_vref_ref chan1
Definition: adpd410x.h:1110
adpd410x_remove
int32_t adpd410x_remove(struct adpd410x_dev *dev)
Free memory allocated by adpd410x_setup().
Definition: adpd410x.c:768
adpd410x_setup
int32_t adpd410x_setup(struct adpd410x_dev **device, struct adpd410x_init_param *init_param)
Setup the device and the driver.
Definition: adpd410x.c:657
ADPD410X_TIA_VREF_200K
@ ADPD410X_TIA_VREF_200K
Definition: adpd410x.h:1019
ADPD410X_TS_I
@ ADPD410X_TS_I
Definition: adpd410x.h:1085
adpd410x_led_control::fields
struct _adpd410x_led_control fields
Definition: adpd410x.h:1058
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
adpd410x_init_param::gpio0
struct no_os_gpio_init_param gpio0
Definition: adpd410x.h:1163
adpd410x_init_param::gpio3
struct no_os_gpio_init_param gpio3
Definition: adpd410x.h:1169
adpd410x_timeslot_init::chan2
enum adpd410x_tia_vref_ref chan2
Definition: adpd410x.h:1112
_adpd410x_led_control::let_current_select
uint8_t let_current_select
Definition: adpd410x.h:1047
BITM_SYS_CTL_OSC_1M_EN
#define BITM_SYS_CTL_OSC_1M_EN
Definition: adpd410x.h:291
ADPD410X_TIA_VREF_25K
@ ADPD410X_TIA_VREF_25K
Definition: adpd410x.h:1025
ADPD410X_TIA_VREF
@ ADPD410X_TIA_VREF
Definition: adpd410x.h:993
adpd410x_timeslot_setup
int32_t adpd410x_timeslot_setup(struct adpd410x_dev *dev, enum adpd410x_timeslots timeslot_no, struct adpd410x_timeslot_init *init)
Setup an active time slot.
Definition: adpd410x.c:377
adpd410x_supported_dev
adpd410x_supported_dev
Devices supported by the driver.
Definition: adpd410x.h:910
adpd410x_tia_vref_volt
adpd410x_tia_vref_volt
TIA reference voltage options.
Definition: adpd410x.h:1002
ADPD410X_OUTPUT_B
@ ADPD410X_OUTPUT_B
Definition: adpd410x.h:1038
ADPD410X_LOWER_BYTE_I2C_MASK
#define ADPD410X_LOWER_BYTE_I2C_MASK
Definition: adpd410x.h:878
ADPD410X_TIA_VREF_0V8855
@ ADPD410X_TIA_VREF_0V8855
Definition: adpd410x.h:1008
adpd410x_precon_opt
adpd410x_precon_opt
Time slot input precondition options.
Definition: adpd410x.h:981
ADPD410X_FIFO_DEPTH
#define ADPD410X_FIFO_DEPTH
Definition: adpd410x.h:872
ADPD410X_REG_DATA1
#define ADPD410X_REG_DATA1(ts)
Definition: adpd410x.h:110
adpd410x_read_fifo
int32_t adpd410x_read_fifo(struct adpd410x_dev *dev, uint32_t *data, uint16_t num_samples, uint8_t datawidth)
Reads a certain number of bytes from the fifo and stores in data Used to read a large amount of data ...
Definition: adpd410x.c:558
adpd410x_set_last_timeslot
int32_t adpd410x_set_last_timeslot(struct adpd410x_dev *dev, enum adpd410x_timeslots timeslot_no)
Set number of active time slots.
Definition: adpd410x.c:265
adpd410x_led_output_opt
adpd410x_led_output_opt
LED output option.
Definition: adpd410x.h:1034
adpd410x_timeslot_init::enable_ch2
bool enable_ch2
Definition: adpd410x.h:1100
adpd410x_dev::clk_opt
enum adpd410x_clk_opt clk_opt
Definition: adpd410x.h:1184
ADPD410X_VICM
@ ADPD410X_VICM
Definition: adpd410x.h:989
BITP_DECIMATE_A_DECIMATE_FACTOR
#define BITP_DECIMATE_A_DECIMATE_FACTOR
Definition: adpd410x.h:823
no_os_error.h
Error codes definition.
adpd410x_setup
int32_t adpd410x_setup(struct adpd410x_dev **device, struct adpd410x_init_param *init_param)
Setup the device and the driver.
Definition: adpd410x.c:657
adpd410x_reg_write
int32_t adpd410x_reg_write(struct adpd410x_dev *dev, uint16_t address, uint16_t data)
Write device register.
Definition: adpd410x.c:138
ADPD410X_TS_G
@ ADPD410X_TS_G
Definition: adpd410x.h:1081
ADPD410X_INaCH2_INbDIS
@ ADPD410X_INaCH2_INbDIS
Definition: adpd410x.h:951
adpd410x_dev
Device driver handler.
Definition: adpd410x.h:1178
ADPD410X_INaDIS_INbCH2
@ ADPD410X_INaDIS_INbCH2
Definition: adpd410x.h:955
ADPD410X_TIA_VREF_1V1385
@ ADPD410X_TIA_VREF_1V1385
Definition: adpd410x.h:1004
BITM_SYS_CTL_LFOSC_SEL
#define BITM_SYS_CTL_LFOSC_SEL
Definition: adpd410x.h:292
adpd410x_get_fifo_bytecount
int32_t adpd410x_get_fifo_bytecount(struct adpd410x_dev *dev, uint16_t *bytes)
Get number of bytes in the device FIFO.
Definition: adpd410x.c:479
ADPD410X_REG_CHIP_ID
#define ADPD410X_REG_CHIP_ID
Definition: adpd410x.h:55
adpd410x_get_last_timeslot
int32_t adpd410x_get_last_timeslot(struct adpd410x_dev *dev, enum adpd410x_timeslots *timeslot_no)
Get number of active time slots.
Definition: adpd410x.c:278
adpd410x_timeslot_init::led2
union adpd410x_led_control led2
Definition: adpd410x.h:1122
ADPD410X_INaCH2_INbCH2
@ ADPD410X_INaCH2_INbCH2
Definition: adpd410x.h:963
ADPD410X_TIA_VREF_1V012
@ ADPD410X_TIA_VREF_1V012
Definition: adpd410x.h:1006
adpd410x_ts_inputs::option
enum adpd410x_ts_input_opt option
Definition: adpd410x.h:974
ADPD410X_OUTPUT_A
@ ADPD410X_OUTPUT_A
Definition: adpd410x.h:1036
adpd410x_remove
int32_t adpd410x_remove(struct adpd410x_dev *dev)
Free memory allocated by adpd410x_setup().
Definition: adpd410x.c:768
adpd410x_read_fifo
int32_t adpd410x_read_fifo(struct adpd410x_dev *dev, uint32_t *data, uint16_t num_samples, uint8_t datawidth)
Reads a certain number of bytes from the fifo and stores in data Used to read a large amount of data ...
Definition: adpd410x.c:558
adpd410x_get_last_timeslot
int32_t adpd410x_get_last_timeslot(struct adpd410x_dev *dev, enum adpd410x_timeslots *timeslot_no)
Get number of active time slots.
Definition: adpd410x.c:278
adpd410x_timeslots
adpd410x_timeslots
Available Time slots.
Definition: adpd410x.h:1067
BITP_AFE_TRIM_A_AFE_TRIM_VREF
#define BITP_AFE_TRIM_A_AFE_TRIM_VREF
Definition: adpd410x.h:707
adpd410x_timeslot_init::repeats_no
uint8_t repeats_no
Definition: adpd410x.h:1132
BITP_PATTERN_A_SUBTRACT
#define BITP_PATTERN_A_SUBTRACT
Definition: adpd410x.h:787
adpd410x_dev::dev_type
enum adpd410x_supported_dev dev_type
Definition: adpd410x.h:1182
BITP_OPMODE_TIMESLOT_EN
#define BITP_OPMODE_TIMESLOT_EN
Definition: adpd410x.h:301
BITP_SYS_CTL_LFOSC_SEL
#define BITP_SYS_CTL_LFOSC_SEL
Definition: adpd410x.h:284
adpd410x_timeslot_init::adc_cycles
uint8_t adc_cycles
Definition: adpd410x.h:1130
ADPD410X_TIA_IN
@ ADPD410X_TIA_IN
Definition: adpd410x.h:991
ADPD410X_INTLFO_INTHFO
@ ADPD410X_INTLFO_INTHFO
Definition: adpd410x.h:1141
adpd410x_set_sampling_freq
int32_t adpd410x_set_sampling_freq(struct adpd410x_dev *dev, uint32_t sampling_freq)
Set device sampling frequency.
Definition: adpd410x.c:299
adpd410x_set_last_timeslot
int32_t adpd410x_set_last_timeslot(struct adpd410x_dev *dev, uint8_t timeslot_no)
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
adpd410x_reset
int32_t adpd410x_reset(struct adpd410x_dev *dev)
Do a software reset.
Definition: adpd410x.c:213
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ADPD410X_REG_PATTERN
#define ADPD410X_REG_PATTERN(ts)
Definition: adpd410x.h:107
adpd410x_dev::ext_lfo_freq
uint32_t ext_lfo_freq
Definition: adpd410x.h:1194
BITP_AFE_TRIM_A_VREF_PULSE_VAL
#define BITP_AFE_TRIM_A_VREF_PULSE_VAL
Definition: adpd410x.h:706
ADPD410X_STANDBY
@ ADPD410X_STANDBY
Definition: adpd410x.h:921
ADPD410X_INP12
@ ADPD410X_INP12
Definition: adpd410x.h:932
ADPD410X_REG_LED_POW34
#define ADPD410X_REG_LED_POW34(ts)
Definition: adpd410x.h:100
adpd410x_get_fifo_bytecount
int32_t adpd410x_get_fifo_bytecount(struct adpd410x_dev *dev, uint16_t *bytes)
Get number of bytes in the device FIFO.
Definition: adpd410x.c:479
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ADPD410X_INTLFO_EXTHFO
@ ADPD410X_INTLFO_EXTHFO
Definition: adpd410x.h:1145
ADPD410X_TIA_VREF_50K
@ ADPD410X_TIA_VREF_50K
Definition: adpd410x.h:1023
ADPD410X_REG_COUNTS
#define ADPD410X_REG_COUNTS(ts)
Definition: adpd410x.h:101
BITP_COUNTS_A_NUM_INT
#define BITP_COUNTS_A_NUM_INT
Definition: adpd410x.h:743
ADPD410X_CHIP_ID
#define ADPD410X_CHIP_ID
Definition: adpd410x.h:249
ADPD410X_REG_TS_CTRL
#define ADPD410X_REG_TS_CTRL(ts)
Definition: adpd410x.h:94
adpd410x_timeslot_init::pulse4_subtract
uint8_t pulse4_subtract
Definition: adpd410x.h:1116
adpd410x_led_control
Union of the LED mapping and value so they can be accessed both ways.
Definition: adpd410x.h:1056
ADPD4101
@ ADPD4101
Definition: adpd410x.h:912
adpd410x_opmode
adpd410x_opmode
Operation modes of the device.
Definition: adpd410x.h:919
adpd410x_reg_read_bytes
int32_t adpd410x_reg_read_bytes(struct adpd410x_dev *dev, uint16_t address, uint8_t *data, uint16_t num_bytes)
Read a specified number of bytes from device register.
Definition: adpd410x.c:81
ADPD410X_LOW_FREQ_OSCILLATOR_FREQ2
#define ADPD410X_LOW_FREQ_OSCILLATOR_FREQ2
Definition: adpd410x.h:864
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
no_os_gpio_get
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
BITM_OPMODE_TIMESLOT_EN
#define BITM_OPMODE_TIMESLOT_EN
Definition: adpd410x.h:303
ADPD410X_UPPDER_BYTE_I2C_MASK
#define ADPD410X_UPPDER_BYTE_I2C_MASK
Definition: adpd410x.h:877
no_os_i2c_read
int32_t no_os_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C Read data from slave device.
Definition: no_os_i2c.c:190
adpd410x_init_param::gpio1
struct no_os_gpio_init_param gpio1
Definition: adpd410x.h:1165
no_os_i2c.h
Header file of I2C Interface.
adpd410x_init_param::ext_lfo_freq
uint32_t ext_lfo_freq
Definition: adpd410x.h:1171
adpd410x_tia_vref_ref
adpd410x_tia_vref_ref
TIA resistor gain setting.
Definition: adpd410x.h:1017
BITM_SYS_CTL_SW_RESET
#define BITM_SYS_CTL_SW_RESET
Definition: adpd410x.h:297
ADPD4100
@ ADPD4100
Definition: adpd410x.h:911
adpd410x_get_sampling_freq
int32_t adpd410x_get_sampling_freq(struct adpd410x_dev *dev, uint32_t *sampling_freq)
Get device sampling frequency.
Definition: adpd410x.c:334
no_os_field_get
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
ADPD410X_VC1
@ ADPD410X_VC1
Definition: adpd410x.h:985
ADPD410X_REG_OPMODE
#define ADPD410X_REG_OPMODE
Definition: adpd410x.h:63
BITP_SYS_CTL_ALT_CLOCKS
#define BITP_SYS_CTL_ALT_CLOCKS
Definition: adpd410x.h:288
_adpd410x_led_control
Structure mapping LED output option and LED strength to one byte.
Definition: adpd410x.h:1045
BITM_CHIP_ID
#define BITM_CHIP_ID
Definition: adpd410x.h:247
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
ADPD410X_TS_B
@ ADPD410X_TS_B
Definition: adpd410x.h:1071
adpd410x_timeslot_init::led3
union adpd410x_led_control led3
Definition: adpd410x.h:1128
adpd410x_get_opmode
int32_t adpd410x_get_opmode(struct adpd410x_dev *dev, enum adpd410x_opmode *mode)
Get operation mode.
Definition: adpd410x.c:244
adpd410x_timeslot_setup
int32_t adpd410x_timeslot_setup(struct adpd410x_dev *dev, enum adpd410x_timeslots timeslot_no, struct adpd410x_timeslot_init *init)
Setup an active time slot.
Definition: adpd410x.c:377
ADPD410X_REG_DECIMATE
#define ADPD410X_REG_DECIMATE(ts)
Definition: adpd410x.h:112
adpd410x_timeslot_init::afe_trim_opt
enum adpd410x_tia_vref_volt afe_trim_opt
Definition: adpd410x.h:1106
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
NULL
#define NULL
Definition: wrapper.h:64
ADPD410X_LOW_FREQ_OSCILLATOR_FREQ1
#define ADPD410X_LOW_FREQ_OSCILLATOR_FREQ1
Definition: adpd410x.h:863
adpd410x_set_sampling_freq
int32_t adpd410x_set_sampling_freq(struct adpd410x_dev *dev, uint32_t sampling_freq)
Set device sampling frequency.
Definition: adpd410x.c:299
BITM_OPMODE_OP_MODE
#define BITM_OPMODE_OP_MODE
Definition: adpd410x.h:302
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
adpd410x_reg_read_bytes
int32_t adpd410x_reg_read_bytes(struct adpd410x_dev *dev, uint16_t address, uint8_t *data, uint16_t num_bytes)
Read a specified number of bytes from device register.
Definition: adpd410x.c:81
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
adpd410x_timeslot_init::vref_pulse_opt
enum adpd410x_tia_vref_volt vref_pulse_opt
Definition: adpd410x.h:1108
BITP_PATTERN_A_REVERSE_INTEG
#define BITP_PATTERN_A_REVERSE_INTEG
Definition: adpd410x.h:786
adpd410x_ts_input_opt
adpd410x_ts_input_opt
List of input configurations for time slot.
Definition: adpd410x.h:945
phy_comm_dev
Contains physical communication handler.
Definition: adpd410x.h:888
ADPD410X_TS_C
@ ADPD410X_TS_C
Definition: adpd410x.h:1073
adpd410x_dev::dev_ops
union phy_comm_dev dev_ops
Definition: adpd410x.h:1180
adpd410x_get_data
int32_t adpd410x_get_data(struct adpd410x_dev *dev, uint32_t *data)
Get a full data packet from the device containing data from all active time slots.
Definition: adpd410x.c:626
adpd410x_init_param::clk_opt
enum adpd410x_clk_opt clk_opt
Definition: adpd410x.h:1161
adpd410x_reg_read
int32_t adpd410x_reg_read(struct adpd410x_dev *dev, uint16_t address, uint16_t *data)
Read device register.
Definition: adpd410x.c:56
ADPD410X_INaDIS_INbDIS
@ ADPD410X_INaDIS_INbDIS
Definition: adpd410x.h:947
ADPD410X_TS_F
@ ADPD410X_TS_F
Definition: adpd410x.h:1079
ADPD410X_REG_CATHODE
#define ADPD410X_REG_CATHODE(ts)
Definition: adpd410x.h:97
phy_comm_init_param::spi_phy_init
struct no_os_spi_init_param spi_phy_init
Definition: adpd410x.h:901
BITM_DECIMATE_A_DECIMATE_FACTOR
#define BITM_DECIMATE_A_DECIMATE_FACTOR
Definition: adpd410x.h:825
BITP_DATA1_A_SIGNAL_SIZE
#define BITP_DATA1_A_SIGNAL_SIZE
Definition: adpd410x.h:806
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
no_os_gpio.h
Header file of GPIO Interface.
adpd410x_reg_read
int32_t adpd410x_reg_read(struct adpd410x_dev *dev, uint16_t address, uint16_t *data)
Read device register.
Definition: adpd410x.c:56
adpd410x_dev::gpio3
struct no_os_gpio_desc * gpio3
Definition: adpd410x.h:1192
adpd410x_init_param
Device driver initialization structure.
Definition: adpd410x.h:1155
ADPD410X_TS_K
@ ADPD410X_TS_K
Definition: adpd410x.h:1089
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
adpd410x_ts_input_pair
adpd410x_ts_input_pair
List of input pairs options for time slots.
Definition: adpd410x.h:930
ADPD410X_REG_AFE_TRIM
#define ADPD410X_REG_AFE_TRIM(ts)
Definition: adpd410x.h:98
no_os_util.h
Header file of utility functions.
no_os_find_first_set_bit
uint32_t no_os_find_first_set_bit(uint32_t word)
adpd410x_reg_write_mask
int32_t adpd410x_reg_write_mask(struct adpd410x_dev *dev, uint16_t address, uint16_t data, uint16_t mask)
Do a read and write of a register to update only part of a register.
Definition: adpd410x.c:172
adpd410x_get_sampling_freq
int32_t adpd410x_get_sampling_freq(struct adpd410x_dev *dev, uint32_t *sampling_freq)
Get device sampling frequency.
Definition: adpd410x.c:334
ADPD410X_EXTLFO_INTHFO
@ ADPD410X_EXTLFO_INTHFO
Definition: adpd410x.h:1143
BITM_DATA1_A_SIGNAL_SIZE
#define BITM_DATA1_A_SIGNAL_SIZE
Definition: adpd410x.h:810
ADPD410X_REG_SYS_CTL
#define ADPD410X_REG_SYS_CTL
Definition: adpd410x.h:62
ADPD410X_REG_LED_POW12
#define ADPD410X_REG_LED_POW12(ts)
Definition: adpd410x.h:99
adpd410x_get_data
int32_t adpd410x_get_data(struct adpd410x_dev *dev, uint32_t *data)
Get a full data packet from the device containing data from all active time slots.
Definition: adpd410x.c:626
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
adpd410x_init_param::dev_type
enum adpd410x_supported_dev dev_type
Definition: adpd410x.h:1159
adpd410x.h
BITP_AFE_TRIM_A_TIA_GAIN_CH2
#define BITP_AFE_TRIM_A_TIA_GAIN_CH2
Definition: adpd410x.h:705
adpd410x_reg_write_mask
int32_t adpd410x_reg_write_mask(struct adpd410x_dev *dev, uint16_t address, uint16_t data, uint16_t mask)
Do a read and write of a register to update only part of a register.
Definition: adpd410x.c:172
BITP_LED_POW12_A_LED_CURRENT2
#define BITP_LED_POW12_A_LED_CURRENT2
Definition: adpd410x.h:724
adpd410x_timeslot_init::precon_option
enum adpd410x_precon_opt precon_option
Definition: adpd410x.h:1104
ADPD410X_REG_FIFO_STATUS
#define ADPD410X_REG_FIFO_STATUS
Definition: adpd410x.h:49
ADPD410X_INaCH1_INbCH2
@ ADPD410X_INaCH1_INbCH2
Definition: adpd410x.h:957
adpd410x_reset
int32_t adpd410x_reset(struct adpd410x_dev *dev)
Do a software reset.
Definition: adpd410x.c:213
adpd410x_dev::gpio2
struct no_os_gpio_desc * gpio2
Definition: adpd410x.h:1190
ADPD410X_LOWER_BYTE_SPI_MASK
#define ADPD410X_LOWER_BYTE_SPI_MASK
Definition: adpd410x.h:876
ADPD410X_INaCH1_INbDIS
@ ADPD410X_INaCH1_INbDIS
Definition: adpd410x.h:949
ADPD410X_REG_INPUTS
#define ADPD410X_REG_INPUTS(ts)
Definition: adpd410x.h:96
adpd410x_clk_opt
adpd410x_clk_opt
External clock options.
Definition: adpd410x.h:1139
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
BITM_CATHODE_A_PRECON
#define BITM_CATHODE_A_PRECON
Definition: adpd410x.h:701
adpd410x_reg_write
int32_t adpd410x_reg_write(struct adpd410x_dev *dev, uint16_t address, uint16_t data)
Write device register.
Definition: adpd410x.c:138
ADPD410X_TS_H
@ ADPD410X_TS_H
Definition: adpd410x.h:1083
adpd410x_set_opmode
int32_t adpd410x_set_opmode(struct adpd410x_dev *dev, enum adpd410x_opmode mode)
Set operation mode.
Definition: adpd410x.c:231