no-OS
adxl367.h
Go to the documentation of this file.
1 /***************************************************************************/
40 #ifndef __ADXL367_H__
41 #define __ADXL367_H__
42 
43 /******************************************************************************/
44 /***************************** Include Files **********************************/
45 /******************************************************************************/
46 #include <stdint.h>
47 #include <stdbool.h>
48 #include "no_os_spi.h"
49 #include "no_os_i2c.h"
50 
51 /******************************************************************************/
52 /********************************* ADXL367 ************************************/
53 /******************************************************************************/
54 
55 /* ADXL367 communication commands */
56 #define ADXL367_WRITE_REG 0x0A
57 #define ADXL367_READ_REG 0x0B
58 #define ADXL367_READ_FIFO 0x0D
59 #define ADXL367_I2C_READ 0x01
60 #define ADXL367_I2C_WRITE 0x00
61 
62 /* Registers */
63 #define ADXL367_REG_DEVID_AD 0x00
64 #define ADXL367_REG_DEVID_MST 0x01
65 #define ADXL367_REG_PARTID 0x02
66 #define ADXL367_REG_REVID 0x03
67 #define ADXL367_REG_SERIAL_NUMBER_3 0x04
68 #define ADXL367_REG_SERIAL_NUMBER_2 0x05
69 #define ADXL367_REG_SERIAL_NUMBER_1 0x06
70 #define ADXL367_REG_SERIAL_NUMBER_0 0x07
71 #define ADXL367_REG_XDATA 0x08
72 #define ADXL367_REG_YDATA 0x09
73 #define ADXL367_REG_ZDATA 0x0A
74 #define ADXL367_REG_STATUS 0x0B
75 #define ADXL367_REG_FIFO_ENTRIES_L 0x0C
76 #define ADXL367_REG_FIFO_ENTRIES_H 0x0D
77 #define ADXL367_REG_XDATA_H 0x0E
78 #define ADXL367_REG_XDATA_L 0x0F
79 #define ADXL367_REG_YDATA_H 0x10
80 #define ADXL367_REG_YDATA_L 0x11
81 #define ADXL367_REG_ZDATA_H 0x12
82 #define ADXL367_REG_ZDATA_L 0x13
83 #define ADXL367_REG_TEMP_H 0x14
84 #define ADXL367_REG_TEMP_L 0x15
85 #define ADXL367_REG_EX_ADC_H 0x16
86 #define ADXL367_REG_EX_ADC_L 0x17
87 #define ADXL367_REG_I2C_FIFO_DATA 0x18
88 #define ADXL367_REG_SOFT_RESET 0x1F
89 #define ADXL367_REG_THRESH_ACT_H 0x20
90 #define ADXL367_REG_THRESH_ACT_L 0x21
91 #define ADXL367_REG_TIME_ACT 0x22
92 #define ADXL367_REG_THRESH_INACT_H 0x23
93 #define ADXL367_REG_THRESH_INACT_L 0x24
94 #define ADXL367_REG_TIME_INACT_H 0x25
95 #define ADXL367_REG_TIME_INACT_L 0x26
96 #define ADXL367_REG_ACT_INACT_CTL 0x27
97 #define ADXL367_REG_FIFO_CONTROL 0x28
98 #define ADXL367_REG_FIFO_SAMPLES 0x29
99 #define ADXL367_REG_INTMAP1_LWR 0x2A
100 #define ADXL367_REG_INTMAP2_LWR 0x2B
101 #define ADXL367_REG_FILTER_CTL 0x2C
102 #define ADXL367_REG_POWER_CTL 0x2D
103 #define ADXL367_REG_SELF_TEST 0x2E
104 #define ADXL367_REG_TAP_THRESH 0x2F
105 #define ADXL367_REG_TAP_DUR 0x30
106 #define ADXL367_REG_TAP_LATENT 0x31
107 #define ADXL367_REG_TAP_WINDOW 0x32
108 #define ADXL367_REG_X_OFFSET 0x33
109 #define ADXL367_REG_Y_OFFSET 0x34
110 #define ADXL367_REG_Z_OFFSET 0x35
111 #define ADXL367_REG_X_SENS 0x36
112 #define ADXL367_REG_Y_SENS 0x37
113 #define ADXL367_REG_Z_SENS 0x38
114 #define ADXL367_REG_TIMER_CTL 0x39
115 #define ADXL367_REG_INTMAP1_UPPER 0x3A
116 #define ADXL367_REG_INTMAP2_UPPER 0x3B
117 #define ADXL367_REG_ADC_CTL 0x3C
118 #define ADXL367_REG_TEMP_CTL 0x3D
119 #define ADXL367_REG_TEMP_ADC_OV_TH_H 0x3E
120 #define ADXL367_REG_TEMP_ADC_OV_TH_L 0x3F
121 #define ADXL367_REG_TEMP_ADC_UN_TH_H 0x40
122 #define ADXL367_REG_TEMP_ADC_UN_TH_L 0x41
123 #define ADXL367_REG_TEMP_ADC_TIMER 0x42
124 #define ADXL367_REG_AXIS_MASK 0x43
125 #define ADXL367_REG_STATUS_COPY 0x44
126 #define ADXL367_REG_STATUS_2 0x45
127 
128 /* ADXL367_REG_STATUS definitions */
129 #define ADXL367_STATUS_ERR_USER_REGS NO_OS_BIT(7)
130 #define ADXL367_STATUS_AWAKE NO_OS_BIT(6)
131 #define ADXL367_STATUS_INACT NO_OS_BIT(5)
132 #define ADXL367_STATUS_ACT NO_OS_BIT(4)
133 #define ADXL367_STATUS_FIFO_OVERRUN NO_OS_BIT(3)
134 #define ADXL367_STATUS_FIFO_WATERMARK NO_OS_BIT(2)
135 #define ADXL367_STATUS_FIFO_RDY NO_OS_BIT(1)
136 #define ADXL367_STATUS_DATA_RDY NO_OS_BIT(0)
137 
138 /* ADXL367_REG_THRESH_H mask */
139 #define ADXL367_THRESH_H 0x7F
140 
141 /* ADXL367_REG_THRESH_L mask */
142 #define ADXL367_THRESH_L 0xFC
143 
144 /* ADXL367_REG_ACT_INACT_CTL definitions */
145 #define ADXL367_ACT_INACT_CTL_LINKLOOP_MSK NO_OS_GENMASK(5, 4)
146 #define ADXL367_ACT_INACT_CTL_INACT_EN_MSK NO_OS_GENMASK(3, 2)
147 #define ADXL367_ACT_INACT_CTL_ACT_EN_MSK NO_OS_GENMASK(1, 0)
148 
149 /* ADXL367_ACT_INACT_CTL_INACT_EN(x) options */
150 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED 0x0
151 #define ADXL367_INACTIVITY_ENABLE 0x1
152 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED_2 0x2
153 #define ADXL367_REFERENCED_INACTIVITY_ENABLE 0x3
154 
155 /* ADXL367_ACT_INACT_CTL_ACT_EN(x) options */
156 #define ADXL367_NO_ACTIVITY_DETECTION 0x0
157 #define ADXL367_ACTIVITY_ENABLE 0x1
158 #define ADXL367_NO_ACTIVITY_DETECTION_2 0x2
159 #define ADXL367_REFERENCED_ACTIVITY_ENABLE 0x3
160 
161 /* ADXL367_REG_FIFO_CONTROL */
162 #define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK NO_OS_GENMASK(6, 3)
163 #define ADXL367_FIFO_CONTROL_FIFO_SAMPLES NO_OS_BIT(2)
164 #define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK NO_OS_GENMASK(1, 0)
165 
166 /* ADXL367_FIFO_CONTROL_FIFO_CHANNEL(x) options */
167 #define ADXL367_ALL_AXIS 0x0
168 #define ADXL367_X_AXIS 0x1
169 #define ADXL367_Y_AXIS 0x2
170 #define ADXL367_X_AXIS_2 0x3
171 #define ADXL367_ALL_AXIS_TEMP 0x4
172 #define ADXL367_X_AXIS_TEMP 0x5
173 #define ADXL367_Y_AXIS_TEMP 0x6
174 #define ADXL367_Z_AXIS_TEMP 0x7
175 #define ADXL367_ALL_AXIS_EXT_ADC 0x8
176 #define ADXL367_X_AXIS_EXT_ADC 0x9
177 #define ADXL367_Y_AXIS_EXT_ADC 0xA
178 #define ADXL367_Z_AXIS_EXT_ADC 0xB
179 
180 /* ADXL367_FIFO_CONTROL_FIFO_MODE(x) options */
181 #define ADXL367_FIFO_DISABLE 0
182 #define ADXL367_FIFO_OLDEST_SAVED 1
183 #define ADXL367_FIFO_STREAM 2
184 #define ADXL367_FIFO_TRIGGERED 3
185 
186 /* ADXL367_REG_INTMAP1_LOWER */
187 #define ADXL367_INTMAP1_INT_LOW_INT1 NO_OS_BIT(7)
188 #define ADXL367_INTMAP1_AWAKE_INT1 NO_OS_BIT(6)
189 #define ADXL367_INTMAP1_INACT_INT1 NO_OS_BIT(5)
190 #define ADXL367_INTMAP1_ACT_INT1 NO_OS_BIT(4)
191 #define ADXL367_INTMAP1_FIFO_OVERRUN_INT1 NO_OS_BIT(3)
192 #define ADXL367_INTMAP1_FIFO_WATERMARK_INT1 NO_OS_BIT(2)
193 #define ADXL367_INTMAP1_FIFO_RDY_INT1 NO_OS_BIT(1)
194 #define ADXL367_INTMAP1_DATA_RDY_INT1 NO_OS_BIT(0)
195 
196 /* ADXL367_REG_INTMAP2_LOWER definitions */
197 #define ADXL367_INTMAP2_INT_LOW_INT2 NO_OS_BIT(7)
198 #define ADXL367_INTMAP2_AWAKE_INT2 NO_OS_BIT(6)
199 #define ADXL367_INTMAP2_INACT_INT2 NO_OS_BIT(5)
200 #define ADXL367_INTMAP2_ACT_INT2 NO_OS_BIT(4)
201 #define ADXL367_INTMAP2_FIFO_OVERRUN_INT2 NO_OS_BIT(3)
202 #define ADXL367_INTMAP2_FIFO_WATERMARK_INT2 NO_OS_BIT(2)
203 #define ADXL367_INTMAP2_FIFO_RDY_INT2 NO_OS_BIT(1)
204 #define ADXL367_INTMAP2_DATA_RDY_INT2 NO_OS_BIT(0)
205 
206 /* ADXL367_REG_FILTER_CTL definitions */
207 #define ADXL367_FILTER_CTL_RANGE_MSK NO_OS_GENMASK(7, 6)
208 #define ADXL367_FILTER_I2C_HS NO_OS_BIT(5)
209 #define ADXL367_FILTER_CTL_RES NO_OS_BIT(4)
210 #define ADXL367_FILTER_CTL_EXT_SAMPLE NO_OS_BIT(3)
211 #define ADXL367_FILTER_CTL_ODR_MSK NO_OS_GENMASK(2, 0)
212 
213 /* ADXL367_FILTER_CTL_RANGE(x) options */
214 #define ADXL367_RANGE_2G 0 /* +/-2 g */
215 #define ADXL367_RANGE_4G 1 /* +/-4 g */
216 #define ADXL367_RANGE_8G 2 /* +/-8 g */
217 
218 /* ADXL367_REG_POWER_CTL definitions */
219 #define ADXL367_POWER_CTL_RES NO_OS_BIT(7)
220 #define ADXL367_POWER_CTL_EXT_CLK NO_OS_BIT(6)
221 #define ADXL367_POWER_CTL_LOW_NOISE_MSK NO_OS_GENMASK(5, 4)
222 #define ADXL367_POWER_CTL_WAKEUP NO_OS_BIT(3)
223 #define ADXL367_POWER_CTL_AUTOSLEEP NO_OS_BIT(2)
224 #define ADXL367_POWER_CTL_MEASURE_MSK NO_OS_GENMASK(1, 0)
225 
226 /* ADXL367_POWER_CTL_NOISE(x) options */
227 #define ADXL367_NOISE_MODE_NORMAL 0
228 #define ADXL367_NOISE_MODE_LOW 1
229 #define ADXL367_NOISE_MODE_ULTRALOW 2
230 
231 /* ADXL367_REG_SELF_TEST */
232 #define ADXL367_SELF_TEST_ST_FORCE NO_OS_BIT(1)
233 #define ADXL367_SELF_TEST_ST NO_OS_BIT(0)
234 
235 /* XYZ_AXIS_OFFSET MASK */
236 #define ADXL367_XYZ_AXIS_OFFSET_MASK 0x1F
237 
238 /* ADXL367_REG_INTMAPX_UPPER MASK */
239 #define ADXL367_INTMAPX_UPPER_MASK 0xDF
240 
241 /* ADXL367_REG_ADC_CTL definitions. */
242 #define ADXL367_FIFO_8_12BIT_MSK NO_OS_GENMASK(7,6)
243 #define ADXL367_ADC_INACT_EN NO_OS_BIT(3)
244 #define ADXL367_ADC_ACT_EN NO_OS_BIT(1)
245 #define ADXL367_ADC_EN NO_OS_BIT(0)
246 
247 /* ADXL367_REG_TEMP_CTL definitions. */
248 #define ADXL367_TEMP_INACT_EN NO_OS_BIT(3)
249 #define ADXL367_TEMP_ACT_EN NO_OS_BIT(1)
250 #define ADXL367_TEMP_EN NO_OS_BIT(0)
251 
252 /* ADXL367 device information */
253 #define ADXL367_DEVICE_AD 0xAD
254 #define ADXL367_DEVICE_MST 0x1D
255 #define ADXL367_PART_ID 0xF7
256 
257 /* ADXL367 Reset settings */
258 #define ADXL367_RESET_KEY 0x52
259 
260 /* Channel ID for FIFO read */
261 #define ADXL367_FIFO_X_ID 0x00
262 #define ADXL367_FIFO_Y_ID 0x01
263 #define ADXL367_FIFO_Z_ID 0x02
264 #define ADXL367_FIFO_TEMP_ADC_ID 0x03
265 
266 #define ADXL367_ABSOLUTE 0x00
267 #define ADXL367_REFERENCED 0x01
268 
269 /*
270  * At +/- 2g with 14-bit resolution, scale is given in datasheet as
271  * 250ug/LSB = 0.0002500 * 9.80665 = 0.0024516625 m/s^2.
272  * For +/- 4g range a multiplier with value 2 is used.
273  * For +/-8g range, a multiplier with value 4 is used.
274  */
275 #define ADXL367_ACC_SCALE_FACTOR_MUL 245166ULL
276 #define ADXL367_ACC_SCALE_FACTOR_DIV 1000000000
277 
278 /*
279  * At 25C, raw value is equal to 165 LSB. Raw value varies with 54LSB/C.
280  * Offset = 25 * ADXL367_TEMP_PER_C - ADXL367_TEMP_25C = 1185.
281  * Temp = (RAW + OFFSET) * SCALE
282  * */
283 #define ADXL367_TEMP_OFFSET 1185
284 #define ADXL367_TEMP_25C 165
285 #define ADXL367_TEMP_SCALE 18518518
286 #define ADXL367_TEMP_SCALE_DIV 1000000000
287 
288 /* Min change = 90mg. Sensitivity = 4LSB / mg */
289 #define ADXL367_SELF_TEST_MIN 90 * 100 / 25
290 /* Max change = 270mg. Sensitivity = 4LSB / mg */
291 #define ADXL367_SELF_TEST_MAX 270 * 100 / 25
292 
293 /******************************************************************************/
294 /*************************** Types Declarations *******************************/
295 /******************************************************************************/
296 
304 };
305 
313 };
314 
323 };
324 
336 };
337 
347 };
348 
354  /* All axis. Default mode. */
356  /* X axis. */
358  /* Y axis. */
360  /* Z axis. */
362  /* All axis + temperature. */
364  /* X axis + temperature. */
366  /* Y axis + temperature. */
368  /* Z axis + temperature. */
370  /* All axis + ADC. */
372  /* X axis + ADC. */
374  /* Y axis + ADC. */
376  /* Z axis + ADC. */
378 };
379 
385  /* Upper 12 bits plus channel ID.*/
387  /* Upper 8 bits, no channel ID. */
389  /* Upper 12 bits, no channel ID. */
391  /* 14 bits plus channel ID. Default mode. */
393 };
394 
400  uint8_t err_fuse : 1;
401  uint8_t err_user_regs : 1;
402  uint8_t kpalv_timer : 1;
403  uint8_t temp_adc_hi : 1;
404  uint8_t temp_adc_low : 1;
405  uint8_t tap_two : 1;
406  uint8_t tap_one : 1;
407  uint8_t int_low : 1;
408  uint8_t awake : 1;
409  uint8_t inact : 1;
410  uint8_t act : 1;
411  uint8_t fifo_overrun : 1;
412  uint8_t fifo_watermark : 1;
413  uint8_t fifo_ready : 1;
414  uint8_t data_ready : 1;
415 };
416 
422  int64_t integer;
423  int32_t fractional;
424 };
425 
430 struct adxl367_dev {
447  uint8_t fifo_buffer[1027];
448  uint16_t x_offset;
449  uint16_t y_offset;
450  uint16_t z_offset;
451 };
452 
466 };
467 
468 /******************************************************************************/
469 /************************ Functions Declarations ******************************/
470 /******************************************************************************/
471 
472 /* Initializes the device. */
473 int adxl367_init(struct adxl367_dev **device,
475 
476 /* Free the resources allocated by adxl367_init(). */
477 int adxl367_remove(struct adxl367_dev *dev);
478 
479 /* Performs device self-test. */
480 int adxl367_self_test(struct adxl367_dev *dev);
481 
482 /* Writes data into a register. */
484  uint8_t register_value,
485  uint8_t register_address);
486 
487 /* Performs a burst read of a specified number of registers. */
489  uint8_t *read_data,
490  uint8_t register_address,
491  uint8_t bytes_number);
492 
493 /* Performs a masked write to a register. */
494 int adxl367_reg_write_msk(struct adxl367_dev *dev,
495  uint8_t reg_addr,
496  uint8_t data,
497  uint8_t mask);
498 
499 /* Resets the device via comm. */
500 int adxl367_software_reset(struct adxl367_dev *dev);
501 
502 /* Places the device into standby/measure mode. */
503 int adxl367_set_power_mode(struct adxl367_dev *dev,
504  enum adxl367_op_mode mode);
505 
506 /* Selects the measurement range. */
507 int adxl367_set_range(struct adxl367_dev *dev,
508  enum adxl367_range range);
509 
510 /* Selects the Output Data Rate of the device. */
511 int adxl367_set_output_rate(struct adxl367_dev *dev,
512  enum adxl367_odr odr);
513 
514 /* Sets user defined offset for each axis. */
515 int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset,
516  uint16_t y_offset, uint16_t z_offset);
517 
518 /* Reads the 3-axis raw data from the accelerometer. */
519 int adxl367_get_raw_xyz(struct adxl367_dev *dev,
520  int16_t* x,
521  int16_t* y,
522  int16_t* z);
523 
524 /* Reads the 3-axis raw data from the accelerometer and converts it to g. */
525 int adxl367_get_g_xyz(struct adxl367_dev *dev,
526  struct adxl367_fractional_val* x,
527  struct adxl367_fractional_val* y,
528  struct adxl367_fractional_val* z);
529 
530 /* Enables temperature reading. */
531 int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable);
532 
533 /* Enables adc reading and disables temperature reading. */
534 int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable);
535 
536 /* Reads the raw temperature of the device. */
537 int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp);
538 
539 /* Reads the temperature of the device. */
540 int adxl367_read_temperature(struct adxl367_dev *dev,
541  struct adxl367_fractional_val *temp);
542 
543 /* Reads ADC data. */
544 int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data);
545 
546 /* Reads the number of FIFO entries register value. */
548  uint16_t *entr_nb);
549 
550 /* Sets the number of FIFO samples register value. */
552  uint16_t sets_nb);
553 
554 /* Sets FIFO mode. */
555 int adxl367_set_fifo_mode(struct adxl367_dev *dev,
556  enum adxl367_fifo_mode mode);
557 
558 /* Sets FIFO read mode. */
560  enum adxl367_fifo_read_mode read_mode);
561 
562 /* Sets FIFO data storage format. */
563 int adxl367_set_fifo_format(struct adxl367_dev *dev,
564  enum adxl367_fifo_format format);
565 
566 /* Configures FIFO feature. */
567 int adxl367_fifo_setup(struct adxl367_dev *dev,
568  enum adxl367_fifo_mode mode,
569  enum adxl367_fifo_format format,
570  uint8_t sets_nb);
571 
572 /* Reads raw values from FIFO. */
573 int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y,
574  int16_t *z, int16_t *temp_adc, uint16_t *entries);
575 
576 /* Reads converted values from FIFO. */
578  struct adxl367_fractional_val *x, struct adxl367_fractional_val *y,
579  struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc,
580  uint16_t *entries);
581 
582 /* Enables specified events to interrupt pin. */
583 int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map,
584  uint8_t pin);
585 
586 /* Configures activity detection. */
588  uint8_t ref_or_abs,
589  uint16_t threshold,
590  uint8_t time);
591 
592 /* Configures inactivity detection. */
594  uint8_t ref_or_abs,
595  uint16_t threshold,
596  uint16_t time);
597 
598 #endif /* __ADXL367_H__ */
adxl367_read_raw_temp
int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp)
Reads the raw temperature of the device. If ADXL367_TEMP_EN is not set, use adxl367_temp_read_en() fi...
Definition: adxl367.c:694
ADXL367_I2C_READ
#define ADXL367_I2C_READ
Definition: adxl367.h:59
ADXL367_12B_CHID
@ ADXL367_12B_CHID
Definition: adxl367.h:386
adxl367_int_map
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1183
ADXL367_REG_THRESH_INACT_L
#define ADXL367_REG_THRESH_INACT_L
Definition: adxl367.h:93
ADXL367_REG_TEMP_H
#define ADXL367_REG_TEMP_H
Definition: adxl367.h:83
ADXL367_REG_XDATA_L
#define ADXL367_REG_XDATA_L
Definition: adxl367.h:78
adxl367_set_offset
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:508
ADXL367_ODR_100HZ
@ ADXL367_ODR_100HZ
Definition: adxl367.h:333
adxl367_read_converted_fifo
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1128
ADXL367_REG_TIME_INACT_H
#define ADXL367_REG_TIME_INACT_H
Definition: adxl367.h:94
adxl367_temp_read_en
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:650
no_os_div_s64_rem
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
adxl367_init_param::i2c_slave_address
uint8_t i2c_slave_address
Definition: adxl367.h:465
adxl367_dev::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: adxl367.h:436
ADXL367_REG_STATUS_2
#define ADXL367_REG_STATUS_2
Definition: adxl367.h:126
ADXL367_SELF_TEST_MAX
#define ADXL367_SELF_TEST_MAX
Definition: adxl367.h:291
adxl367_dev::range
enum adxl367_range range
Definition: adxl367.h:440
adxl367_int_map
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1183
ADXL367_OP_STANDBY
@ ADXL367_OP_STANDBY
Definition: adxl367.h:311
adxl367_int_map::fifo_watermark
uint8_t fifo_watermark
Definition: adxl367.h:412
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:97
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:51
adxl367_fractional_val::integer
int64_t integer
Definition: adxl367.h:422
adxl367_set_offset
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:508
adxl367_int_map::err_user_regs
uint8_t err_user_regs
Definition: adxl367.h:401
adxl367_get_register_value
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t bytes_number)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:269
ADXL367_14B_CHID
@ ADXL367_14B_CHID
Definition: adxl367.h:392
adxl367_get_nb_of_fifo_entries
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:815
NO_OS_GENMASK
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
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:95
adxl367_odr
adxl367_odr
Enum for selecting output data rate.
Definition: adxl367.h:329
ADXL367_FIFO_TEMP_ADC_ID
#define ADXL367_FIFO_TEMP_ADC_ID
Definition: adxl367.h:264
ADXL367_THRESH_L
#define ADXL367_THRESH_L
Definition: adxl367.h:142
ADXL367_FIFO_FORMAT_Y
@ ADXL367_FIFO_FORMAT_Y
Definition: adxl367.h:359
adxl367_set_fifo_sample_sets_nb
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:839
adxl367_get_register_value
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t register_nb)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:269
ADXL367_FILTER_CTL_ODR_MSK
#define ADXL367_FILTER_CTL_ODR_MSK
Definition: adxl367.h:211
no_os_spi.h
Header file of SPI Interface.
adxl367_int_map::awake
uint8_t awake
Definition: adxl367.h:408
ADXL367_ACC_SCALE_FACTOR_MUL
#define ADXL367_ACC_SCALE_FACTOR_MUL
Definition: adxl367.h:275
ADXL367_STREAM_MODE
@ ADXL367_STREAM_MODE
Definition: adxl367.h:345
adxl367_get_nb_of_fifo_entries
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:815
ADXL367_FIFO_FORMAT_XYZT
@ ADXL367_FIFO_FORMAT_XYZT
Definition: adxl367.h:363
ADXL367_RESET_KEY
#define ADXL367_RESET_KEY
Definition: adxl367.h:258
adxl367_int_map::fifo_ready
uint8_t fifo_ready
Definition: adxl367.h:413
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:76
adxl367_dev::comm_type
enum adxl367_comm_type comm_type
Definition: adxl367.h:432
ADXL367_REG_THRESH_ACT_H
#define ADXL367_REG_THRESH_ACT_H
Definition: adxl367.h:89
adxl367_adc_read_en
int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable)
Enables ADC reading. Disables temperature reading.
Definition: adxl367.c:667
adxl367_set_fifo_sample_sets_nb
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:839
ADXL367_REG_POWER_CTL
#define ADXL367_REG_POWER_CTL
Definition: adxl367.h:102
ADXL367_ODR_12P5HZ
@ ADXL367_ODR_12P5HZ
Definition: adxl367.h:330
ADXL367_DEVICE_MST
#define ADXL367_DEVICE_MST
Definition: adxl367.h:254
ADXL367_I2C_COMM
@ ADXL367_I2C_COMM
Definition: adxl367.h:303
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:94
ADXL367_REFERENCED_ACTIVITY_ENABLE
#define ADXL367_REFERENCED_ACTIVITY_ENABLE
Definition: adxl367.h:159
adxl367_int_map::fifo_overrun
uint8_t fifo_overrun
Definition: adxl367.h:411
ADXL367_REG_EX_ADC_H
#define ADXL367_REG_EX_ADC_H
Definition: adxl367.h:85
adxl367_temp_read_en
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:650
ADXL367_ODR_400HZ
@ ADXL367_ODR_400HZ
Definition: adxl367.h:335
no_os_delay.h
Header file of Delay functions.
adxl367_int_map::err_fuse
uint8_t err_fuse
Definition: adxl367.h:400
adxl367_read_adc
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:777
ADXL367_ACTIVITY_ENABLE
#define ADXL367_ACTIVITY_ENABLE
Definition: adxl367.h:157
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:121
ADXL367_FIFO_FORMAT_XYZA
@ ADXL367_FIFO_FORMAT_XYZA
Definition: adxl367.h:371
adxl367_dev::i2c_slave_address
uint8_t i2c_slave_address
Definition: adxl367.h:438
adxl367_dev::fifo_buffer
uint8_t fifo_buffer[1027]
Definition: adxl367.h:447
ADXL367_THRESH_H
#define ADXL367_THRESH_H
Definition: adxl367.h:139
adxl367_set_register_value
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:240
ADXL367_ACC_SCALE_FACTOR_DIV
#define ADXL367_ACC_SCALE_FACTOR_DIV
Definition: adxl367.h:276
adxl367_set_range
int adxl367_set_range(struct adxl367_dev *dev, enum adxl367_range range)
Selects the measurement range.
Definition: adxl367.c:450
adxl367_op_mode
adxl367_op_mode
Enum for operating mode.
Definition: adxl367.h:310
ADXL367_REG_ACT_INACT_CTL
#define ADXL367_REG_ACT_INACT_CTL
Definition: adxl367.h:96
device
Definition: ad9361_util.h:75
adxl367_set_output_rate
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:481
adxl367_read_adc
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:777
adxl367_dev::op_mode
enum adxl367_op_mode op_mode
Definition: adxl367.h:441
no_os_print_log.h
Print messages helpers.
ADXL367_REG_SELF_TEST
#define ADXL367_REG_SELF_TEST
Definition: adxl367.h:103
ADXL367_FIFO_FORMAT_YT
@ ADXL367_FIFO_FORMAT_YT
Definition: adxl367.h:367
adxl367_dev
ADXL367 Device structure.
Definition: adxl367.h:430
adxl367_setup_activity_detection
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1234
adxl367_comm_type
adxl367_comm_type
Enum for communication type.
Definition: adxl367.h:301
ADXL367_2G_RANGE
@ ADXL367_2G_RANGE
Definition: adxl367.h:320
ADXL367_REG_STATUS
#define ADXL367_REG_STATUS
Definition: adxl367.h:74
adxl367_setup_inactivity_detection
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1291
adxl367_set_output_rate
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:481
adxl367_fractional_val::fractional
int32_t fractional
Definition: adxl367.h:423
ADXL367_TEMP_SCALE_DIV
#define ADXL367_TEMP_SCALE_DIV
Definition: adxl367.h:286
adxl367_software_reset
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:376
ADXL367_FIFO_FORMAT_XYZ
@ ADXL367_FIFO_FORMAT_XYZ
Definition: adxl367.h:355
adxl367_init_param
Structure holding the parameters for ADXL367 device initialization.
Definition: adxl367.h:457
adxl367_read_raw_temp
int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp)
Reads the raw temperature of the device. If ADXL367_TEMP_EN is not set, use adxl367_temp_read_en() fi...
Definition: adxl367.c:694
adxl367_dev::odr
enum adxl367_odr odr
Definition: adxl367.h:442
ADXL367_PART_ID
#define ADXL367_PART_ID
Definition: adxl367.h:255
ADXL367_FIFO_DISABLED
@ ADXL367_FIFO_DISABLED
Definition: adxl367.h:343
ADXL367_8B
@ ADXL367_8B
Definition: adxl367.h:388
adxl367_int_map::tap_two
uint8_t tap_two
Definition: adxl367.h:405
adxl367_read_raw_fifo
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1040
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
ADXL367_FIFO_X_ID
#define ADXL367_FIFO_X_ID
Definition: adxl367.h:261
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
adxl367_set_range
int adxl367_set_range(struct adxl367_dev *dev, enum adxl367_range range)
Selects the measurement range.
Definition: adxl367.c:450
adxl367_int_map::inact
uint8_t inact
Definition: adxl367.h:409
adxl367_reg_write_msk
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:353
adxl367_remove
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:142
ADXL367_FIFO_FORMAT_ZA
@ ADXL367_FIFO_FORMAT_ZA
Definition: adxl367.h:377
ADXL367_XYZ_AXIS_OFFSET_MASK
#define ADXL367_XYZ_AXIS_OFFSET_MASK
Definition: adxl367.h:236
adxl367_fifo_read_mode
adxl367_fifo_read_mode
Enum for selecting FIFO reading mode.
Definition: adxl367.h:384
adxl367_init
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:69
adxl367_setup_activity_detection
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1234
adxl367_read_temperature
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:755
adxl367_int_map::temp_adc_low
uint8_t temp_adc_low
Definition: adxl367.h:404
ADXL367_FIFO_Y_ID
#define ADXL367_FIFO_Y_ID
Definition: adxl367.h:262
ADXL367_TEMP_SCALE
#define ADXL367_TEMP_SCALE
Definition: adxl367.h:285
adxl367_reg_write_msk
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:353
ADXL367_REG_INTMAP2_UPPER
#define ADXL367_REG_INTMAP2_UPPER
Definition: adxl367.h:116
ADXL367_TEMP_OFFSET
#define ADXL367_TEMP_OFFSET
Definition: adxl367.h:283
ADXL367_REG_INTMAP1_UPPER
#define ADXL367_REG_INTMAP1_UPPER
Definition: adxl367.h:115
ADXL367_REG_I2C_FIFO_DATA
#define ADXL367_REG_I2C_FIFO_DATA
Definition: adxl367.h:87
adxl367_dev::fifo_read_mode
enum adxl367_fifo_read_mode fifo_read_mode
Definition: adxl367.h:445
adxl367_dev::y_offset
uint16_t y_offset
Definition: adxl367.h:449
ADXL367_READ_REG
#define ADXL367_READ_REG
Definition: adxl367.h:57
adxl367_dev::fifo_format
enum adxl367_fifo_format fifo_format
Definition: adxl367.h:444
ADXL367_REG_ADC_CTL
#define ADXL367_REG_ADC_CTL
Definition: adxl367.h:117
ADXL367_REG_INTMAP1_LWR
#define ADXL367_REG_INTMAP1_LWR
Definition: adxl367.h:99
ADXL367_OP_MEASURE
@ ADXL367_OP_MEASURE
Definition: adxl367.h:312
ADXL367_REG_FIFO_ENTRIES_L
#define ADXL367_REG_FIFO_ENTRIES_L
Definition: adxl367.h:75
adxl367_self_test
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:163
ADXL367_FIFO_Z_ID
#define ADXL367_FIFO_Z_ID
Definition: adxl367.h:263
ADXL367_FILTER_CTL_RANGE_MSK
#define ADXL367_FILTER_CTL_RANGE_MSK
Definition: adxl367.h:207
adxl367_get_raw_xyz
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:547
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
ADXL367_REG_SOFT_RESET
#define ADXL367_REG_SOFT_RESET
Definition: adxl367.h:88
adxl367_range
adxl367_range
Enum for selecting range.
Definition: adxl367.h:319
ADXL367_INTMAPX_UPPER_MASK
#define ADXL367_INTMAPX_UPPER_MASK
Definition: adxl367.h:239
ADXL367_FIFO_FORMAT_XA
@ ADXL367_FIFO_FORMAT_XA
Definition: adxl367.h:373
adxl367_get_raw_xyz
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:547
ADXL367_FIFO_FORMAT_X
@ ADXL367_FIFO_FORMAT_X
Definition: adxl367.h:357
ADXL367_REG_FILTER_CTL
#define ADXL367_REG_FILTER_CTL
Definition: adxl367.h:101
adxl367_int_map::data_ready
uint8_t data_ready
Definition: adxl367.h:414
adxl367_dev::z_offset
uint16_t z_offset
Definition: adxl367.h:450
adxl367_int_map::act
uint8_t act
Definition: adxl367.h:410
ADXL367_TRIGGERED_MODE
@ ADXL367_TRIGGERED_MODE
Definition: adxl367.h:346
adxl367_fractional_val
Data format in which the values are converted.
Definition: adxl367.h:421
adxl367_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adxl367.h:434
ADXL367_REG_THRESH_ACT_L
#define ADXL367_REG_THRESH_ACT_L
Definition: adxl367.h:90
ADXL367_ODR_50HZ
@ ADXL367_ODR_50HZ
Definition: adxl367.h:332
adxl367_int_map::kpalv_timer
uint8_t kpalv_timer
Definition: adxl367.h:402
no_os_i2c_desc
Structure holding I2C descriptor.
Definition: no_os_i2c.h:81
ADXL367_FIFO_FORMAT_ZT
@ ADXL367_FIFO_FORMAT_ZT
Definition: adxl367.h:369
ADXL367_TEMP_EN
#define ADXL367_TEMP_EN
Definition: adxl367.h:250
ADXL367_ADC_EN
#define ADXL367_ADC_EN
Definition: adxl367.h:245
adxl367_self_test
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:163
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:122
ADXL367_DEVICE_AD
#define ADXL367_DEVICE_AD
Definition: adxl367.h:253
no_os_i2c.h
Header file of I2C Interface.
adxl367_adc_read_en
int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable)
Enables ADC reading. Disables temperature reading.
Definition: adxl367.c:667
adxl367_int_map::int_low
uint8_t int_low
Definition: adxl367.h:407
adxl367_set_fifo_format
int adxl367_set_fifo_format(struct adxl367_dev *dev, enum adxl367_fifo_format format)
Sets FIFO format.
Definition: adxl367.c:934
ADXL367_INACTIVITY_ENABLE
#define ADXL367_INACTIVITY_ENABLE
Definition: adxl367.h:151
adxl367_read_raw_fifo
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1040
ADXL367_FIFO_FORMAT_YA
@ ADXL367_FIFO_FORMAT_YA
Definition: adxl367.h:375
ADXL367_REG_XDATA_H
#define ADXL367_REG_XDATA_H
Definition: adxl367.h:77
ADXL367_POWER_CTL_MEASURE_MSK
#define ADXL367_POWER_CTL_MEASURE_MSK
Definition: adxl367.h:224
ADXL367_FIFO_FORMAT_Z
@ ADXL367_FIFO_FORMAT_Z
Definition: adxl367.h:361
ADXL367_4G_RANGE
@ ADXL367_4G_RANGE
Definition: adxl367.h:321
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
adxl367_int_map
Contains bit options from INT registers.
Definition: adxl367.h:399
ADXL367_FIFO_CONTROL_FIFO_SAMPLES
#define ADXL367_FIFO_CONTROL_FIFO_SAMPLES
Definition: adxl367.h:163
adxl367.h
Header file of ADXL367 Driver.
adxl367_set_fifo_format
int adxl367_set_fifo_format(struct adxl367_dev *dev, enum adxl367_fifo_format format)
Sets FIFO format.
Definition: adxl367.c:934
adxl367_read_converted_fifo
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1128
ADXL367_REFERENCED_INACTIVITY_ENABLE
#define ADXL367_REFERENCED_INACTIVITY_ENABLE
Definition: adxl367.h:153
adxl367_read_temperature
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:755
adxl367_set_register_value
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:240
ADXL367_FIFO_8_12BIT_MSK
#define ADXL367_FIFO_8_12BIT_MSK
Definition: adxl367.h:242
ADXL367_SELF_TEST_MIN
#define ADXL367_SELF_TEST_MIN
Definition: adxl367.h:289
ADXL367_ODR_25HZ
@ ADXL367_ODR_25HZ
Definition: adxl367.h:331
adxl367_set_fifo_read_mode
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:897
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
ADXL367_REG_DEVID_AD
#define ADXL367_REG_DEVID_AD
Definition: adxl367.h:63
NULL
#define NULL
Definition: wrapper.h:64
ADXL367_STATUS_DATA_RDY
#define ADXL367_STATUS_DATA_RDY
Definition: adxl367.h:136
adxl367_init_param::comm_type
enum adxl367_comm_type comm_type
Definition: adxl367.h:459
ADXL367_REG_Y_OFFSET
#define ADXL367_REG_Y_OFFSET
Definition: adxl367.h:109
adxl367_fifo_setup
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1003
ADXL367_FIFO_CONTROL_FIFO_MODE_MSK
#define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK
Definition: adxl367.h:164
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
adxl367_set_fifo_mode
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:868
ADXL367_SELF_TEST_ST
#define ADXL367_SELF_TEST_ST
Definition: adxl367.h:233
adxl367_fifo_format
adxl367_fifo_format
Enum for selecting FIFO storage mode.
Definition: adxl367.h:353
adxl367_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: adxl367.h:461
adxl367_set_fifo_read_mode
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:897
ADXL367_ODR_200HZ
@ ADXL367_ODR_200HZ
Definition: adxl367.h:334
adxl367_fifo_setup
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1003
ADXL367_REG_TEMP_CTL
#define ADXL367_REG_TEMP_CTL
Definition: adxl367.h:118
ADXL367_ACT_INACT_CTL_INACT_EN_MSK
#define ADXL367_ACT_INACT_CTL_INACT_EN_MSK
Definition: adxl367.h:146
adxl367_software_reset
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:376
adxl367_set_fifo_mode
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:868
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:77
adxl367_dev::x_offset
uint16_t x_offset
Definition: adxl367.h:448
ADXL367_REG_FIFO_CONTROL
#define ADXL367_REG_FIFO_CONTROL
Definition: adxl367.h:97
ADXL367_REG_Z_OFFSET
#define ADXL367_REG_Z_OFFSET
Definition: adxl367.h:110
ADXL367_REG_TIME_INACT_L
#define ADXL367_REG_TIME_INACT_L
Definition: adxl367.h:95
ADXL367_READ_FIFO
#define ADXL367_READ_FIFO
Definition: adxl367.h:58
ADXL367_REG_FIFO_SAMPLES
#define ADXL367_REG_FIFO_SAMPLES
Definition: adxl367.h:98
ADXL367_REG_TIME_ACT
#define ADXL367_REG_TIME_ACT
Definition: adxl367.h:91
ADXL367_OLDEST_SAVED
@ ADXL367_OLDEST_SAVED
Definition: adxl367.h:344
ADXL367_REG_PARTID
#define ADXL367_REG_PARTID
Definition: adxl367.h:65
ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK
#define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK
Definition: adxl367.h:162
adxl367_init_param::i2c_init
struct no_os_i2c_init_param i2c_init
Definition: adxl367.h:463
adxl367_dev::fifo_mode
enum adxl367_fifo_mode fifo_mode
Definition: adxl367.h:443
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:51
adxl367_remove
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:142
adxl367_get_g_xyz
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:620
ADXL367_12B
@ ADXL367_12B
Definition: adxl367.h:390
no_os_util.h
Header file of utility functions.
ADXL367_ABSOLUTE
#define ADXL367_ABSOLUTE
Definition: adxl367.h:266
adxl367_set_power_mode
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:418
adxl367_init
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:69
adxl367_get_g_xyz
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:620
ADXL367_ACT_INACT_CTL_ACT_EN_MSK
#define ADXL367_ACT_INACT_CTL_ACT_EN_MSK
Definition: adxl367.h:147
ADXL367_SELF_TEST_ST_FORCE
#define ADXL367_SELF_TEST_ST_FORCE
Definition: adxl367.h:232
adxl367_set_power_mode
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:418
ADXL367_REFERENCED
#define ADXL367_REFERENCED
Definition: adxl367.h:267
ADXL367_WRITE_REG
#define ADXL367_WRITE_REG
Definition: adxl367.h:56
ADXL367_REG_DEVID_MST
#define ADXL367_REG_DEVID_MST
Definition: adxl367.h:64
ADXL367_I2C_WRITE
#define ADXL367_I2C_WRITE
Definition: adxl367.h:60
adxl367_int_map::tap_one
uint8_t tap_one
Definition: adxl367.h:406
adxl367_fifo_mode
adxl367_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl367.h:342
ADXL367_REG_X_OFFSET
#define ADXL367_REG_X_OFFSET
Definition: adxl367.h:108
adxl367_setup_inactivity_detection
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1291
ADXL367_REG_THRESH_INACT_H
#define ADXL367_REG_THRESH_INACT_H
Definition: adxl367.h:92
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:121
ADXL367_8G_RANGE
@ ADXL367_8G_RANGE
Definition: adxl367.h:322
adxl367_int_map::temp_adc_hi
uint8_t temp_adc_hi
Definition: adxl367.h:403
ADXL367_FIFO_FORMAT_XT
@ ADXL367_FIFO_FORMAT_XT
Definition: adxl367.h:365
ADXL367_SPI_COMM
@ ADXL367_SPI_COMM
Definition: adxl367.h:302