no-OS
adxl313.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __ADXL313_H__
40 #define __ADXL313_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include <string.h>
47 #include "no_os_util.h"
48 #include "no_os_i2c.h"
49 #include "no_os_spi.h"
50 
51 /******************************************************************************/
52 /********************** Macros and Constants Definitions **********************/
53 /******************************************************************************/
54 /* SPI commands */
55 #define ADXL313_SPI_READ (0x80)
56 #define ADXL313_SPI_WRITE (0x00)
57 #define ADXL313_MULTIBIT NO_OS_BIT(6)
58 
59 /* ADXL313 register map */
60 #define ADXL313_REG_DEVID_AD 0x00
61 #define ADXL313_REG_DEVID1_AD 0x01
62 #define ADXL313_REG_PARTID 0x02
63 #define ADXL313_REG_REVID 0x03
64 #define ADXL313_REG_XID 0x04
65 #define ADXL313_REG_SOFT_RESET 0x18
66 #define ADXL313_REG_OFS_AXIS(index) (0x1E + (index))
67 #define ADXL313_REG_THRESH_ACT 0x24
68 #define ADXL313_REG_THRESH_INACT 0x25
69 #define ADXL313_REG_TIME_INACT 0x26
70 #define ADXL313_REG_ACT_INACT_CTL 0x27
71 #define ADXL313_REG_BW_RATE 0x2C
72 #define ADXL313_REG_POWER_CTL 0x2D
73 #define ADXL313_REG_INT_EN 0x2E
74 #define ADXL313_REG_INT_MAP 0x2F
75 #define ADXL313_REG_INT_SRC 0x30
76 #define ADXL313_REG_DATA_FORMAT 0x31
77 #define ADXL313_REG_DATA_AXIS(index) (0x32 + ((index) * 2))
78 #define ADXL313_REG_FIFO_CTL 0x38
79 #define ADXL313_REG_FIFO_STATUS 0x39
80 
81 /* ADXL313_REG_DEVID_AD value */
82 #define ADXL313_DEVID 0xAD
83 /* ADXL313_REG_DEVID1_AD value */
84 #define ADXL313_DEVID1 0x1D
85 /* ADXL313_REG_PARTID value, 0xCB, 313 in octal */
86 #define ADXL313_PARTID 0xCB
87 /* ADXL314_DEVID_AD value, same as ADXL312 */
88 #define ADXL314_DEVID 0xE5
89 
90 /* ADXL313 reset key */
91 #define ADXL313_RESET_KEY 0x52
92 
93 /* Maximum number of FIFO samples */
94 #define ADXL313_MAX_FIFO_SAMPLES_VAL 0x60
95 
96 /* Device bandwidth settings, ADXL313_REG_BW_RATE definitions */
97 #define ADXL313_RATE_MSK NO_OS_GENMASK(3, 0)
98 #define ADXL313_LOW_POWER_OP NO_OS_BIT(4)
99 
100 /* ADXL313_REG_POWER_CTL definitions */
101 #define ADXL313_POWER_CTL_I2C_DISABLE NO_OS_BIT(6)
102 #define ADXL313_POWER_CTL_LINK NO_OS_BIT(5)
103 #define ADXL313_POWER_CTL_AUTO_SLEEP NO_OS_BIT(4)
104 #define ADXL313_POWER_CTL_MEASURE NO_OS_BIT(3)
105 #define ADXL313_POWER_CTL_SLEEP NO_OS_BIT(2)
106 #define ADXL313_POWER_CTL_WAKEUP(x) ((x) & 0x3)
107 
108 /* ADXL313_REG_INT_EN definitions */
109 #define ADXL313_REG_INT_EN_DATA_READY NO_OS_BIT(7)
110 #define ADXL313_REG_INT_EN_ACTIVITY NO_OS_BIT(4)
111 #define ADXL313_REG_INT_EN_INACTIVITY NO_OS_BIT(3)
112 #define ADXL313_REG_INT_EN_WATERMARK NO_OS_BIT(1)
113 #define ADXL313_REG_INT_EN_OVERRUN NO_OS_BIT(0)
114 
115 /* ADXL313_REG_INT_MAP definitions */
116 #define ADXL313_REG_INT_MAP_DR_INT2 NO_OS_BIT(7)
117 #define ADXL313_REG_INT_MAP_ACT_INT2 NO_OS_BIT(4)
118 #define ADXL313_REG_INT_MAP_INACT_INT2 NO_OS_BIT(3)
119 #define ADXL313_REG_INT_MAP_WM_INT2 NO_OS_BIT(1)
120 #define ADXL313_REG_INT_MAP_OVER_INT2 NO_OS_BIT(0)
121 
122 /* ADXL313_REG_INT_SRC definitions */
123 #define ADXL313_REG_INT_SRC_DATA_READY NO_OS_BIT(7)
124 #define ADXL313_REG_INT_SRC_ACTIVITY NO_OS_BIT(4)
125 #define ADXL313_REG_INT_SRC_INACTIVITY NO_OS_BIT(3)
126 #define ADXL313_REG_INT_SRC_WATERMARK NO_OS_BIT(1)
127 #define ADXL313_REG_INT_SRC_OVERRUN NO_OS_BIT(0)
128 
129 /* ADXL313_REG_DATA_FORMAT definitions */
130 #define ADXL313_REG_DATA_FORMAT_SELF_TEST NO_OS_BIT(7)
131 #define ADXL313_REG_DATA_FORMAT_SPI_3WIRE NO_OS_BIT(6)
132 #define ADXL313_REG_DATA_FORMAT_INT_INV NO_OS_BIT(5)
133 #define ADXL313_REG_DATA_FORMAT_FULL_RES NO_OS_BIT(3)
134 #define ADXL313_REG_DATA_FORMAT_JUSTIFY_BIT NO_OS_BIT(2)
135 #define ADXL313_REG_DATA_FORMAT_RANGE NO_OS_GENMASK(1, 0)
136 
137 /* ADXL313_REG_FIFO_CTL definitions */
138 #define ADXL313_REG_FIFO_CTL_MODE_MSK NO_OS_GENMASK(7, 6)
139 #define ADXL313_REG_FIFO_CTL_TRIGGER_BIT NO_OS_BIT(5)
140 #define ADXL313_REG_FIFO_CTL_SAMPLES_MSK NO_OS_GENMASK(4, 0)
141 
142 /* ADXL313_REG_FIFO_STATUS definitions */
143 #define ADXL313_REG_FIFO_FIFO_TRIGGER_BIT NO_OS_BIT(7)
144 #define ADXL313_REG_FIFO_STS_ENTRIES_MSK NO_OS_GENMASK(5, 0)
145 
146 /*
147  * ADXL312
148  * At all g ranges with full bit resolution, sensitivity is given in datasheet as
149  * 2.9 mg/LSB = 0.0029000 * 9.80665 = 0.0284392850 m/s^2.
150  */
151 #define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)28439285ULL)
152 
153 /*
154  * ADXL313
155  * At all g ranges with full bit resolution, sensitivity is given in datasheet as
156  * 1024 LSB/g = 0.0009765625 * 9.80665 = 0.00957680664 m/s^2.
157  *
158  * For +/- 2g range, a multiplier with value 2 is used.
159  * For +/- 2g range, a multiplier with value 4 is used.
160  * For +/- 4g range, a multiplier with value 8 is used.
161  *
162  */
163 #define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)957680664ULL)
164 /* Divider used for dividing of multiplier.
165  * Multiplication with 100 was used for preserving precision. */
166 #define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER ((int32_t)100)
167 
168 /*
169  * ADXL314
170  * At +/-200g with 13-bit resolution, scale factor is given in datasheet as
171  * 48.83 mg/LSB = 0.0488300 * 9.80665 = 0.4788587195 m/s^2.
172  */
173 #define ADXL314_ACC_SCALE_FACTOR_MUL ((int64_t)478858719ULL)
174 #define ADXL313_ACC_SCALE_FACTOR_DIV ((int32_t)1000000000)
175 
176 /* ADXL312
177  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
178 #define ADXL312_OFFSET_SCALE_FACTOR 11600
179 
180 /* ADXL313
181  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
182 #define ADXL313_OFFSET_SCALE_FACTOR 3900
183 
184 /* ADXL314
185  * The scale factor of the offset adjustment, in g / 1000 000 (ug) */
186 #define ADXL314_OFFSET_SCALE_FACTOR 195000
187 
188 /* ADXL312
189  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
190 #define ADXL312_THRESH_SCALE_FACTOR 46400
191 
192 /* ADXL313
193  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
194 #define ADXL313_THRESH_SCALE_FACTOR 15625
195 
196 /* ADXL314
197  * The scale factor of the activity/inactivity thresholds, in g / 1000 000 (ug) */
198 #define ADXL314_THRESH_SCALE_FACTOR 784000
199 
200 /* Offset added to the ODR enum for obtaining corresponding register setting */
201 #define ADXL313_ODR_OFFSET_VAL 6
202 
203 /* Number of registers read for all axes */
204 #define ADXL313_REGS_PER_ENTRY 6
205 
206 /* Max number of FIFO entries */
207 #define ADXL313_MAX_FIFO_ENTRIES 32
208 
209 /* Number of Self-test samples */
210 #define ADXL313_SELF_TEST_SAMPLES 10
211 
212 /* Self-test multiplication factor */
213 #define ADXL312_SELF_TEST_MULT 2900
214 #define ADXL313_SELF_TEST_MULT 976
215 #define ADXL314_SELF_TEST_MULT 48830
216 #define ADXL313_SELF_TEST_DIV 1000
217 
218 /* Self-test minimum deviation for ADXL312, mg */
219 #define ADXL312_SELF_TEST_MIN_DEVIATION 300
220 /* Self-test maximum deviation for ADXL312, mg */
221 #define ADXL312_SELF_TEST_MAX_DEVIATION 3400
222 
223 /* Self-test minimum deviation for ADXL313, mg */
224 #define ADXL313_SELF_TEST_MIN_DEVIATION 300
225 /* Self-test maximum deviation for ADXL313, mg */
226 #define ADXL313_SELF_TEST_MAX_DEVIATION 3700
227 
228 /* Self-test minimum deviation for ADXL314, mg */
229 #define ADXL314_SELF_TEST_MIN_DEVIATION 100
230 /* Self-test maximum deviation for ADXL314, mg */
231 #define ADXL314_SELF_TEST_MAX_DEVIATION 8000
232 
233 /* Factor used for distinguishing between ADXL312 and ADXL313 ranges */
234 #define ADXL313_RANGE_FACTOR 4
235 
236 /* Activity/inactivity detection defines */
237 /* Enable axis for participating in act/inact detection */
238 #define ADXL313_X_EN NO_OS_BIT(1)
239 #define ADXL313_Y_EN NO_OS_BIT(2)
240 #define ADXL313_Z_EN NO_OS_BIT(3)
241 
242 /******************************************************************************/
243 /*************************** Types Declarations *******************************/
244 /******************************************************************************/
245 
254 };
255 
263 };
264 
272 };
273 
282 };
283 
293 };
294 
309 };
310 
320 };
321 
337 };
338 
347 };
348 
358 };
359 
367 };
368 
376 };
377 
388 } ;
389 
395  int64_t integer;
396  int32_t fractional;
397 };
398 
410 };
411 
417  uint8_t OVERRUN : 1;
418  uint8_t WATERMARK : 1;
419  uint8_t reserved : 1;
420  uint8_t INACTIVITY : 1;
421  uint8_t ACTIVITY : 1;
422  uint8_t reserved1 : 2;
423  uint8_t DATA_READY : 1;
424 };
425 
432  uint8_t value;
433 };
434 
441  uint8_t value;
442 };
443 
450  uint8_t value;
451 };
452 
459  uint8_t INACT_Z_EN : 1;
460  uint8_t INACT_Y_EN : 1;
461  uint8_t INACT_X_EN : 1;
462  uint8_t INACT_AC_EN : 1;
463  uint8_t ACT_Z_EN : 1;
464  uint8_t ACT_Y_EN : 1;
465  uint8_t ACT_X_EN : 1;
466  uint8_t ACT_AC_EN : 1;
467 };
468 
476  uint8_t value;
477 };
478 
488 };
489 
494 struct adxl313_dev {
513  uint8_t x_offset_raw;
516  uint8_t y_offset_raw;
519  uint8_t z_offset_raw;
525  uint8_t fifo_samples;
527  uint8_t act_thr;
529  uint8_t inact_thr;
531  uint8_t time_inact;
535  uint8_t comm_buff[24];
536 };
537 
538 /******************************************************************************/
539 /************************ Functions Declarations ******************************/
540 /******************************************************************************/
542 int adxl313_init(struct adxl313_dev **device,
544 
546 int adxl313_remove(struct adxl313_dev *dev);
547 
549 int adxl313_software_reset(struct adxl313_dev *dev);
550 
552 int adxl313_set_op_mode(struct adxl313_dev *dev,
553  enum adxl313_op_mode op_mode);
554 
556 int adxl313_get_op_mode(struct adxl313_dev *dev,
557  enum adxl313_op_mode *op_mode);
558 
560 int adxl313_set_offset(struct adxl313_dev *dev,
561  int32_t offset_ug,
562  enum adxl313_axis axis);
563 
565 int adxl313_get_offset(struct adxl313_dev *dev,
566  int32_t *offset_ug,
567  enum adxl313_axis axis);
568 
570 int adxl313_set_raw_offset(struct adxl313_dev *dev,
571  int32_t offset_raw,
572  enum adxl313_axis axis);
573 
575 int adxl313_get_raw_offset(struct adxl313_dev *dev,
576  int32_t *offset_raw,
577  enum adxl313_axis axis);
578 
580 int adxl313_get_raw_xyz(struct adxl313_dev *dev,
581  int16_t *x_raw,
582  int16_t *y_raw,
583  int16_t *z_raw);
584 
586 int adxl313_get_xyz(struct adxl313_dev *dev,
587  struct adxl313_frac_repr *x_m_s2,
588  struct adxl313_frac_repr *y_m_s2,
589  struct adxl313_frac_repr *z_m_s2);
590 
593  uint8_t *entries_no);
594 
596 int adxl313_set_fifo_samples(struct adxl313_dev *dev,
597  uint8_t samples_no);
598 
600 int adxl313_set_fifo_mode(struct adxl313_dev *dev,
601  enum adxl313_fifo_mode mode);
602 
604 int adxl313_get_raw_fifo_data(struct adxl313_dev *dev, uint8_t *entries,
605  int16_t *x_raw, int16_t *y_raw, int16_t *z_raw);
606 
608 int adxl313_get_fifo_data(struct adxl313_dev *dev,
609  uint8_t *entries,
610  struct adxl313_frac_repr *x,
611  struct adxl313_frac_repr *y,
612  struct adxl313_frac_repr *z);
613 
615 int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug);
616 
618 int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug);
619 
621 int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug);
622 
624 int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug);
625 
627 int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s);
628 
630 int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s);
631 
634  union adxl313_act_inact_ctl_flags config);
635 
638  union adxl313_act_inact_ctl_flags *config);
639 
642  uint8_t act_axes,
643  uint8_t act_ac_dc,
644  uint32_t act_thresh_ug,
645  uint8_t int_pin);
646 
649  uint8_t inact_axes,
650  uint8_t inact_ac_dc,
651  uint32_t inact_thresh_ug,
652  uint8_t inact_time,
653  uint8_t int_pin);
654 
656 int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr);
657 
659 int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr);
660 
662 int adxl313_disable_i2c(struct adxl313_dev *dev);
663 
665 int adxl313_enable_i2c(struct adxl313_dev *dev);
666 
669  enum bit_action enable);
670 
672 int adxl313_set_autosleep_mode(struct adxl313_dev *dev, enum bit_action enable,
673  uint8_t inact_thr, uint8_t time_inact_s);
674 
676 int adxl313_link_mode_enable(struct adxl313_dev *dev);
677 
679 int adxl313_link_mode_disable(struct adxl313_dev *dev);
680 
682 int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz);
683 
685 int adxl313_exit_sleep(struct adxl313_dev *dev);
686 
688 int adxl313_conf_int_enable(struct adxl313_dev *dev,
689  union adxl313_int_en_reg_flags en_ctl);
690 
693 
696 
699 
702 
704 int adxl313_conf_int_map(struct adxl313_dev *dev,
705  union adxl313_int_map_reg_flags int_map);
706 
708 int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin);
709 
711 int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin);
712 
714 int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin);
715 
717 int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin);
718 
720 int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin);
721 
724  union adxl313_int_src_reg_flags *int_status_flags);
725 
727 int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol);
728 
730 int adxl313_enable_full_res(struct adxl313_dev *dev);
731 
733 int adxl313_disable_full_res(struct adxl313_dev *dev);
734 
736 int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res);
737 
739 int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range);
740 
742 int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range);
743 
744 /* Perform device self-test. */
745 int adxl313_self_test(struct adxl313_dev *dev);
746 
747 #endif /* __ADXL313_H__ */
adxl313_dev::x_offset_raw
uint8_t x_offset_raw
Definition: adxl313.h:513
adxl313_int_map_reg_flags::value
uint8_t value
Definition: adxl313.h:441
adxl313_int_src_reg_flags
Union holding the flags for ADXL313 interrupt source.
Definition: adxl313.h:448
adxl313_frac_repr
Data format in which the acceleration values are converted.
Definition: adxl313.h:394
adxl313_get_act_thr
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1032
adxl313_get_inact_thr
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1114
no_os_alloc.h
ADXL314_ACC_SCALE_FACTOR_MUL
#define ADXL314_ACC_SCALE_FACTOR_MUL
Definition: adxl313.h:173
adxl313_watermark_int_map
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1873
ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER
#define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER
Definition: adxl313.h:166
ADXL313_WU_1_HZ
@ ADXL313_WU_1_HZ
Definition: adxl313.h:292
ADXL312_SELF_TEST_MULT
#define ADXL312_SELF_TEST_MULT
Definition: adxl313.h:213
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:1624
ADXL312_SELF_TEST_MAX_DEVIATION
#define ADXL312_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:221
ADXL313_SELF_TEST_MAX_DEVIATION
#define ADXL313_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:226
ADXL313_RANGE_FACTOR
#define ADXL313_RANGE_FACTOR
Definition: adxl313.h:234
adxl313_activity_int_disable
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1720
adxl313_set_fifo_mode
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:869
_adxl313_int_reg_flags::DATA_READY
uint8_t DATA_READY
Definition: adxl313.h:423
adxl313_int_en_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:431
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:165
ADXL313_REG_INT_SRC
#define ADXL313_REG_INT_SRC
Definition: adxl313.h:75
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:58
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:901
adxl313_get_no_of_fifo_entries
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:813
ADXL314_DEVID
#define ADXL314_DEVID
Definition: adxl313.h:88
ADXL312_THRESH_SCALE_FACTOR
#define ADXL312_THRESH_SCALE_FACTOR
Definition: adxl313.h:190
adxl313_get_range
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2095
ADXL313_SPI_COMM
@ ADXL313_SPI_COMM
Definition: adxl313.h:261
adxl313_odr
adxl313_odr
Enum for selecting output data rate.
Definition: adxl313.h:326
ADXL313_POWER_CTL_WAKEUP
#define ADXL313_POWER_CTL_WAKEUP(x)
Definition: adxl313.h:106
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:165
adxl313_link_mode_enable
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1585
adxl313_activity_int_map
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1827
adxl313_get_odr
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1413
adxl313_op_mode
adxl313_op_mode
Enum for operating mode.
Definition: adxl313.h:269
adxl313_conf_int_map
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1787
ADXL313_POWER_CTL_I2C_DISABLE
#define ADXL313_POWER_CTL_I2C_DISABLE
Definition: adxl313.h:101
adxl313_int_map_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:440
ADXL313_REG_POWER_CTL
#define ADXL313_REG_POWER_CTL
Definition: adxl313.h:72
no_os_spi.h
Header file of SPI Interface.
adxl313_comm_init_param
Structure holding the parameters for ADXL313 communication initialization.
Definition: adxl313.h:383
adxl313_set_odr
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1374
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:948
ADXL313_ODR_OFFSET_VAL
#define ADXL313_ODR_OFFSET_VAL
Definition: adxl313.h:201
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:781
adxl313_init_param
Structure holding the parameters for ADXL313 device initialization.
Definition: adxl313.h:403
adxl313_get_op_mode
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:463
adxl313_set_low_power_mode
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1477
adxl313_link_mode_enable
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1585
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:119
adxl313_type
adxl313_type
Enum for device type.
Definition: adxl313.h:250
ADXL313_OFFSET_SCALE_FACTOR
#define ADXL313_OFFSET_SCALE_FACTOR
Definition: adxl313.h:182
ADXL313_POWER_CTL_SLEEP
#define ADXL313_POWER_CTL_SLEEP
Definition: adxl313.h:105
adxl313_remove
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:358
adxl313_set_range
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2043
adxl313_watermark_int_map
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1873
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:94
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:1529
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:139
adxl313_dev::act_thr
uint8_t act_thr
Definition: adxl313.h:527
adxl313_set_raw_offset
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:606
ADXL313_DEVID1
#define ADXL313_DEVID1
Definition: adxl313.h:84
ADXL313_REG_BW_RATE
#define ADXL313_REG_BW_RATE
Definition: adxl313.h:71
adxl313_int_en_reg_flags
Union holding the flags for ADXL313 interrupt enable.
Definition: adxl313.h:430
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:1804
adxl313_set_low_power_mode
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1477
ADXL313_SELF_TEST_MULT
#define ADXL313_SELF_TEST_MULT
Definition: adxl313.h:214
ADXL313_MULTIBIT
#define ADXL313_MULTIBIT
Definition: adxl313.h:57
adxl313_get_no_of_fifo_entries
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:813
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:121
adxl313_get_range
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2095
adxl313_frac_repr::integer
int64_t integer
Definition: adxl313.h:395
adxl313_comm_type
adxl313_comm_type
Enum for communication type.
Definition: adxl313.h:260
_adxl313_act_inact_ctl_flags::INACT_Y_EN
uint8_t INACT_Y_EN
Definition: adxl313.h:460
ADXL313_Z_EN
#define ADXL313_Z_EN
Definition: adxl313.h:240
device
Definition: ad9361_util.h:75
adxl313_dev::com_desc
union adxl313_comm_desc com_desc
Definition: adxl313.h:496
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:991
ADXL313_REG_DATA_AXIS
#define ADXL313_REG_DATA_AXIS(index)
Definition: adxl313.h:77
ADXL313_LP_MODE_ON
@ ADXL313_LP_MODE_ON
Definition: adxl313.h:280
adxl313_lp_mode
adxl313_lp_mode
Enum for low power operating mode.
Definition: adxl313.h:278
adxl313_dev
ADXL313 Device structure.
Definition: adxl313.h:494
ADXL313_ODR_1600HZ
@ ADXL313_ODR_1600HZ
Definition: adxl313.h:335
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:948
ADXL313_13_BIT_RES
@ ADXL313_13_BIT_RES
Definition: adxl313.h:319
ADXL313_11_BIT_RES
@ ADXL313_11_BIT_RES
Definition: adxl313.h:317
_adxl313_int_reg_flags
Structure holding the flags for ADXL313 interrupt sources.
Definition: adxl313.h:416
ADXL313_SPI_READ
#define ADXL313_SPI_READ
Definition: adxl313.h:55
ADXL313_POWER_CTL_LINK
#define ADXL313_POWER_CTL_LINK
Definition: adxl313.h:102
ADXL313_RATE_MSK
#define ADXL313_RATE_MSK
Definition: adxl313.h:97
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:60
adxl313_enable_i2c
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1456
ID_ADXL312
@ ID_ADXL312
Definition: adxl313.h:251
_adxl313_int_reg_flags::OVERRUN
uint8_t OVERRUN
Definition: adxl313.h:417
ADXL313_ODR_6_25HZ
@ ADXL313_ODR_6_25HZ
Definition: adxl313.h:327
ADXL313_REG_DEVID_AD
#define ADXL313_REG_DEVID_AD
Definition: adxl313.h:60
ADXL313_I2C_COMM
@ ADXL313_I2C_COMM
Definition: adxl313.h:262
adxl313_set_fifo_samples
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:836
adxl313_dev::time_inact
uint8_t time_inact
Definition: adxl313.h:531
ADXL313_1G_RANGE
@ ADXL313_1G_RANGE
Definition: adxl313.h:301
adxl313_software_reset
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:381
adxl313_set_int_pol
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1942
adxl313_int_src_reg_flags::value
uint8_t value
Definition: adxl313.h:450
ADXL313_ODR_200HZ
@ ADXL313_ODR_200HZ
Definition: adxl313.h:332
bit_action
bit_action
Enum for selecting Set/Reset bit action.
Definition: adxl313.h:373
adxl313_dev::scale_factor_mult
int64_t scale_factor_mult
Definition: adxl313.h:521
adxl313_inactivity_int_enable
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1742
ADXL313_SELF_TEST_DIV
#define ADXL313_SELF_TEST_DIV
Definition: adxl313.h:216
ADXL313_STREAM_MODE
@ ADXL313_STREAM_MODE
Definition: adxl313.h:356
adxl313_data_ready_int_map
int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1804
ADXL313_ODR_100HZ
@ ADXL313_ODR_100HZ
Definition: adxl313.h:331
ADXL313_Z_AXIS
@ ADXL313_Z_AXIS
Definition: adxl313.h:346
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:1317
adxl313_set_offset
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:490
adxl313_enable_full_res
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1965
ADXL313_200G_RANGE
@ ADXL313_200G_RANGE
Definition: adxl313.h:308
ADXL313_MAX_FIFO_ENTRIES
#define ADXL313_MAX_FIFO_ENTRIES
Definition: adxl313.h:207
ADXL313_POWER_CTL_MEASURE
#define ADXL313_POWER_CTL_MEASURE
Definition: adxl313.h:104
_adxl313_act_inact_ctl_flags::INACT_AC_EN
uint8_t INACT_AC_EN
Definition: adxl313.h:462
ADXL313_REG_DATA_FORMAT
#define ADXL313_REG_DATA_FORMAT
Definition: adxl313.h:76
adxl313_disable_full_res
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1991
adxl313_comm_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: adxl313.h:387
adxl313_disable_i2c
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1437
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
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:1850
adxl313_dev::range
enum adxl313_range range
Definition: adxl313.h:502
adxl313_enable_full_res
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1965
adxl313_conf_act_thr
int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug)
Definition: adxl313.c:991
ADXL313_MEAS
@ ADXL313_MEAS
Definition: adxl313.h:271
adxl313_read
int adxl313_read(struct adxl313_dev *dev, uint8_t base_address, uint16_t size, uint8_t *read_data)
Definition: adxl313.c:72
ADXL313_REG_FIFO_CTL_MODE_MSK
#define ADXL313_REG_FIFO_CTL_MODE_MSK
Definition: adxl313.h:138
ADXL313_LP_MODE_NONE
@ ADXL313_LP_MODE_NONE
Definition: adxl313.h:279
ADXL314_SELF_TEST_MULT
#define ADXL314_SELF_TEST_MULT
Definition: adxl313.h:215
_adxl313_int_reg_flags::WATERMARK
uint8_t WATERMARK
Definition: adxl313.h:418
adxl313_comm_desc
Union holding the communication parameters.
Definition: adxl313.h:483
ADXL312_OFFSET_SCALE_FACTOR
#define ADXL312_OFFSET_SCALE_FACTOR
Definition: adxl313.h:178
adxl313_conf_inact_thr
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1073
adxl313_conf_int_map
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1787
adxl313_frac_repr::fractional
int32_t fractional
Definition: adxl313.h:396
_adxl313_int_reg_flags::reserved
uint8_t reserved
Definition: adxl313.h:419
adxl313_inactivity_int_disable
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1764
ADXL313_REG_THRESH_INACT
#define ADXL313_REG_THRESH_INACT
Definition: adxl313.h:68
DISABLE_E
@ DISABLE_E
Definition: adxl313.h:374
ADXL313_INT_ACTIVE_HIGH
@ ADXL313_INT_ACTIVE_HIGH
Definition: adxl313.h:365
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:1317
ADXL313_REG_SOFT_RESET
#define ADXL313_REG_SOFT_RESET
Definition: adxl313.h:65
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:1919
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:781
ADXL313_ODR_12_5HZ
@ ADXL313_ODR_12_5HZ
Definition: adxl313.h:328
ADXL313_INT_ACTIVE_LOW
@ ADXL313_INT_ACTIVE_LOW
Definition: adxl313.h:366
ADXL313_REG_FIFO_STS_ENTRIES_MSK
#define ADXL313_REG_FIFO_STS_ENTRIES_MSK
Definition: adxl313.h:144
ID_ADXL313
@ ID_ADXL313
Definition: adxl313.h:252
ADXL313_4G_RANGE
@ ADXL313_4G_RANGE
Definition: adxl313.h:303
adxl313_dev::comm_type
enum adxl313_comm_type comm_type
Definition: adxl313.h:498
ADXL313_ODR_800HZ
@ ADXL313_ODR_800HZ
Definition: adxl313.h:334
ADXL313_REG_FIFO_STATUS
#define ADXL313_REG_FIFO_STATUS
Definition: adxl313.h:79
adxl313_conf_time_inact
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1151
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:748
ADXL314_OFFSET_SCALE_FACTOR
#define ADXL314_OFFSET_SCALE_FACTOR
Definition: adxl313.h:186
adxl313_set_range
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2043
ADXL313_ODR_50HZ
@ ADXL313_ODR_50HZ
Definition: adxl313.h:330
adxl313_init_param::dev_type
enum adxl313_type dev_type
Definition: adxl313.h:409
adxl313_disable_i2c
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1437
adxl313_range
adxl313_range
Enum for selecting range.
Definition: adxl313.h:299
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:1253
adxl313_conf_int_enable
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1682
_adxl313_act_inact_ctl_flags::INACT_Z_EN
uint8_t INACT_Z_EN
Definition: adxl313.h:459
_adxl313_act_inact_ctl_flags::ACT_AC_EN
uint8_t ACT_AC_EN
Definition: adxl313.h:466
ADXL313_12G_RANGE
@ ADXL313_12G_RANGE
Definition: adxl313.h:307
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:1219
adxl313_get_time_inact
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1174
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:1253
adxl313_dev::comm_buff
uint8_t comm_buff[24]
Definition: adxl313.h:535
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
ADXL313_REG_FIFO_CTL
#define ADXL313_REG_FIFO_CTL
Definition: adxl313.h:78
no_os_clamp
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:75
adxl313_overrun_int_map
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1896
adxl313_inactivity_int_disable
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1764
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:901
ADXL313_X_EN
#define ADXL313_X_EN
Definition: adxl313.h:238
_adxl313_int_reg_flags::INACTIVITY
uint8_t INACTIVITY
Definition: adxl313.h:420
ADXL313_TRIGGERED_MODE
@ ADXL313_TRIGGERED_MODE
Definition: adxl313.h:357
adxl313_dev::dev_type
enum adxl313_type dev_type
Definition: adxl313.h:500
ADXL314_SELF_TEST_MIN_DEVIATION
#define ADXL314_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:229
ADXL313_REG_DATA_FORMAT_SELF_TEST
#define ADXL313_REG_DATA_FORMAT_SELF_TEST
Definition: adxl313.h:130
ADXL313_REG_DATA_FORMAT_INT_INV
#define ADXL313_REG_DATA_FORMAT_INT_INV
Definition: adxl313.h:132
ADXL313_FIFO_MODE
@ ADXL313_FIFO_MODE
Definition: adxl313.h:355
ADXL313_1_5G_RANGE
@ ADXL313_1_5G_RANGE
Definition: adxl313.h:304
_adxl313_act_inact_ctl_flags::ACT_X_EN
uint8_t ACT_X_EN
Definition: adxl313.h:465
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:1919
adxl313_dev::act_inact_ctl
union adxl313_act_inact_ctl_flags act_inact_ctl
Definition: adxl313.h:533
adxl313_enable_i2c
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1456
ADXL313_ODR_25HZ
@ ADXL313_ODR_25HZ
Definition: adxl313.h:329
adxl313_activity_int_map
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1827
ADXL313_REG_OFS_AXIS
#define ADXL313_REG_OFS_AXIS(index)
Definition: adxl313.h:66
ADXL313_X_AXIS
@ ADXL313_X_AXIS
Definition: adxl313.h:344
adxl313_overrun_int_map
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1896
adxl313_wake_up_f
adxl313_wake_up_f
Enum for frequency of wake-up events during sleep.
Definition: adxl313.h:288
ADXL314_SELF_TEST_MAX_DEVIATION
#define ADXL314_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:231
adxl313_dev::fifo_samples
uint8_t fifo_samples
Definition: adxl313.h:525
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:748
ADXL313_BYPAS_MODE
@ ADXL313_BYPAS_MODE
Definition: adxl313.h:354
ADXL312_SELF_TEST_MIN_DEVIATION
#define ADXL312_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:219
adxl313_set_odr
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1374
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:107
adxl313_act_inact_ctl_flags
Union holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:474
adxl313_init_param::comm_type
enum adxl313_comm_type comm_type
Definition: adxl313.h:407
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:196
adxl313_get_op_mode
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:463
_adxl313_act_inact_ctl_flags
Structure holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:458
ADXL313_WU_8_HZ
@ ADXL313_WU_8_HZ
Definition: adxl313.h:289
ADXL313_0_5G_RANGE
@ ADXL313_0_5G_RANGE
Definition: adxl313.h:300
adxl313_get_full_res_setting
int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res)
Definition: adxl313.c:2019
ADXL313_REG_DATA_FORMAT_FULL_RES
#define ADXL313_REG_DATA_FORMAT_FULL_RES
Definition: adxl313.h:133
ENABLE_E
@ ENABLE_E
Definition: adxl313.h:375
no_os_i2c.h
Header file of I2C Interface.
ADXL313_REG_INT_EN
#define ADXL313_REG_INT_EN
Definition: adxl313.h:73
ADXL313_Y_AXIS
@ ADXL313_Y_AXIS
Definition: adxl313.h:345
adxl313_remove
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:358
adxl313_dev::z_offset_raw
uint8_t z_offset_raw
Definition: adxl313.h:519
ADXL313_10_BIT_RES
@ ADXL313_10_BIT_RES
Definition: adxl313.h:316
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:1529
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:1219
adxl313_get_time_inact
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1174
adxl313_set_raw_offset
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:606
adxl313_init_param::comm_init
union adxl313_comm_init_param comm_init
Definition: adxl313.h:405
adxl313_inactivity_int_map
int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1850
ADXL313_WU_4_HZ
@ ADXL313_WU_4_HZ
Definition: adxl313.h:290
ADXL313_12_BIT_RES
@ ADXL313_12_BIT_RES
Definition: adxl313.h:318
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:75
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:1196
adxl313_dev::resolution
enum adxl313_resolution resolution
Definition: adxl313.h:504
ADXL313_REG_PARTID
#define ADXL313_REG_PARTID
Definition: adxl313.h:62
ADXL313_REG_DATA_FORMAT_RANGE
#define ADXL313_REG_DATA_FORMAT_RANGE
Definition: adxl313.h:135
ADXL313_DEVID
#define ADXL313_DEVID
Definition: adxl313.h:82
ADXL313_LOW_POWER_OP
#define ADXL313_LOW_POWER_OP
Definition: adxl313.h:98
adxl313_dev::op_mode
enum adxl313_op_mode op_mode
Definition: adxl313.h:506
adxl313_dev::inact_thr
uint8_t inact_thr
Definition: adxl313.h:529
adxl313_sleep
int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz)
Definition: adxl313.c:1624
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
adxl313_activity_int_disable
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1720
ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES
#define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:163
adxl313_set_fifo_mode
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:869
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:70
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:1196
_adxl313_int_reg_flags::reserved1
uint8_t reserved1
Definition: adxl313.h:422
ADXL313_REG_ACT_INACT_CTL
#define ADXL313_REG_ACT_INACT_CTL
Definition: adxl313.h:70
adxl313_comm_desc::spi_desc
struct no_os_spi_desc * spi_desc
Definition: adxl313.h:487
adxl313_dev::odr
enum adxl313_odr odr
Definition: adxl313.h:510
ADXL313_6G_RANGE
@ ADXL313_6G_RANGE
Definition: adxl313.h:306
ADXL313_MAX_FIFO_SAMPLES_VAL
#define ADXL313_MAX_FIFO_SAMPLES_VAL
Definition: adxl313.h:94
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
adxl313_int_src_reg_flags::fields
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:449
ADXL313_SELF_TEST_MIN_DEVIATION
#define ADXL313_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:224
adxl313_int_en_reg_flags::value
uint8_t value
Definition: adxl313.h:432
ADXL313_2G_RANGE
@ ADXL313_2G_RANGE
Definition: adxl313.h:302
ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES
#define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:151
_adxl313_act_inact_ctl_flags::INACT_X_EN
uint8_t INACT_X_EN
Definition: adxl313.h:461
ADXL313_LP_MODE_AUTOSLEEP
@ ADXL313_LP_MODE_AUTOSLEEP
Definition: adxl313.h:281
adxl313_set_fifo_samples
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:836
adxl313_set_op_mode
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:425
adxl313_software_reset
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:381
_adxl313_act_inact_ctl_flags::ACT_Y_EN
uint8_t ACT_Y_EN
Definition: adxl313.h:464
adxl313_set_int_pol
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1942
adxl313_link_mode_disable
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1604
adxl313_self_test
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2126
adxl313_inactivity_int_enable
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1742
adxl313_exit_sleep
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1654
adxl313_dev::fifo_mode
enum adxl313_fifo_mode fifo_mode
Definition: adxl313.h:523
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:122
ADXL313_ODR_3200HZ
@ ADXL313_ODR_3200HZ
Definition: adxl313.h:336
adxl313_activity_int_enable
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1698
adxl313_set_offset
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:490
ADXL313_REGS_PER_ENTRY
#define ADXL313_REGS_PER_ENTRY
Definition: adxl313.h:204
adxl313_set_op_mode
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:425
adxl313_disable_full_res
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1991
ADXL314_THRESH_SCALE_FACTOR
#define ADXL314_THRESH_SCALE_FACTOR
Definition: adxl313.h:198
ADXL313_PARTID
#define ADXL313_PARTID
Definition: adxl313.h:86
_adxl313_act_inact_ctl_flags::ACT_Z_EN
uint8_t ACT_Z_EN
Definition: adxl313.h:463
adxl313_exit_sleep
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1654
ADXL313_Y_EN
#define ADXL313_Y_EN
Definition: adxl313.h:239
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:58
ADXL313_SELF_TEST_SAMPLES
#define ADXL313_SELF_TEST_SAMPLES
Definition: adxl313.h:210
adxl313_act_inact_ctl_flags::fields
struct _adxl313_act_inact_ctl_flags fields
Definition: adxl313.h:475
ADXL313_3G_RANGE
@ ADXL313_3G_RANGE
Definition: adxl313.h:305
adxl313_get_act_thr
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1032
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:546
adxl313_get_inact_thr
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1114
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:107
ADXL313_POWER_CTL_AUTO_SLEEP
#define ADXL313_POWER_CTL_AUTO_SLEEP
Definition: adxl313.h:103
ADXL313_REG_DEVID1_AD
#define ADXL313_REG_DEVID1_AD
Definition: adxl313.h:61
ADXL313_REG_FIFO_CTL_SAMPLES_MSK
#define ADXL313_REG_FIFO_CTL_SAMPLES_MSK
Definition: adxl313.h:140
ADXL313_REG_INT_MAP
#define ADXL313_REG_INT_MAP
Definition: adxl313.h:74
adxl313_dev::y_offset_raw
uint8_t y_offset_raw
Definition: adxl313.h:516
adxl313_int_pol
adxl313_int_pol
Enum for selecting interrupt polarity.
Definition: adxl313.h:364
ADXL313_RESET_KEY
#define ADXL313_RESET_KEY
Definition: adxl313.h:91
ADXL313_ACC_SCALE_FACTOR_DIV
#define ADXL313_ACC_SCALE_FACTOR_DIV
Definition: adxl313.h:174
ADXL313_SPI_WRITE
#define ADXL313_SPI_WRITE
Definition: adxl313.h:56
adxl313_int_map_reg_flags
Union holding the flags for ADXL313 interrupt mapping.
Definition: adxl313.h:439
adxl313_act_inact_ctl_flags::value
uint8_t value
Definition: adxl313.h:476
adxl313_dev::lp_mode
enum adxl313_lp_mode lp_mode
Definition: adxl313.h:508
adxl313_conf_inact_thr
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1073
adxl313_fifo_mode
adxl313_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl313.h:353
adxl313_get_raw_offset
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:700
adxl313_comm_init_param::i2c_init
struct no_os_i2c_init_param i2c_init
Definition: adxl313.h:385
ADXL313_THRESH_SCALE_FACTOR
#define ADXL313_THRESH_SCALE_FACTOR
Definition: adxl313.h:194
adxl313_init
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:168
adxl313_get_offset
int adxl313_get_offset(struct adxl313_dev *dev, int32_t *offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:546
adxl313_link_mode_disable
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1604
ADXL313_WU_2_HZ
@ ADXL313_WU_2_HZ
Definition: adxl313.h:291
adxl313_resolution
adxl313_resolution
Enum for specifying resolution.
Definition: adxl313.h:315
adxl313_self_test
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2126
ADXL313_STDBY
@ ADXL313_STDBY
Definition: adxl313.h:270
adxl313_activity_int_enable
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1698
ADXL313_REG_TIME_INACT
#define ADXL313_REG_TIME_INACT
Definition: adxl313.h:69
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:2019
adxl313_comm_desc::i2c_desc
struct no_os_i2c_desc * i2c_desc
Definition: adxl313.h:485
adxl313_get_odr
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1413
adxl313_get_raw_offset
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:700
ADXL313_ODR_400HZ
@ ADXL313_ODR_400HZ
Definition: adxl313.h:333
_adxl313_int_reg_flags::ACTIVITY
uint8_t ACTIVITY
Definition: adxl313.h:421
adxl313_conf_time_inact
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1151
adxl313_init
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:168
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
ADXL313_REG_THRESH_ACT
#define ADXL313_REG_THRESH_ACT
Definition: adxl313.h:67
adxl313_axis
adxl313_axis
Enum for accelerometer axis.
Definition: adxl313.h:343
ID_ADXL314
@ ID_ADXL314
Definition: adxl313.h:253
adxl313_conf_int_enable
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1682