no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
adxl372.h
Go to the documentation of this file.
1/***************************************************************************/
33
34#ifndef ADXL372_H_
35#define ADXL372_H_
36
37#include <stdint.h>
38#include "no_os_util.h"
39#include "no_os_delay.h"
40#include "no_os_gpio.h"
41#include "no_os_i2c.h"
42#include "no_os_spi.h"
43
44/*
45 * ADXL372 registers definition
46 */
47#define ADXL372_DEVID 0x00u /* Analog Devices, Inc., accelerometer ID */
48#define ADXL372_DEVID_MST 0x01u /* Analog Devices MEMS device ID */
49#define ADXL372_PARTID 0x02u /* Device ID */
50#define ADXL372_REVID 0x03u /* product revision ID*/
51#define ADXL372_STATUS_1 0x04u /* Status register 1 */
52#define ADXL372_STATUS_2 0x05u /* Status register 2 */
53#define ADXL372_FIFO_ENTRIES_2 0x06u /* Valid data samples in the FIFO */
54#define ADXL372_FIFO_ENTRIES_1 0x07u /* Valid data samples in the FIFO */
55#define ADXL372_X_DATA_H 0x08u /* X-axis acceleration data [11:4] */
56#define ADXL372_X_DATA_L 0x09u /* X-axis acceleration data [3:0] */
57#define ADXL372_Y_DATA_H 0x0Au /* Y-axis acceleration data [11:4] */
58#define ADXL372_Y_DATA_L 0x0Bu /* Y-axis acceleration data [3:0] */
59#define ADXL372_Z_DATA_H 0x0Cu /* Z-axis acceleration data [11:4] */
60#define ADXL372_Z_DATA_L 0x0Du /* Z-axis acceleration data [3:0] */
61#define ADXL372_X_MAXPEAK_H 0x15u /* X-axis MaxPeak acceleration data [15:8] */
62#define ADXL372_X_MAXPEAK_L 0x16u /* X-axis MaxPeak acceleration data [7:0] */
63#define ADXL372_Y_MAXPEAK_H 0x17u /* Y-axis MaxPeak acceleration data [15:8] */
64#define ADXL372_Y_MAXPEAK_L 0x18u /* Y-axis MaxPeak acceleration data [7:0] */
65#define ADXL372_Z_MAXPEAK_H 0x19u /* Z-axis MaxPeak acceleration data [15:8] */
66#define ADXL372_Z_MAXPEAK_L 0x1Au /* Z-axis MaxPeak acceleration data [7:0] */
67#define ADXL372_OFFSET_X 0x20u /* X axis offset */
68#define ADXL372_OFFSET_Y 0x21u /* Y axis offset */
69#define ADXL372_OFFSET_Z 0x22u /* Z axis offset */
70#define ADXL372_X_THRESH_ACT_H 0x23u /* X axis Activity Threshold [15:8] */
71#define ADXL372_X_THRESH_ACT_L 0x24u /* X axis Activity Threshold [7:0] */
72#define ADXL372_Y_THRESH_ACT_H 0x25u /* Y axis Activity Threshold [15:8] */
73#define ADXL372_Y_THRESH_ACT_L 0x26u /* Y axis Activity Threshold [7:0] */
74#define ADXL372_Z_THRESH_ACT_H 0x27u /* Z axis Activity Threshold [15:8] */
75#define ADXL372_Z_THRESH_ACT_L 0x28u /* Z axis Activity Threshold [7:0] */
76#define ADXL372_TIME_ACT 0x29u /* Activity Time */
77#define ADXL372_X_THRESH_INACT_H 0x2Au /* X axis Inactivity Threshold [15:8] */
78#define ADXL372_X_THRESH_INACT_L 0x2Bu /* X axis Inactivity Threshold [7:0] */
79#define ADXL372_Y_THRESH_INACT_H 0x2Cu /* Y axis Inactivity Threshold [15:8] */
80#define ADXL372_Y_THRESH_INACT_L 0x2Du /* Y axis Inactivity Threshold [7:0] */
81#define ADXL372_Z_THRESH_INACT_H 0x2Eu /* Z axis Inactivity Threshold [15:8] */
82#define ADXL372_Z_THRESH_INACT_L 0x2Fu /* Z axis Inactivity Threshold [7:0] */
83#define ADXL372_TIME_INACT_H 0x30u /* Inactivity Time [15:8] */
84#define ADXL372_TIME_INACT_L 0x31u /* Inactivity Time [7:0] */
85#define ADXL372_X_THRESH_ACT2_H 0x32u /* X axis Activity2 Threshold [15:8] */
86#define ADXL372_X_THRESH_ACT2_L 0x33u /* X axis Activity2 Threshold [7:0] */
87#define ADXL372_Y_THRESH_ACT2_H 0x34u /* Y axis Activity2 Threshold [15:8] */
88#define ADXL372_Y_THRESH_ACT2_L 0x35u /* Y axis Activity2 Threshold [7:0] */
89#define ADXL372_Z_THRESH_ACT2_H 0x36u /* Z axis Activity2 Threshold [15:8] */
90#define ADXL372_Z_THRESH_ACT2_L 0x37u /* Z axis Activity2 Threshold [7:0] */
91#define ADXL372_HPF 0x38u /* High Pass Filter */
92#define ADXL372_FIFO_SAMPLES 0x39u /* FIFO Samples */
93#define ADXL372_FIFO_CTL 0x3Au /* FIFO Control */
94#define ADXL372_INT1_MAP 0x3Bu /* Interrupt 1 mapping control */
95#define ADXL372_INT2_MAP 0x3Cu /* Interrupt 2 mapping control */
96#define ADXL372_TIMING 0x3Du /* Timing */
97#define ADXL372_MEASURE 0x3Eu /* Measure */
98#define ADXL372_POWER_CTL 0x3Fu /* Power control */
99#define ADXL372_SELF_TEST 0x40u /* Self Test */
100#define ADXL372_RESET 0x41u /* Reset */
101#define ADXL372_FIFO_DATA 0x42u /* FIFO Data */
102
103#define ADXL372_DEVID_VAL 0xADu /* Analog Devices, Inc., accelerometer ID */
104#define ADXL372_MST_DEVID_VAL 0x1Du /* Analog Devices MEMS device ID */
105#define ADXL372_PARTID_VAL 0xFAu /* Device ID */
106#define ADXL372_REVID_VAL 0x02u /* product revision ID*/
107#define ADXL372_RESET_CODE 0x52u /* Writing code 0x52 resets the device */
108
109#define ADXL372_REG_READ(x) (((x & 0xFF) << 1) | 0x01)
110#define ADXL372_REG_WRITE(x) ((x & 0xFF) << 1)
111
112/* ADXL372_POWER_CTL */
113#define ADXL372_POWER_CTL_INSTANT_ON_TH_MSK NO_OS_BIT(5)
114#define ADXL372_POWER_CTL_INSTANT_ON_TH_MODE(x) (((x) & 0x1) << 5)
115#define ADXL372_POWER_CTL_FIL_SETTLE_MSK NO_OS_BIT(4)
116#define ADXL372_POWER_CTL_FIL_SETTLE_MODE(x) (((x) & 0x1) << 4)
117#define ADXL372_POWER_CTL_LPF_DIS_MSK NO_OS_BIT(3)
118#define ADXL372_POWER_CTL_LPF_DIS_MODE(x) (((x) & 0x1) << 3)
119#define ADXL372_POWER_CTL_HPF_DIS_MSK NO_OS_BIT(2)
120#define ADXL372_POWER_CTL_HPF_DIS_MODE(x) (((x) & 0x1) << 2)
121#define ADXL372_POWER_CTL_MODE_MSK NO_OS_GENMASK(1, 0)
122#define ADXL372_POWER_CTL_MODE(x) (((x) & 0x3) << 0)
123
124/* ADXL372_MEASURE */
125#define ADXL372_MEASURE_AUTOSLEEP_MSK NO_OS_BIT(6)
126#define ADXL372_MEASURE_AUTOSLEEP_MODE(x) (((x) & 0x1) << 6)
127#define ADXL372_MEASURE_LINKLOOP_MSK NO_OS_GENMASK(5, 4)
128#define ADXL372_MEASURE_LINKLOOP_MODE(x) (((x) & 0x3) << 4)
129#define ADXL372_MEASURE_LOW_NOISE_MSK NO_OS_BIT(3)
130#define ADXL372_MEASURE_LOW_NOISE_MODE(x) (((x) & 0x1) << 3)
131#define ADXL372_MEASURE_BANDWIDTH_MSK NO_OS_GENMASK(2, 0)
132#define ADXL372_MEASURE_BANDWIDTH_MODE(x) (((x) & 0x7) << 0)
133
134/* ADXL372_TIMING */
135#define ADXL372_TIMING_ODR_MSK NO_OS_GENMASK(7, 5)
136#define ADXL372_TIMING_ODR_MODE(x) (((x) & 0x7) << 5)
137#define ADXL372_TIMING_WAKE_UP_RATE_MSK NO_OS_GENMASK(4, 2)
138#define ADXL372_TIMING_WAKE_UP_RATE_MODE(x) (((x) & 0x7) << 2)
139#define ADXL372_TIMING_EXT_CLK_MSK NO_OS_BIT(1)
140#define ADXL372_TIMING_EXT_CLK_MODE(x) (((x) & 0x1) << 1)
141#define ADXL372_TIMING_EXT_SYNC_MSK NO_OS_BIT(0)
142#define ADXL372_TIMING_EXT_SYNC_MODE(x) (((x) & 0x1) << 0)
143
144/* ADXL372_FIFO_CTL */
145#define ADXL372_FIFO_CTL_FORMAT_MSK NO_OS_GENMASK(5, 3)
146#define ADXL372_FIFO_CTL_FORMAT_MODE(x) (((x) & 0x7) << 3)
147#define ADXL372_FIFO_CTL_MODE_MSK NO_OS_GENMASK(2, 1)
148#define ADXL372_FIFO_CTL_MODE_MODE(x) (((x) & 0x3) << 1)
149#define ADXL372_FIFO_CTL_SAMPLES_MSK NO_OS_BIT(0)
150#define ADXL372_FIFO_CTL_SAMPLES_MODE(x) (((x) > 0xFF) ? 1 : 0)
151
152/* ADXL372_STATUS_1 */
153#define ADXL372_STATUS_1_DATA_RDY(x) (((x) >> 0) & 0x1)
154#define ADXL372_STATUS_1_FIFO_RDY(x) (((x) >> 1) & 0x1)
155#define ADXL372_STATUS_1_FIFO_FULL(x) (((x) >> 2) & 0x1)
156#define ADXL372_STATUS_1_FIFO_OVR(x) (((x) >> 3) & 0x1)
157#define ADXL372_STATUS_1_USR_NVM_BUSY(x) (((x) >> 5) & 0x1)
158#define ADXL372_STATUS_1_AWAKE(x) (((x) >> 6) & 0x1)
159#define ADXL372_STATUS_1_ERR_USR_REGS(x) (((x) >> 7) & 0x1)
160
161/* ADXL372_INT1_MAP */
162#define ADXL372_INT1_MAP_DATA_RDY_MSK NO_OS_BIT(0)
163#define ADXL372_INT1_MAP_DATA_RDY_MODE(x) (((x) & 0x1) << 0)
164#define ADXL372_INT1_MAP_FIFO_RDY_MSK NO_OS_BIT(1)
165#define ADXL372_INT1_MAP_FIFO_RDY_MODE(x) (((x) & 0x1) << 1)
166#define ADXL372_INT1_MAP_FIFO_FULL_MSK NO_OS_BIT(2)
167#define ADXL372_INT1_MAP_FIFO_FULL_MODE(x) (((x) & 0x1) << 2)
168#define ADXL372_INT1_MAP_FIFO_OVR_MSK NO_OS_BIT(3)
169#define ADXL372_INT1_MAP_FIFO_OVR_MODE(x) (((x) & 0x1) << 3)
170#define ADXL372_INT1_MAP_INACT_MSK NO_OS_BIT(4)
171#define ADXL372_INT1_MAP_INACT_MODE(x) (((x) & 0x1) << 4)
172#define ADXL372_INT1_MAP_ACT_MSK NO_OS_BIT(5)
173#define ADXL372_INT1_MAP_ACT_MODE(x) (((x) & 0x1) << 5)
174#define ADXL372_INT1_MAP_AWAKE_MSK NO_OS_BIT(6)
175#define ADXL372_INT1_MAP_AWAKE_MODE(x) (((x) & 0x1) << 6)
176#define ADXL372_INT1_MAP_LOW_MSK NO_OS_BIT(7)
177#define ADXL372_INT1_MAP_LOW_MODE(x) (((x) & 0x1) << 7)
178
179/* ADXL372_INT2_MAP */
180#define ADXL372_INT2_MAP_DATA_RDY_MSK NO_OS_BIT(0)
181#define ADXL372_INT2_MAP_DATA_RDY_MODE(x) (((x) & 0x1) << 0)
182#define ADXL372_INT2_MAP_FIFO_RDY_MSK NO_OS_BIT(1)
183#define ADXL372_INT2_MAP_FIFO_RDY_MODE(x) (((x) & 0x1) << 1)
184#define ADXL372_INT2_MAP_FIFO_FULL_MSK NO_OS_BIT(2)
185#define ADXL372_INT2_MAP_FIFO_FULL_MODE(x) (((x) & 0x1) << 2)
186#define ADXL372_INT2_MAP_FIFO_OVR_MSK NO_OS_BIT(3)
187#define ADXL372_INT2_MAP_FIFO_OVR_MODE(x) (((x) & 0x1) << 3)
188#define ADXL372_INT2_MAP_INACT_MSK NO_OS_BIT(4)
189#define ADXL372_INT2_MAP_INACT_MODE(x) (((x) & 0x1) << 4)
190#define ADXL372_INT2_MAP_ACT_MSK NO_OS_BIT(5)
191#define ADXL372_INT2_MAP_ACT_MODE(x) (((x) & 0x1) << 5)
192#define ADXL372_INT2_MAP_AWAKE_MSK NO_OS_BIT(6)
193#define ADXL372_INT2_MAP_AWAKE_MODE(x) (((x) & 0x1) << 6)
194#define ADXL372_INT2_MAP_LOW_MSK NO_OS_BIT(7)
195#define ADXL372_INT2_MAP_LOW_MODE(x) (((x) & 0x1) << 7)
196
197static const int adxl372_th_reg_addr_h[3][3] = {
198 {
202 }, {
206 }, {
210 }
211};
212
213static const int adxl372_th_reg_addr_l[3][3] = {
214 {
218 }, {
222 }, {
226 }
227};
228
234
241
249
255
263
268
279
285
290
301
308
313
319
325
327 uint16_t x;
328 uint16_t y;
329 uint16_t z;
330} ;
331
342
343struct adxl372_dev;
344
345typedef int32_t (*adxl372_reg_read_func)(struct adxl372_dev *dev,
346 uint8_t reg_addr,
347 uint8_t *reg_data);
348typedef int32_t (*adxl372_reg_write_func)(struct adxl372_dev *dev,
349 uint8_t reg_addr,
350 uint8_t reg_data);
351typedef int32_t (*adxl372_reg_read_multi_func)(struct adxl372_dev *dev,
352 uint8_t reg_addr,
353 uint8_t *reg_data,
354 uint16_t count);
355
376
403
404int32_t adxl372_spi_reg_read(struct adxl372_dev *dev,
405 uint8_t reg_addr,
406 uint8_t *reg_data);
408 uint8_t reg_addr,
409 uint8_t *reg_data,
410 uint16_t count);
411int32_t adxl372_spi_reg_write(struct adxl372_dev *dev,
412 uint8_t reg_addr,
413 uint8_t reg_data);
414int32_t adxl372_i2c_reg_read(struct adxl372_dev *dev,
415 uint8_t reg_addr,
416 uint8_t *reg_data);
417int32_t adxl372_i2c_reg_write(struct adxl372_dev *dev,
418 uint8_t reg_addr,
419 uint8_t reg_data);
421 uint8_t reg_addr,
422 uint8_t *reg_data,
423 uint16_t count);
424int32_t adxl372_write_mask(struct adxl372_dev *dev,
425 uint8_t reg_addr,
426 uint32_t mask,
427 uint8_t data);
429 enum adxl372_th_activity act,
430 uint16_t thresh,
431 bool referenced,
432 bool enable);
433int32_t adxl372_set_op_mode(struct adxl372_dev *dev,
434 enum adxl372_op_mode op_mode);
435int32_t adxl372_set_autosleep(struct adxl372_dev *dev, bool enable);
436int32_t adxl372_set_bandwidth(struct adxl372_dev *dev,
437 enum adxl372_bandwidth bw);
438int32_t adxl372_set_act_proc_mode(struct adxl372_dev *dev,
439 enum adxl372_act_proc_mode mode);
440int32_t adxl372_set_odr(struct adxl372_dev *dev,
441 enum adxl372_odr odr);
442int32_t adxl372_set_instant_on_th(struct adxl372_dev *dev,
444int32_t adxl372_set_wakeup_rate(struct adxl372_dev *dev,
445 enum adxl372_wakeup_rate wur);
446int32_t adxl372_set_activity_time(struct adxl372_dev *dev, uint8_t time);
447int32_t adxl372_set_inactivity_time(struct adxl372_dev *dev, uint16_t time);
448int32_t adxl372_interrupt_config(struct adxl372_dev *dev,
449 struct adxl372_irq_config int1,
450 struct adxl372_irq_config int2);
451int32_t adxl372_set_filter_settle(struct adxl372_dev *dev,
452 enum adxl372_filter_settle mode);
453int32_t adxl372_get_status(struct adxl372_dev *dev,
454 uint8_t *status1,
455 uint8_t *status2,
456 uint16_t *fifo_entries);
457int32_t adxl372_reset(struct adxl372_dev *dev);
458int32_t adxl372_configure_fifo(struct adxl372_dev *dev,
459 enum adxl372_fifo_mode mode,
460 enum adxl372_fifo_format format,
461 uint16_t fifo_samples);
462int32_t adxl372_get_fifo_xyz_data(struct adxl372_dev *dev,
463 struct adxl372_xyz_accel_data *fifo_data,
464 uint16_t cnt);
465int32_t adxl372_service_fifo_ev(struct adxl372_dev *dev,
466 struct adxl372_xyz_accel_data *fifo_data,
467 uint16_t *fifo_entries);
469 struct adxl372_xyz_accel_data *max_peak);
470int32_t adxl372_get_accel_data(struct adxl372_dev *dev,
471 struct adxl372_xyz_accel_data *accel_data);
472int32_t adxl372_init(struct adxl372_dev **device,
474
475#endif // ADXL372_H_
struct ad7616_init_param init_param
Definition ad7616_sdz.c:107
int32_t adxl372_i2c_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition adxl372_i2c.c:76
#define ADXL372_Z_THRESH_ACT2_H
Definition adxl372.h:89
int32_t adxl372_set_odr(struct adxl372_dev *dev, enum adxl372_odr odr)
Definition adxl372.c:253
#define ADXL372_Y_THRESH_ACT_L
Definition adxl372.h:73
#define ADXL372_Y_THRESH_ACT2_L
Definition adxl372.h:88
#define ADXL372_Z_THRESH_ACT_L
Definition adxl372.h:75
adxl372_fifo_mode
Definition adxl372.h:302
@ ADXL372_FIFO_TRIGGERED
Definition adxl372.h:305
@ ADXL372_FIFO_BYPASSED
Definition adxl372.h:303
@ ADXL372_FIFO_STREAMED
Definition adxl372.h:304
@ ADXL372_FIFO_OLD_SAVED
Definition adxl372.h:306
#define ADXL372_Y_THRESH_INACT_L
Definition adxl372.h:80
int32_t adxl372_set_op_mode(struct adxl372_dev *dev, enum adxl372_op_mode op_mode)
Definition adxl372.c:163
#define ADXL372_X_THRESH_ACT2_L
Definition adxl372.h:86
int32_t adxl372_get_highest_peak_data(struct adxl372_dev *dev, struct adxl372_xyz_accel_data *max_peak)
Definition adxl372.c:618
int32_t adxl372_set_wakeup_rate(struct adxl372_dev *dev, enum adxl372_wakeup_rate wur)
Definition adxl372.c:309
adxl372_filter_settle
Definition adxl372.h:286
@ ADXL372_FILTER_SETTLE_370
Definition adxl372.h:287
@ ADXL372_FILTER_SETTLE_16
Definition adxl372.h:288
adxl372_act_proc_mode
Definition adxl372.h:250
@ ADXL372_LINKED
Definition adxl372.h:252
@ ADXL372_LOOPED
Definition adxl372.h:253
@ ADXL372_DEFAULT
Definition adxl372.h:251
int32_t adxl372_init(struct adxl372_dev **device, struct adxl372_init_param init_param)
Definition adxl372.c:687
int32_t adxl372_get_fifo_xyz_data(struct adxl372_dev *dev, struct adxl372_xyz_accel_data *fifo_data, uint16_t cnt)
Definition adxl372.c:578
int32_t adxl372_spi_reg_read_multiple(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
Definition adxl372_spi.c:94
int32_t adxl372_reset(struct adxl372_dev *dev)
Definition adxl372.c:445
#define ADXL372_Y_THRESH_ACT_H
Definition adxl372.h:72
#define ADXL372_X_THRESH_ACT_H
Definition adxl372.h:70
int32_t adxl372_set_instant_on_th(struct adxl372_dev *dev, enum adxl372_instant_on_th_mode mode)
Definition adxl372.c:278
int32_t adxl372_spi_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition adxl372_spi.c:47
int32_t adxl372_set_activity_time(struct adxl372_dev *dev, uint8_t time)
Definition adxl372.c:332
int32_t adxl372_interrupt_config(struct adxl372_dev *dev, struct adxl372_irq_config int1, struct adxl372_irq_config int2)
Definition adxl372.c:379
int32_t adxl372_write_mask(struct adxl372_dev *dev, uint8_t reg_addr, uint32_t mask, uint8_t data)
Definition adxl372.c:93
#define ADXL372_X_THRESH_INACT_L
Definition adxl372.h:78
int32_t adxl372_spi_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition adxl372_spi.c:73
int32_t adxl372_i2c_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition adxl372_i2c.c:47
int32_t adxl372_set_bandwidth(struct adxl372_dev *dev, enum adxl372_bandwidth bw)
Definition adxl372.c:199
int32_t adxl372_i2c_reg_read_multiple(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
Definition adxl372_i2c.c:97
adxl372_wakeup_rate
Definition adxl372.h:269
@ ADXL372_WUR_208ms
Definition adxl372.h:272
@ ADXL372_WUR_2048ms
Definition adxl372.h:274
@ ADXL372_WUR_8192ms
Definition adxl372.h:276
@ ADXL372_WUR_104ms
Definition adxl372.h:271
@ ADXL372_WUR_24576ms
Definition adxl372.h:277
@ ADXL372_WUR_4096ms
Definition adxl372.h:275
@ ADXL372_WUR_512ms
Definition adxl372.h:273
@ ADXL372_WUR_52ms
Definition adxl372.h:270
int32_t adxl372_service_fifo_ev(struct adxl372_dev *dev, struct adxl372_xyz_accel_data *fifo_data, uint16_t *fifo_entries)
Definition adxl372.c:535
adxl372_bandwidth
Definition adxl372.h:242
@ ADXL372_BW_800HZ
Definition adxl372.h:245
@ ADXL372_BW_200HZ
Definition adxl372.h:243
@ ADXL372_BW_1600HZ
Definition adxl372.h:246
@ ADXL372_BW_3200HZ
Definition adxl372.h:247
@ ADXL372_BW_400HZ
Definition adxl372.h:244
#define ADXL372_Z_THRESH_ACT2_L
Definition adxl372.h:90
adxl372_th_activity
Definition adxl372.h:280
@ ADXL372_ACTIVITY2
Definition adxl372.h:282
@ ADXL372_ACTIVITY
Definition adxl372.h:281
@ ADXL372_INACTIVITY
Definition adxl372.h:283
adxl372_comm_type
Definition adxl372.h:309
@ I2C
Definition adxl372.h:311
@ SPI
Definition adxl372.h:310
adxl372_axis
Definition adxl372.h:229
@ ADXL372_Z_AXIS
Definition adxl372.h:232
@ ADXL372_X_AXIS
Definition adxl372.h:230
@ ADXL372_Y_AXIS
Definition adxl372.h:231
#define ADXL372_X_THRESH_ACT2_H
Definition adxl372.h:85
adxl372_fifo_format
Definition adxl372.h:291
@ ADXL372_X_FIFO
Definition adxl372.h:293
@ ADXL372_XZ_FIFO
Definition adxl372.h:297
@ ADXL372_Y_FIFO
Definition adxl372.h:294
@ ADXL372_XYZ_FIFO
Definition adxl372.h:292
@ ADXL372_Z_FIFO
Definition adxl372.h:296
@ ADXL372_XYZ_PEAK_FIFO
Definition adxl372.h:299
@ ADXL372_YZ_FIFO
Definition adxl372.h:298
@ ADXL372_XY_FIFO
Definition adxl372.h:295
int32_t adxl372_set_filter_settle(struct adxl372_dev *dev, enum adxl372_filter_settle mode)
Definition adxl372.c:363
#define ADXL372_Y_THRESH_ACT2_H
Definition adxl372.h:87
int32_t adxl372_get_status(struct adxl372_dev *dev, uint8_t *status1, uint8_t *status2, uint16_t *fifo_entries)
Definition adxl372.c:420
adxl372_op_mode
Definition adxl372.h:235
@ ADXL372_INSTANT_ON
Definition adxl372.h:238
@ ADXL372_FULL_BW_MEASUREMENT
Definition adxl372.h:239
@ ADXL372_STANDBY
Definition adxl372.h:236
@ ADXL372_WAKE_UP
Definition adxl372.h:237
int32_t(* adxl372_reg_read_func)(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition adxl372.h:345
int32_t adxl372_get_accel_data(struct adxl372_dev *dev, struct adxl372_xyz_accel_data *accel_data)
Definition adxl372.c:652
int32_t(* adxl372_reg_write_func)(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition adxl372.h:348
#define ADXL372_X_THRESH_INACT_H
Definition adxl372.h:77
int32_t adxl372_set_activity_threshold(struct adxl372_dev *dev, enum adxl372_th_activity act, uint16_t thresh, bool referenced, bool enable)
Definition adxl372.c:124
#define ADXL372_Z_THRESH_INACT_L
Definition adxl372.h:82
#define ADXL372_Z_THRESH_INACT_H
Definition adxl372.h:81
int32_t adxl372_set_act_proc_mode(struct adxl372_dev *dev, enum adxl372_act_proc_mode mode)
Definition adxl372.c:225
#define ADXL372_X_THRESH_ACT_L
Definition adxl372.h:71
int32_t adxl372_set_autosleep(struct adxl372_dev *dev, bool enable)
Definition adxl372.c:180
#define ADXL372_Y_THRESH_INACT_H
Definition adxl372.h:79
int32_t adxl372_set_inactivity_time(struct adxl372_dev *dev, uint16_t time)
Definition adxl372.c:344
int32_t(* adxl372_reg_read_multi_func)(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
Definition adxl372.h:351
#define ADXL372_Z_THRESH_ACT_H
Definition adxl372.h:74
int32_t adxl372_configure_fifo(struct adxl372_dev *dev, enum adxl372_fifo_mode mode, enum adxl372_fifo_format format, uint16_t fifo_samples)
Definition adxl372.c:486
adxl372_instant_on_th_mode
Definition adxl372.h:264
@ ADXL372_INSTANT_ON_HIGH_TH
Definition adxl372.h:266
@ ADXL372_INSTANT_ON_LOW_TH
Definition adxl372.h:265
adxl372_odr
Definition adxl372.h:256
@ ADXL372_ODR_3200HZ
Definition adxl372.h:260
@ ADXL372_ODR_6400HZ
Definition adxl372.h:261
@ ADXL372_ODR_800HZ
Definition adxl372.h:258
@ ADXL372_ODR_400HZ
Definition adxl372.h:257
@ ADXL372_ODR_1600HZ
Definition adxl372.h:259
Header file of Delay functions.
Header file of GPIO Interface.
Header file of I2C Interface.
Header file of SPI Interface.
Header file of utility functions.
Definition adxl372.h:320
bool enable
Definition adxl372.h:323
uint16_t thresh
Definition adxl372.h:321
bool referenced
Definition adxl372.h:322
Definition adxl372.h:356
enum adxl372_bandwidth bw
Definition adxl372.h:368
struct no_os_gpio_desc * gpio_int2
Definition adxl372.h:363
struct no_os_gpio_desc * gpio_int1
Definition adxl372.h:362
enum adxl372_act_proc_mode act_proc_mode
Definition adxl372.h:371
struct no_os_spi_desc * spi_desc
Definition adxl372.h:358
struct adxl372_fifo_config fifo_config
Definition adxl372.h:373
enum adxl372_comm_type comm_type
Definition adxl372.h:374
enum adxl372_odr odr
Definition adxl372.h:369
adxl372_reg_write_func reg_write
Definition adxl372.h:366
enum adxl372_instant_on_th_mode th_mode
Definition adxl372.h:372
struct no_os_i2c_desc * i2c_desc
Definition adxl372.h:360
adxl372_reg_read_func reg_read
Definition adxl372.h:365
adxl372_reg_read_multi_func reg_read_multiple
Definition adxl372.h:367
enum adxl372_wakeup_rate wur
Definition adxl372.h:370
Definition adxl372.h:314
enum adxl372_fifo_format fifo_format
Definition adxl372.h:316
uint16_t fifo_samples
Definition adxl372.h:317
enum adxl372_fifo_mode fifo_mode
Definition adxl372.h:315
Definition adxl372.h:377
enum adxl372_act_proc_mode act_proc_mode
Definition adxl372.h:389
enum adxl372_instant_on_th_mode th_mode
Definition adxl372.h:390
struct adxl372_activity_threshold activity2_th
Definition adxl372.h:392
enum adxl372_comm_type comm_type
Definition adxl372.h:401
uint16_t inactivity_time
Definition adxl372.h:395
struct adxl372_irq_config int1_config
Definition adxl372.h:398
uint8_t activity_time
Definition adxl372.h:394
enum adxl372_filter_settle filter_settle
Definition adxl372.h:396
enum adxl372_wakeup_rate wur
Definition adxl372.h:388
struct no_os_i2c_init_param i2c_init
Definition adxl372.h:381
struct adxl372_activity_threshold inactivity_th
Definition adxl372.h:393
struct no_os_spi_init_param spi_init
Definition adxl372.h:379
struct adxl372_activity_threshold activity_th
Definition adxl372.h:391
struct no_os_gpio_init_param gpio_int1
Definition adxl372.h:383
struct no_os_gpio_init_param gpio_int2
Definition adxl372.h:384
enum adxl372_odr odr
Definition adxl372.h:387
enum adxl372_op_mode op_mode
Definition adxl372.h:400
struct adxl372_irq_config int2_config
Definition adxl372.h:399
struct adxl372_fifo_config fifo_config
Definition adxl372.h:397
enum adxl372_bandwidth bw
Definition adxl372.h:386
Definition adxl372.h:332
bool awake
Definition adxl372.h:339
bool inactivity
Definition adxl372.h:337
bool fifo_rdy
Definition adxl372.h:334
bool low_operation
Definition adxl372.h:340
bool fifo_full
Definition adxl372.h:335
bool data_rdy
Definition adxl372.h:333
bool activity
Definition adxl372.h:338
bool fifo_ovr
Definition adxl372.h:336
Definition adxl372.h:326
uint16_t x
Definition adxl372.h:327
uint16_t z
Definition adxl372.h:329
uint16_t y
Definition adxl372.h:328
Definition ad9361_util.h:63
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Structure holding the parameters for GPIO initialization.
Definition no_os_gpio.h:67
Structure holding I2C address descriptor.
Definition no_os_i2c.h:89
Structure holding the parameters for I2C initialization.
Definition no_os_i2c.h:52
Structure holding SPI descriptor.
Definition no_os_spi.h:180
Structure holding the parameters for SPI initialization.
Definition no_os_spi.h:128