no-OS
adxl313.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __ADXL313_H__
34 #define __ADXL313_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include <string.h>
41 #include "no_os_util.h"
42 #include "no_os_i2c.h"
43 #include "no_os_spi.h"
44 
45 /******************************************************************************/
46 /********************** Macros and Constants Definitions **********************/
47 /******************************************************************************/
48 /* SPI commands */
49 #define ADXL313_SPI_READ (0x80)
50 #define ADXL313_SPI_WRITE (0x00)
51 #define ADXL313_MULTIBIT NO_OS_BIT(6)
52 
53 /* ADXL313 register map */
54 #define ADXL313_REG_DEVID_AD 0x00
55 #define ADXL313_REG_DEVID1_AD 0x01
56 #define ADXL313_REG_PARTID 0x02
57 #define ADXL313_REG_REVID 0x03
58 #define ADXL313_REG_XID 0x04
59 #define ADXL313_REG_SOFT_RESET 0x18
60 #define ADXL313_REG_OFS_AXIS(index) (0x1E + (index))
61 #define ADXL313_REG_THRESH_ACT 0x24
62 #define ADXL313_REG_THRESH_INACT 0x25
63 #define ADXL313_REG_TIME_INACT 0x26
64 #define ADXL313_REG_ACT_INACT_CTL 0x27
65 #define ADXL313_REG_BW_RATE 0x2C
66 #define ADXL313_REG_POWER_CTL 0x2D
67 #define ADXL313_REG_INT_EN 0x2E
68 #define ADXL313_REG_INT_MAP 0x2F
69 #define ADXL313_REG_INT_SRC 0x30
70 #define ADXL313_REG_DATA_FORMAT 0x31
71 #define ADXL313_REG_DATA_AXIS(index) (0x32 + ((index) * 2))
72 #define ADXL313_REG_FIFO_CTL 0x38
73 #define ADXL313_REG_FIFO_STATUS 0x39
74 
75 /* ADXL313_REG_DEVID_AD value */
76 #define ADXL313_DEVID 0xAD
77 /* ADXL313_REG_DEVID1_AD value */
78 #define ADXL313_DEVID1 0x1D
79 /* ADXL313_REG_PARTID value, 0xCB, 313 in octal */
80 #define ADXL313_PARTID 0xCB
81 /* ADXL314_DEVID_AD value, same as ADXL312 */
82 #define ADXL314_DEVID 0xE5
83 
84 /* ADXL313 reset key */
85 #define ADXL313_RESET_KEY 0x52
86 
87 /* Maximum number of FIFO samples */
88 #define ADXL313_MAX_FIFO_SAMPLES_VAL 0x60
89 
90 /* Device bandwidth settings, ADXL313_REG_BW_RATE definitions */
91 #define ADXL313_RATE_MSK NO_OS_GENMASK(3, 0)
92 #define ADXL313_LOW_POWER_OP NO_OS_BIT(4)
93 
94 /* ADXL313_REG_POWER_CTL definitions */
95 #define ADXL313_POWER_CTL_I2C_DISABLE NO_OS_BIT(6)
96 #define ADXL313_POWER_CTL_LINK NO_OS_BIT(5)
97 #define ADXL313_POWER_CTL_AUTO_SLEEP NO_OS_BIT(4)
98 #define ADXL313_POWER_CTL_MEASURE NO_OS_BIT(3)
99 #define ADXL313_POWER_CTL_SLEEP NO_OS_BIT(2)
100 #define ADXL313_POWER_CTL_WAKEUP(x) ((x) & 0x3)
101 
102 /* ADXL313_REG_INT_EN definitions */
103 #define ADXL313_REG_INT_EN_DATA_READY NO_OS_BIT(7)
104 #define ADXL313_REG_INT_EN_ACTIVITY NO_OS_BIT(4)
105 #define ADXL313_REG_INT_EN_INACTIVITY NO_OS_BIT(3)
106 #define ADXL313_REG_INT_EN_WATERMARK NO_OS_BIT(1)
107 #define ADXL313_REG_INT_EN_OVERRUN NO_OS_BIT(0)
108 
109 /* ADXL313_REG_INT_MAP definitions */
110 #define ADXL313_REG_INT_MAP_DR_INT2 NO_OS_BIT(7)
111 #define ADXL313_REG_INT_MAP_ACT_INT2 NO_OS_BIT(4)
112 #define ADXL313_REG_INT_MAP_INACT_INT2 NO_OS_BIT(3)
113 #define ADXL313_REG_INT_MAP_WM_INT2 NO_OS_BIT(1)
114 #define ADXL313_REG_INT_MAP_OVER_INT2 NO_OS_BIT(0)
115 
116 /* ADXL313_REG_INT_SRC definitions */
117 #define ADXL313_REG_INT_SRC_DATA_READY NO_OS_BIT(7)
118 #define ADXL313_REG_INT_SRC_ACTIVITY NO_OS_BIT(4)
119 #define ADXL313_REG_INT_SRC_INACTIVITY NO_OS_BIT(3)
120 #define ADXL313_REG_INT_SRC_WATERMARK NO_OS_BIT(1)
121 #define ADXL313_REG_INT_SRC_OVERRUN NO_OS_BIT(0)
122 
123 /* ADXL313_REG_DATA_FORMAT definitions */
124 #define ADXL313_REG_DATA_FORMAT_SELF_TEST NO_OS_BIT(7)
125 #define ADXL313_REG_DATA_FORMAT_SPI_3WIRE NO_OS_BIT(6)
126 #define ADXL313_REG_DATA_FORMAT_INT_INV NO_OS_BIT(5)
127 #define ADXL313_REG_DATA_FORMAT_FULL_RES NO_OS_BIT(3)
128 #define ADXL313_REG_DATA_FORMAT_JUSTIFY_BIT NO_OS_BIT(2)
129 #define ADXL313_REG_DATA_FORMAT_RANGE NO_OS_GENMASK(1, 0)
130 
131 /* ADXL313_REG_FIFO_CTL definitions */
132 #define ADXL313_REG_FIFO_CTL_MODE_MSK NO_OS_GENMASK(7, 6)
133 #define ADXL313_REG_FIFO_CTL_TRIGGER_BIT NO_OS_BIT(5)
134 #define ADXL313_REG_FIFO_CTL_SAMPLES_MSK NO_OS_GENMASK(4, 0)
135 
136 /* ADXL313_REG_FIFO_STATUS definitions */
137 #define ADXL313_REG_FIFO_FIFO_TRIGGER_BIT NO_OS_BIT(7)
138 #define ADXL313_REG_FIFO_STS_ENTRIES_MSK NO_OS_GENMASK(5, 0)
139 
140 /*
141  * ADXL312
142  * At all g ranges with full bit resolution, sensitivity is given in datasheet as
143  * 2.9 mg/LSB = 0.0029000 * 9.80665 = 0.0284392850 m/s^2.
144  */
145 #define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)28439285ULL)
146 
147 /*
148  * ADXL313
149  * At all g ranges with full bit resolution, sensitivity is given in datasheet as
150  * 1024 LSB/g = 0.0009765625 * 9.80665 = 0.00957680664 m/s^2.
151  *
152  * For +/- 2g range, a multiplier with value 2 is used.
153  * For +/- 2g range, a multiplier with value 4 is used.
154  * For +/- 4g range, a multiplier with value 8 is used.
155  *
156  */
157 #define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)957680664ULL)
158 /* Divider used for dividing of multiplier.
159  * Multiplication with 100 was used for preserving precision. */
160 #define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER ((int32_t)100)
161 
162 /*
163  * ADXL314
164  * At +/-200g with 13-bit resolution, scale factor is given in datasheet as
165  * 48.83 mg/LSB = 0.0488300 * 9.80665 = 0.4788587195 m/s^2.
166  */
167 #define ADXL314_ACC_SCALE_FACTOR_MUL ((int64_t)478858719ULL)
168 #define ADXL313_ACC_SCALE_FACTOR_DIV ((int32_t)1000000000)
169 
170 /* ADXL312
171  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
172 #define ADXL312_OFFSET_SCALE_FACTOR 11600
173 
174 /* ADXL313
175  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
176 #define ADXL313_OFFSET_SCALE_FACTOR 3900
177 
178 /* ADXL314
179  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
180 #define ADXL314_OFFSET_SCALE_FACTOR 195000
181 
182 /* ADXL312
183  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
184 #define ADXL312_THRESH_SCALE_FACTOR 46400
185 
186 /* ADXL313
187  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
188 #define ADXL313_THRESH_SCALE_FACTOR 15625
189 
190 /* ADXL314
191  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
192 #define ADXL314_THRESH_SCALE_FACTOR 784000
193 
194 /* Offset added to the ODR enum for obtaining corresponding register setting */
195 #define ADXL313_ODR_OFFSET_VAL 6
196 
197 /* Number of registers read for all axes */
198 #define ADXL313_REGS_PER_ENTRY 6
199 
200 /* Max number of FIFO entries */
201 #define ADXL313_MAX_FIFO_ENTRIES 32
202 
203 /* Number of Self-test samples */
204 #define ADXL313_SELF_TEST_SAMPLES 10
205 
206 /* Self-test multiplication factor */
207 #define ADXL312_SELF_TEST_MULT 2900
208 #define ADXL313_SELF_TEST_MULT 976
209 #define ADXL314_SELF_TEST_MULT 48830
210 #define ADXL313_SELF_TEST_DIV 1000
211 
212 /* Self-test minimum deviation for ADXL312, mg */
213 #define ADXL312_SELF_TEST_MIN_DEVIATION 300
214 /* Self-test maximum deviation for ADXL312, mg */
215 #define ADXL312_SELF_TEST_MAX_DEVIATION 3400
216 
217 /* Self-test minimum deviation for ADXL313, mg */
218 #define ADXL313_SELF_TEST_MIN_DEVIATION 300
219 /* Self-test maximum deviation for ADXL313, mg */
220 #define ADXL313_SELF_TEST_MAX_DEVIATION 3700
221 
222 /* Self-test minimum deviation for ADXL314, mg */
223 #define ADXL314_SELF_TEST_MIN_DEVIATION 100
224 /* Self-test maximum deviation for ADXL314, mg */
225 #define ADXL314_SELF_TEST_MAX_DEVIATION 8000
226 
227 /* Factor used for distinguishing between ADXL312 and ADXL313 ranges */
228 #define ADXL313_RANGE_FACTOR 4
229 
230 /* Activity/inactivity detection defines */
231 /* Enable axis for participating in act/inact detection */
232 #define ADXL313_X_EN NO_OS_BIT(1)
233 #define ADXL313_Y_EN NO_OS_BIT(2)
234 #define ADXL313_Z_EN NO_OS_BIT(3)
235 
236 /******************************************************************************/
237 /*************************** Types Declarations *******************************/
238 /******************************************************************************/
239 
248 };
249 
257 };
258 
266 };
267 
276 };
277 
287 };
288 
303 };
304 
314 };
315 
331 };
332 
341 };
342 
352 };
353 
361 };
362 
370 };
371 
382 } ;
383 
389  int64_t integer;
390  int32_t fractional;
391 };
392 
404 };
405 
411  uint8_t OVERRUN : 1;
412  uint8_t WATERMARK : 1;
413  uint8_t reserved : 1;
414  uint8_t INACTIVITY : 1;
415  uint8_t ACTIVITY : 1;
416  uint8_t reserved1 : 2;
417  uint8_t DATA_READY : 1;
418 };
419 
426  uint8_t value;
427 };
428 
435  uint8_t value;
436 };
437 
444  uint8_t value;
445 };
446 
453  uint8_t INACT_Z_EN : 1;
454  uint8_t INACT_Y_EN : 1;
455  uint8_t INACT_X_EN : 1;
456  uint8_t INACT_AC_EN : 1;
457  uint8_t ACT_Z_EN : 1;
458  uint8_t ACT_Y_EN : 1;
459  uint8_t ACT_X_EN : 1;
460  uint8_t ACT_AC_EN : 1;
461 };
462 
470  uint8_t value;
471 };
472 
482 };
483 
488 struct adxl313_dev {
507  uint8_t x_offset_raw;
510  uint8_t y_offset_raw;
513  uint8_t z_offset_raw;
519  uint8_t fifo_samples;
521  uint8_t act_thr;
523  uint8_t inact_thr;
525  uint8_t time_inact;
529  uint8_t comm_buff[24];
530 };
531 
532 /******************************************************************************/
533 /************************ Functions Declarations ******************************/
534 /******************************************************************************/
536 int adxl313_init(struct adxl313_dev **device,
538 
540 int adxl313_remove(struct adxl313_dev *dev);
541 
543 int adxl313_software_reset(struct adxl313_dev *dev);
544 
546 int adxl313_set_op_mode(struct adxl313_dev *dev,
547  enum adxl313_op_mode op_mode);
548 
550 int adxl313_get_op_mode(struct adxl313_dev *dev,
551  enum adxl313_op_mode *op_mode);
552 
554 int adxl313_set_offset(struct adxl313_dev *dev,
555  int32_t offset_ug,
556  enum adxl313_axis axis);
557 
559 int adxl313_get_offset(struct adxl313_dev *dev,
560  int32_t *offset_ug,
561  enum adxl313_axis axis);
562 
564 int adxl313_set_raw_offset(struct adxl313_dev *dev,
565  int32_t offset_raw,
566  enum adxl313_axis axis);
567 
569 int adxl313_get_raw_offset(struct adxl313_dev *dev,
570  int32_t *offset_raw,
571  enum adxl313_axis axis);
572 
574 int adxl313_get_raw_xyz(struct adxl313_dev *dev,
575  int16_t *x_raw,
576  int16_t *y_raw,
577  int16_t *z_raw);
578 
580 int adxl313_get_xyz(struct adxl313_dev *dev,
581  struct adxl313_frac_repr *x_m_s2,
582  struct adxl313_frac_repr *y_m_s2,
583  struct adxl313_frac_repr *z_m_s2);
584 
587  uint8_t *entries_no);
588 
590 int adxl313_set_fifo_samples(struct adxl313_dev *dev,
591  uint8_t samples_no);
592 
594 int adxl313_set_fifo_mode(struct adxl313_dev *dev,
595  enum adxl313_fifo_mode mode);
596 
598 int adxl313_get_raw_fifo_data(struct adxl313_dev *dev, uint8_t *entries,
599  int16_t *x_raw, int16_t *y_raw, int16_t *z_raw);
600 
602 int adxl313_get_fifo_data(struct adxl313_dev *dev,
603  uint8_t *entries,
604  struct adxl313_frac_repr *x,
605  struct adxl313_frac_repr *y,
606  struct adxl313_frac_repr *z);
607 
609 int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug);
610 
612 int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug);
613 
615 int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug);
616 
618 int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug);
619 
621 int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s);
622 
624 int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s);
625 
628  union adxl313_act_inact_ctl_flags config);
629 
632  union adxl313_act_inact_ctl_flags *config);
633 
636  uint8_t act_axes,
637  uint8_t act_ac_dc,
638  uint32_t act_thresh_ug,
639  uint8_t int_pin);
640 
643  uint8_t inact_axes,
644  uint8_t inact_ac_dc,
645  uint32_t inact_thresh_ug,
646  uint8_t inact_time,
647  uint8_t int_pin);
648 
650 int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr);
651 
653 int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr);
654 
656 int adxl313_disable_i2c(struct adxl313_dev *dev);
657 
659 int adxl313_enable_i2c(struct adxl313_dev *dev);
660 
663  enum bit_action enable);
664 
666 int adxl313_set_autosleep_mode(struct adxl313_dev *dev, enum bit_action enable,
667  uint8_t inact_thr, uint8_t time_inact_s);
668 
670 int adxl313_link_mode_enable(struct adxl313_dev *dev);
671 
673 int adxl313_link_mode_disable(struct adxl313_dev *dev);
674 
676 int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz);
677 
679 int adxl313_exit_sleep(struct adxl313_dev *dev);
680 
682 int adxl313_conf_int_enable(struct adxl313_dev *dev,
683  union adxl313_int_en_reg_flags en_ctl);
684 
687 
690 
693 
696 
698 int adxl313_conf_int_map(struct adxl313_dev *dev,
699  union adxl313_int_map_reg_flags int_map);
700 
702 int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin);
703 
705 int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin);
706 
708 int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin);
709 
711 int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin);
712 
714 int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin);
715 
718  union adxl313_int_src_reg_flags *int_status_flags);
719 
721 int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol);
722 
724 int adxl313_enable_full_res(struct adxl313_dev *dev);
725 
727 int adxl313_disable_full_res(struct adxl313_dev *dev);
728 
730 int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res);
731 
733 int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range);
734 
736 int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range);
737 
738 /* Perform device self-test. */
739 int adxl313_self_test(struct adxl313_dev *dev);
740 
741 #endif /* __ADXL313_H__ */
adxl313_dev::x_offset_raw
uint8_t x_offset_raw
Definition: adxl313.h:507
adxl313_int_map_reg_flags::value
uint8_t value
Definition: adxl313.h:435
adxl313_int_src_reg_flags
Union holding the flags for ADXL313 interrupt source.
Definition: adxl313.h:442
adxl313_frac_repr
Data format in which the acceleration values are converted.
Definition: adxl313.h:388
adxl313_get_act_thr
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1028
adxl313_get_inact_thr
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1110
no_os_alloc.h
ADXL314_ACC_SCALE_FACTOR_MUL
#define ADXL314_ACC_SCALE_FACTOR_MUL
Definition: adxl313.h:167
adxl313_watermark_int_map
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1869
ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER
#define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER
Definition: adxl313.h:160
ADXL313_WU_1_HZ
@ ADXL313_WU_1_HZ
Definition: adxl313.h:286
ADXL312_SELF_TEST_MULT
#define ADXL312_SELF_TEST_MULT
Definition: adxl313.h:207
no_os_div_s64_rem
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
adxl313_sleep
int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz)
Definition: adxl313.c:1620
ADXL312_SELF_TEST_MAX_DEVIATION
#define ADXL312_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:215
ADXL313_SELF_TEST_MAX_DEVIATION
#define ADXL313_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:220
ADXL313_RANGE_FACTOR
#define ADXL313_RANGE_FACTOR
Definition: adxl313.h:228
adxl313_activity_int_disable
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1716
adxl313_set_fifo_mode
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:863
_adxl313_int_reg_flags::DATA_READY
uint8_t DATA_READY
Definition: adxl313.h:417
adxl313_int_en_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:425
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
ADXL313_REG_INT_SRC
#define ADXL313_REG_INT_SRC
Definition: adxl313.h:69
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
adxl313_get_raw_fifo_data
int adxl313_get_raw_fifo_data(struct adxl313_dev *dev, uint8_t *entries, int16_t *x_raw, int16_t *y_raw, int16_t *z_raw)
Definition: adxl313.c:895
adxl313_get_no_of_fifo_entries
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:807
ADXL314_DEVID
#define ADXL314_DEVID
Definition: adxl313.h:82
ADXL312_THRESH_SCALE_FACTOR
#define ADXL312_THRESH_SCALE_FACTOR
Definition: adxl313.h:184
adxl313_get_range
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2091
ADXL313_SPI_COMM
@ ADXL313_SPI_COMM
Definition: adxl313.h:255
adxl313_odr
adxl313_odr
Enum for selecting output data rate.
Definition: adxl313.h:320
ADXL313_POWER_CTL_WAKEUP
#define ADXL313_POWER_CTL_WAKEUP(x)
Definition: adxl313.h:100
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
adxl313_link_mode_enable
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1581
adxl313_activity_int_map
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1823
adxl313_get_odr
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1409
adxl313_op_mode
adxl313_op_mode
Enum for operating mode.
Definition: adxl313.h:263
adxl313_conf_int_map
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1783
ADXL313_POWER_CTL_I2C_DISABLE
#define ADXL313_POWER_CTL_I2C_DISABLE
Definition: adxl313.h:95
adxl313_int_map_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:434
ADXL313_REG_POWER_CTL
#define ADXL313_REG_POWER_CTL
Definition: adxl313.h:66
no_os_spi.h
Header file of SPI Interface.
adxl313_comm_init_param
Structure holding the parameters for ADXL313 communication initialization.
Definition: adxl313.h:377
adxl313_set_odr
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1370
adxl313_get_fifo_data
int adxl313_get_fifo_data(struct adxl313_dev *dev, uint8_t *entries, struct adxl313_frac_repr *x, struct adxl313_frac_repr *y, struct adxl313_frac_repr *z)
Definition: adxl313.c:944
ADXL313_ODR_OFFSET_VAL
#define ADXL313_ODR_OFFSET_VAL
Definition: adxl313.h:195
adxl313_get_xyz
int adxl313_get_xyz(struct adxl313_dev *dev, struct adxl313_frac_repr *x_m_s2, struct adxl313_frac_repr *y_m_s2, struct adxl313_frac_repr *z_m_s2)
Definition: adxl313.c:775
adxl313_init_param
Structure holding the parameters for ADXL313 device initialization.
Definition: adxl313.h:397
adxl313_get_op_mode
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:457
adxl313_set_low_power_mode
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1473
adxl313_link_mode_enable
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1581
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
adxl313_type
adxl313_type
Enum for device type.
Definition: adxl313.h:244
ADXL313_OFFSET_SCALE_FACTOR
#define ADXL313_OFFSET_SCALE_FACTOR
Definition: adxl313.h:176
ADXL313_POWER_CTL_SLEEP
#define ADXL313_POWER_CTL_SLEEP
Definition: adxl313.h:99
adxl313_remove
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:352
adxl313_set_range
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2039
adxl313_watermark_int_map
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1869
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
adxl313_set_autosleep_mode
int adxl313_set_autosleep_mode(struct adxl313_dev *dev, enum bit_action enable, uint8_t inact_thr, uint8_t time_inact_s)
Definition: adxl313.c:1525
adxl313_reg_write_msk
int adxl313_reg_write_msk(struct adxl313_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Definition: adxl313.c:133
adxl313_dev::act_thr
uint8_t act_thr
Definition: adxl313.h:521
adxl313_set_raw_offset
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:600
ADXL313_DEVID1
#define ADXL313_DEVID1
Definition: adxl313.h:78
ADXL313_REG_BW_RATE
#define ADXL313_REG_BW_RATE
Definition: adxl313.h:65
adxl313_int_en_reg_flags
Union holding the flags for ADXL313 interrupt enable.
Definition: adxl313.h:424
no_os_delay.h
Header file of Delay functions.
adxl313_data_ready_int_map
int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1800
adxl313_set_low_power_mode
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1473
ADXL313_SELF_TEST_MULT
#define ADXL313_SELF_TEST_MULT
Definition: adxl313.h:208
ADXL313_MULTIBIT
#define ADXL313_MULTIBIT
Definition: adxl313.h:51
adxl313_get_no_of_fifo_entries
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:807
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
adxl313_get_range
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2091
adxl313_frac_repr::integer
int64_t integer
Definition: adxl313.h:389
adxl313_comm_type
adxl313_comm_type
Enum for communication type.
Definition: adxl313.h:254
_adxl313_act_inact_ctl_flags::INACT_Y_EN
uint8_t INACT_Y_EN
Definition: adxl313.h:454
ADXL313_Z_EN
#define ADXL313_Z_EN
Definition: adxl313.h:234
device
Definition: ad9361_util.h:69
adxl313_dev::com_desc
union adxl313_comm_desc com_desc
Definition: adxl313.h:490
no_os_print_log.h
Print messages helpers.
adxl313_conf_act_thr
int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug)
Definition: adxl313.c:987
ADXL313_REG_DATA_AXIS
#define ADXL313_REG_DATA_AXIS(index)
Definition: adxl313.h:71
ADXL313_LP_MODE_ON
@ ADXL313_LP_MODE_ON
Definition: adxl313.h:274
adxl313_lp_mode
adxl313_lp_mode
Enum for low power operating mode.
Definition: adxl313.h:272
adxl313_dev
ADXL313 Device structure.
Definition: adxl313.h:488
ADXL313_ODR_1600HZ
@ ADXL313_ODR_1600HZ
Definition: adxl313.h:329
adxl313_get_fifo_data
int adxl313_get_fifo_data(struct adxl313_dev *dev, uint8_t *entries, struct adxl313_frac_repr *x, struct adxl313_frac_repr *y, struct adxl313_frac_repr *z)
Definition: adxl313.c:944
ADXL313_13_BIT_RES
@ ADXL313_13_BIT_RES
Definition: adxl313.h:313
ADXL313_11_BIT_RES
@ ADXL313_11_BIT_RES
Definition: adxl313.h:311
_adxl313_int_reg_flags
Structure holding the flags for ADXL313 interrupt sources.
Definition: adxl313.h:410
ADXL313_SPI_READ
#define ADXL313_SPI_READ
Definition: adxl313.h:49
ADXL313_POWER_CTL_LINK
#define ADXL313_POWER_CTL_LINK
Definition: adxl313.h:96
ADXL313_RATE_MSK
#define ADXL313_RATE_MSK
Definition: adxl313.h:91
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
adxl313_enable_i2c
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1452
ID_ADXL312
@ ID_ADXL312
Definition: adxl313.h:245
_adxl313_int_reg_flags::OVERRUN
uint8_t OVERRUN
Definition: adxl313.h:411
ADXL313_ODR_6_25HZ
@ ADXL313_ODR_6_25HZ
Definition: adxl313.h:321
ADXL313_REG_DEVID_AD
#define ADXL313_REG_DEVID_AD
Definition: adxl313.h:54
ADXL313_I2C_COMM
@ ADXL313_I2C_COMM
Definition: adxl313.h:256
adxl313_set_fifo_samples
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:830
adxl313_dev::time_inact
uint8_t time_inact
Definition: adxl313.h:525
ADXL313_1G_RANGE
@ ADXL313_1G_RANGE
Definition: adxl313.h:295
adxl313_software_reset
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:375
adxl313_set_int_pol
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1938
adxl313_int_src_reg_flags::value
uint8_t value
Definition: adxl313.h:444
ADXL313_ODR_200HZ
@ ADXL313_ODR_200HZ
Definition: adxl313.h:326
bit_action
bit_action
Enum for selecting Set/Reset bit action.
Definition: adxl313.h:367
adxl313_dev::scale_factor_mult
int64_t scale_factor_mult
Definition: adxl313.h:515
adxl313_inactivity_int_enable
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1738
ADXL313_SELF_TEST_DIV
#define ADXL313_SELF_TEST_DIV
Definition: adxl313.h:210
ADXL313_STREAM_MODE
@ ADXL313_STREAM_MODE
Definition: adxl313.h:350
adxl313_data_ready_int_map
int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1800
ADXL313_ODR_100HZ
@ ADXL313_ODR_100HZ
Definition: adxl313.h:325
ADXL313_Z_AXIS
@ ADXL313_Z_AXIS
Definition: adxl313.h:340
adxl313_set_inactivity_detection
int adxl313_set_inactivity_detection(struct adxl313_dev *dev, uint8_t inact_axes, uint8_t inact_ac_dc, uint32_t inact_thresh_ug, uint8_t inact_time_s, uint8_t int_pin)
Enables the inactivity detection.
Definition: adxl313.c:1313
adxl313_set_offset
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:484
adxl313_enable_full_res
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1961
ADXL313_200G_RANGE
@ ADXL313_200G_RANGE
Definition: adxl313.h:302
ADXL313_MAX_FIFO_ENTRIES
#define ADXL313_MAX_FIFO_ENTRIES
Definition: adxl313.h:201
ADXL313_POWER_CTL_MEASURE
#define ADXL313_POWER_CTL_MEASURE
Definition: adxl313.h:98
_adxl313_act_inact_ctl_flags::INACT_AC_EN
uint8_t INACT_AC_EN
Definition: adxl313.h:456
ADXL313_REG_DATA_FORMAT
#define ADXL313_REG_DATA_FORMAT
Definition: adxl313.h:70
adxl313_disable_full_res
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1987
adxl313_comm_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: adxl313.h:381
adxl313_disable_i2c
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1433
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
adxl313_inactivity_int_map
int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1846
adxl313_dev::range
enum adxl313_range range
Definition: adxl313.h:496
adxl313_enable_full_res
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1961
adxl313_conf_act_thr
int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug)
Definition: adxl313.c:987
ADXL313_MEAS
@ ADXL313_MEAS
Definition: adxl313.h:265
adxl313_read
int adxl313_read(struct adxl313_dev *dev, uint8_t base_address, uint16_t size, uint8_t *read_data)
Definition: adxl313.c:66
ADXL313_REG_FIFO_CTL_MODE_MSK
#define ADXL313_REG_FIFO_CTL_MODE_MSK
Definition: adxl313.h:132
ADXL313_LP_MODE_NONE
@ ADXL313_LP_MODE_NONE
Definition: adxl313.h:273
ADXL314_SELF_TEST_MULT
#define ADXL314_SELF_TEST_MULT
Definition: adxl313.h:209
_adxl313_int_reg_flags::WATERMARK
uint8_t WATERMARK
Definition: adxl313.h:412
adxl313_comm_desc
Union holding the communication parameters.
Definition: adxl313.h:477
ADXL312_OFFSET_SCALE_FACTOR
#define ADXL312_OFFSET_SCALE_FACTOR
Definition: adxl313.h:172
adxl313_conf_inact_thr
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1069
adxl313_conf_int_map
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1783
adxl313_frac_repr::fractional
int32_t fractional
Definition: adxl313.h:390
_adxl313_int_reg_flags::reserved
uint8_t reserved
Definition: adxl313.h:413
adxl313_inactivity_int_disable
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1760
ADXL313_REG_THRESH_INACT
#define ADXL313_REG_THRESH_INACT
Definition: adxl313.h:62
DISABLE_E
@ DISABLE_E
Definition: adxl313.h:368
ADXL313_INT_ACTIVE_HIGH
@ ADXL313_INT_ACTIVE_HIGH
Definition: adxl313.h:359
adxl313_set_inactivity_detection
int adxl313_set_inactivity_detection(struct adxl313_dev *dev, uint8_t inact_axes, uint8_t inact_ac_dc, uint32_t inact_thresh_ug, uint8_t inact_time, uint8_t int_pin)
Enables the inactivity detection.
Definition: adxl313.c:1313
ADXL313_REG_SOFT_RESET
#define ADXL313_REG_SOFT_RESET
Definition: adxl313.h:59
adxl313_get_int_source_reg
int adxl313_get_int_source_reg(struct adxl313_dev *dev, union adxl313_int_src_reg_flags *int_status_flags)
Definition: adxl313.c:1915
adxl313_get_xyz
int adxl313_get_xyz(struct adxl313_dev *dev, struct adxl313_frac_repr *x_m_s2, struct adxl313_frac_repr *y_m_s2, struct adxl313_frac_repr *z_m_s2)
Definition: adxl313.c:775
ADXL313_ODR_12_5HZ
@ ADXL313_ODR_12_5HZ
Definition: adxl313.h:322
ADXL313_INT_ACTIVE_LOW
@ ADXL313_INT_ACTIVE_LOW
Definition: adxl313.h:360
ADXL313_REG_FIFO_STS_ENTRIES_MSK
#define ADXL313_REG_FIFO_STS_ENTRIES_MSK
Definition: adxl313.h:138
ID_ADXL313
@ ID_ADXL313
Definition: adxl313.h:246
ADXL313_4G_RANGE
@ ADXL313_4G_RANGE
Definition: adxl313.h:297
adxl313_dev::comm_type
enum adxl313_comm_type comm_type
Definition: adxl313.h:492
ADXL313_ODR_800HZ
@ ADXL313_ODR_800HZ
Definition: adxl313.h:328
ADXL313_REG_FIFO_STATUS
#define ADXL313_REG_FIFO_STATUS
Definition: adxl313.h:73
adxl313_conf_time_inact
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1147
adxl313_get_raw_xyz
int adxl313_get_raw_xyz(struct adxl313_dev *dev, int16_t *x_raw, int16_t *y_raw, int16_t *z_raw)
Definition: adxl313.c:742
ADXL314_OFFSET_SCALE_FACTOR
#define ADXL314_OFFSET_SCALE_FACTOR
Definition: adxl313.h:180
adxl313_set_range
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2039
ADXL313_ODR_50HZ
@ ADXL313_ODR_50HZ
Definition: adxl313.h:324
adxl313_init_param::dev_type
enum adxl313_type dev_type
Definition: adxl313.h:403
adxl313_disable_i2c
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1433
adxl313_range
adxl313_range
Enum for selecting range.
Definition: adxl313.h:293
adxl313_set_activity_detection
int adxl313_set_activity_detection(struct adxl313_dev *dev, uint8_t act_axes, uint8_t act_ac_dc, uint32_t act_thresh_ug, uint8_t int_pin)
Enable the activity detection.
Definition: adxl313.c:1249
adxl313_conf_int_enable
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1678
_adxl313_act_inact_ctl_flags::INACT_Z_EN
uint8_t INACT_Z_EN
Definition: adxl313.h:453
_adxl313_act_inact_ctl_flags::ACT_AC_EN
uint8_t ACT_AC_EN
Definition: adxl313.h:460
ADXL313_12G_RANGE
@ ADXL313_12G_RANGE
Definition: adxl313.h:301
adxl313_get_conf_act_inact_ctl
int adxl313_get_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags *config)
Definition: adxl313.c:1215
adxl313_get_time_inact
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1170
adxl313_set_activity_detection
int adxl313_set_activity_detection(struct adxl313_dev *dev, uint8_t act_axes, uint8_t act_ac_dc, uint32_t act_thresh_ug, uint8_t int_pin)
Enable the activity detection.
Definition: adxl313.c:1249
adxl313_dev::comm_buff
uint8_t comm_buff[24]
Definition: adxl313.h:529
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
ADXL313_REG_FIFO_CTL
#define ADXL313_REG_FIFO_CTL
Definition: adxl313.h:72
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
adxl313_overrun_int_map
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1892
adxl313_inactivity_int_disable
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1760
adxl313_get_raw_fifo_data
int adxl313_get_raw_fifo_data(struct adxl313_dev *dev, uint8_t *entries, int16_t *x_raw, int16_t *y_raw, int16_t *z_raw)
Definition: adxl313.c:895
ADXL313_X_EN
#define ADXL313_X_EN
Definition: adxl313.h:232
_adxl313_int_reg_flags::INACTIVITY
uint8_t INACTIVITY
Definition: adxl313.h:414
ADXL313_TRIGGERED_MODE
@ ADXL313_TRIGGERED_MODE
Definition: adxl313.h:351
adxl313_dev::dev_type
enum adxl313_type dev_type
Definition: adxl313.h:494
ADXL314_SELF_TEST_MIN_DEVIATION
#define ADXL314_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:223
ADXL313_REG_DATA_FORMAT_SELF_TEST
#define ADXL313_REG_DATA_FORMAT_SELF_TEST
Definition: adxl313.h:124
ADXL313_REG_DATA_FORMAT_INT_INV
#define ADXL313_REG_DATA_FORMAT_INT_INV
Definition: adxl313.h:126
ADXL313_FIFO_MODE
@ ADXL313_FIFO_MODE
Definition: adxl313.h:349
ADXL313_1_5G_RANGE
@ ADXL313_1_5G_RANGE
Definition: adxl313.h:298
_adxl313_act_inact_ctl_flags::ACT_X_EN
uint8_t ACT_X_EN
Definition: adxl313.h:459
adxl313_get_int_source_reg
int adxl313_get_int_source_reg(struct adxl313_dev *dev, union adxl313_int_src_reg_flags *int_status_flags)
Definition: adxl313.c:1915
adxl313_dev::act_inact_ctl
union adxl313_act_inact_ctl_flags act_inact_ctl
Definition: adxl313.h:527
adxl313_enable_i2c
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1452
ADXL313_ODR_25HZ
@ ADXL313_ODR_25HZ
Definition: adxl313.h:323
adxl313_activity_int_map
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1823
ADXL313_REG_OFS_AXIS
#define ADXL313_REG_OFS_AXIS(index)
Definition: adxl313.h:60
ADXL313_X_AXIS
@ ADXL313_X_AXIS
Definition: adxl313.h:338
adxl313_overrun_int_map
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1892
adxl313_wake_up_f
adxl313_wake_up_f
Enum for frequency of wake-up events during sleep.
Definition: adxl313.h:282
ADXL314_SELF_TEST_MAX_DEVIATION
#define ADXL314_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:225
adxl313_dev::fifo_samples
uint8_t fifo_samples
Definition: adxl313.h:519
adxl313_get_raw_xyz
int adxl313_get_raw_xyz(struct adxl313_dev *dev, int16_t *x_raw, int16_t *y_raw, int16_t *z_raw)
Definition: adxl313.c:742
ADXL313_BYPAS_MODE
@ ADXL313_BYPAS_MODE
Definition: adxl313.h:348
ADXL312_SELF_TEST_MIN_DEVIATION
#define ADXL312_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:213
adxl313_set_odr
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1370
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
adxl313_act_inact_ctl_flags
Union holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:468
adxl313_init_param::comm_type
enum adxl313_comm_type comm_type
Definition: adxl313.h:401
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
adxl313_get_op_mode
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:457
_adxl313_act_inact_ctl_flags
Structure holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:452
ADXL313_WU_8_HZ
@ ADXL313_WU_8_HZ
Definition: adxl313.h:283
ADXL313_0_5G_RANGE
@ ADXL313_0_5G_RANGE
Definition: adxl313.h:294
adxl313_get_full_res_setting
int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res)
Definition: adxl313.c:2015
ADXL313_REG_DATA_FORMAT_FULL_RES
#define ADXL313_REG_DATA_FORMAT_FULL_RES
Definition: adxl313.h:127
ENABLE_E
@ ENABLE_E
Definition: adxl313.h:369
no_os_i2c.h
Header file of I2C Interface.
ADXL313_REG_INT_EN
#define ADXL313_REG_INT_EN
Definition: adxl313.h:67
ADXL313_Y_AXIS
@ ADXL313_Y_AXIS
Definition: adxl313.h:339
adxl313_remove
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:352
adxl313_dev::z_offset_raw
uint8_t z_offset_raw
Definition: adxl313.h:513
ADXL313_10_BIT_RES
@ ADXL313_10_BIT_RES
Definition: adxl313.h:310
adxl313_set_autosleep_mode
int adxl313_set_autosleep_mode(struct adxl313_dev *dev, enum bit_action enable, uint8_t inact_thr, uint8_t time_inact_s)
Definition: adxl313.c:1525
adxl313_get_conf_act_inact_ctl
int adxl313_get_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags *config)
Definition: adxl313.c:1215
adxl313_get_time_inact
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1170
adxl313_set_raw_offset
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:600
adxl313_init_param::comm_init
union adxl313_comm_init_param comm_init
Definition: adxl313.h:399
adxl313_inactivity_int_map
int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1846
ADXL313_WU_4_HZ
@ ADXL313_WU_4_HZ
Definition: adxl313.h:284
ADXL313_12_BIT_RES
@ ADXL313_12_BIT_RES
Definition: adxl313.h:312
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
adxl313_conf_act_inact_ctl
int adxl313_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags config)
Definition: adxl313.c:1192
adxl313_dev::resolution
enum adxl313_resolution resolution
Definition: adxl313.h:498
ADXL313_REG_PARTID
#define ADXL313_REG_PARTID
Definition: adxl313.h:56
ADXL313_REG_DATA_FORMAT_RANGE
#define ADXL313_REG_DATA_FORMAT_RANGE
Definition: adxl313.h:129
ADXL313_DEVID
#define ADXL313_DEVID
Definition: adxl313.h:76
ADXL313_LOW_POWER_OP
#define ADXL313_LOW_POWER_OP
Definition: adxl313.h:92
adxl313_dev::op_mode
enum adxl313_op_mode op_mode
Definition: adxl313.h:500
adxl313_dev::inact_thr
uint8_t inact_thr
Definition: adxl313.h:523
adxl313_sleep
int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz)
Definition: adxl313.c:1620
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
adxl313_activity_int_disable
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1716
ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES
#define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:157
adxl313_set_fifo_mode
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:863
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
adxl313_conf_act_inact_ctl
int adxl313_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags config)
Definition: adxl313.c:1192
_adxl313_int_reg_flags::reserved1
uint8_t reserved1
Definition: adxl313.h:416
ADXL313_REG_ACT_INACT_CTL
#define ADXL313_REG_ACT_INACT_CTL
Definition: adxl313.h:64
adxl313_comm_desc::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adxl313.h:481
adxl313_dev::odr
enum adxl313_odr odr
Definition: adxl313.h:504
ADXL313_6G_RANGE
@ ADXL313_6G_RANGE
Definition: adxl313.h:300
ADXL313_MAX_FIFO_SAMPLES_VAL
#define ADXL313_MAX_FIFO_SAMPLES_VAL
Definition: adxl313.h:88
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
adxl313_int_src_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:443
ADXL313_SELF_TEST_MIN_DEVIATION
#define ADXL313_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:218
adxl313_int_en_reg_flags::value
uint8_t value
Definition: adxl313.h:426
ADXL313_2G_RANGE
@ ADXL313_2G_RANGE
Definition: adxl313.h:296
ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES
#define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:145
_adxl313_act_inact_ctl_flags::INACT_X_EN
uint8_t INACT_X_EN
Definition: adxl313.h:455
ADXL313_LP_MODE_AUTOSLEEP
@ ADXL313_LP_MODE_AUTOSLEEP
Definition: adxl313.h:275
adxl313_set_fifo_samples
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:830
adxl313_set_op_mode
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:419
adxl313_software_reset
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:375
_adxl313_act_inact_ctl_flags::ACT_Y_EN
uint8_t ACT_Y_EN
Definition: adxl313.h:458
adxl313_set_int_pol
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1938
adxl313_link_mode_disable
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1600
adxl313_self_test
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2122
adxl313_inactivity_int_enable
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1738
adxl313_exit_sleep
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1650
adxl313_dev::fifo_mode
enum adxl313_fifo_mode fifo_mode
Definition: adxl313.h:517
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
ADXL313_ODR_3200HZ
@ ADXL313_ODR_3200HZ
Definition: adxl313.h:330
adxl313_activity_int_enable
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1694
adxl313_set_offset
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:484
ADXL313_REGS_PER_ENTRY
#define ADXL313_REGS_PER_ENTRY
Definition: adxl313.h:198
adxl313_set_op_mode
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:419
adxl313_disable_full_res
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1987
ADXL314_THRESH_SCALE_FACTOR
#define ADXL314_THRESH_SCALE_FACTOR
Definition: adxl313.h:192
ADXL313_PARTID
#define ADXL313_PARTID
Definition: adxl313.h:80
_adxl313_act_inact_ctl_flags::ACT_Z_EN
uint8_t ACT_Z_EN
Definition: adxl313.h:457
adxl313_exit_sleep
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1650
ADXL313_Y_EN
#define ADXL313_Y_EN
Definition: adxl313.h:233
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
ADXL313_SELF_TEST_SAMPLES
#define ADXL313_SELF_TEST_SAMPLES
Definition: adxl313.h:204
adxl313_act_inact_ctl_flags::fields
struct _adxl313_act_inact_ctl_flags fields
Definition: adxl313.h:469
ADXL313_3G_RANGE
@ ADXL313_3G_RANGE
Definition: adxl313.h:299
adxl313_get_act_thr
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1028
no_os_util.h
Header file of utility functions.
adxl313_get_offset
int adxl313_get_offset(struct adxl313_dev *dev, int32_t *offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:540
adxl313_get_inact_thr
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1110
adxl313.h
Header file of ADXL313 Driver.
adxl313_write
int adxl313_write(struct adxl313_dev *dev, uint8_t base_address, uint16_t size, uint8_t *write_data)
Definition: adxl313.c:101
ADXL313_POWER_CTL_AUTO_SLEEP
#define ADXL313_POWER_CTL_AUTO_SLEEP
Definition: adxl313.h:97
ADXL313_REG_DEVID1_AD
#define ADXL313_REG_DEVID1_AD
Definition: adxl313.h:55
ADXL313_REG_FIFO_CTL_SAMPLES_MSK
#define ADXL313_REG_FIFO_CTL_SAMPLES_MSK
Definition: adxl313.h:134
ADXL313_REG_INT_MAP
#define ADXL313_REG_INT_MAP
Definition: adxl313.h:68
adxl313_dev::y_offset_raw
uint8_t y_offset_raw
Definition: adxl313.h:510
adxl313_int_pol
adxl313_int_pol
Enum for selecting interrupt polarity.
Definition: adxl313.h:358
ADXL313_RESET_KEY
#define ADXL313_RESET_KEY
Definition: adxl313.h:85
ADXL313_ACC_SCALE_FACTOR_DIV
#define ADXL313_ACC_SCALE_FACTOR_DIV
Definition: adxl313.h:168
ADXL313_SPI_WRITE
#define ADXL313_SPI_WRITE
Definition: adxl313.h:50
adxl313_int_map_reg_flags
Union holding the flags for ADXL313 interrupt mapping.
Definition: adxl313.h:433
adxl313_act_inact_ctl_flags::value
uint8_t value
Definition: adxl313.h:470
adxl313_dev::lp_mode
enum adxl313_lp_mode lp_mode
Definition: adxl313.h:502
adxl313_conf_inact_thr
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1069
adxl313_fifo_mode
adxl313_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl313.h:347
adxl313_get_raw_offset
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:694
adxl313_comm_init_param::i2c_init
struct no_os_i2c_init_param i2c_init
Definition: adxl313.h:379
ADXL313_THRESH_SCALE_FACTOR
#define ADXL313_THRESH_SCALE_FACTOR
Definition: adxl313.h:188
adxl313_init
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:162
adxl313_get_offset
int adxl313_get_offset(struct adxl313_dev *dev, int32_t *offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:540
adxl313_link_mode_disable
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1600
ADXL313_WU_2_HZ
@ ADXL313_WU_2_HZ
Definition: adxl313.h:285
adxl313_resolution
adxl313_resolution
Enum for specifying resolution.
Definition: adxl313.h:309
adxl313_self_test
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2122
ADXL313_STDBY
@ ADXL313_STDBY
Definition: adxl313.h:264
adxl313_activity_int_enable
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1694
ADXL313_REG_TIME_INACT
#define ADXL313_REG_TIME_INACT
Definition: adxl313.h:63
errno.h
Error macro definition for ARM Compiler.
adxl313_get_full_res_setting
int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res)
Definition: adxl313.c:2015
adxl313_comm_desc::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: adxl313.h:479
adxl313_get_odr
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1409
adxl313_get_raw_offset
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:694
ADXL313_ODR_400HZ
@ ADXL313_ODR_400HZ
Definition: adxl313.h:327
_adxl313_int_reg_flags::ACTIVITY
uint8_t ACTIVITY
Definition: adxl313.h:415
adxl313_conf_time_inact
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1147
adxl313_init
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:162
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
ADXL313_REG_THRESH_ACT
#define ADXL313_REG_THRESH_ACT
Definition: adxl313.h:61
adxl313_axis
adxl313_axis
Enum for accelerometer axis.
Definition: adxl313.h:337
ID_ADXL314
@ ID_ADXL314
Definition: adxl313.h:247
adxl313_conf_int_enable
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1678