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