Go to the documentation of this file.
49 #define ADXL313_SPI_READ (0x80)
50 #define ADXL313_SPI_WRITE (0x00)
51 #define ADXL313_MULTIBIT NO_OS_BIT(6)
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
76 #define ADXL313_DEVID 0xAD
78 #define ADXL313_DEVID1 0x1D
80 #define ADXL313_PARTID 0xCB
82 #define ADXL314_DEVID 0xE5
85 #define ADXL313_RESET_KEY 0x52
88 #define ADXL313_MAX_FIFO_SAMPLES_VAL 0x60
91 #define ADXL313_RATE_MSK NO_OS_GENMASK(3, 0)
92 #define ADXL313_LOW_POWER_OP NO_OS_BIT(4)
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)
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)
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)
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)
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)
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)
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)
145 #define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)28439285ULL)
157 #define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES ((int64_t)957680664ULL)
160 #define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER ((int32_t)100)
167 #define ADXL314_ACC_SCALE_FACTOR_MUL ((int64_t)478858719ULL)
168 #define ADXL313_ACC_SCALE_FACTOR_DIV ((int32_t)1000000000)
172 #define ADXL312_OFFSET_SCALE_FACTOR 11600
176 #define ADXL313_OFFSET_SCALE_FACTOR 3900
180 #define ADXL314_OFFSET_SCALE_FACTOR 195000
184 #define ADXL312_THRESH_SCALE_FACTOR 46400
188 #define ADXL313_THRESH_SCALE_FACTOR 15625
192 #define ADXL314_THRESH_SCALE_FACTOR 784000
195 #define ADXL313_ODR_OFFSET_VAL 6
198 #define ADXL313_REGS_PER_ENTRY 6
201 #define ADXL313_MAX_FIFO_ENTRIES 32
204 #define ADXL313_SELF_TEST_SAMPLES 10
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
213 #define ADXL312_SELF_TEST_MIN_DEVIATION 300
215 #define ADXL312_SELF_TEST_MAX_DEVIATION 3400
218 #define ADXL313_SELF_TEST_MIN_DEVIATION 300
220 #define ADXL313_SELF_TEST_MAX_DEVIATION 3700
223 #define ADXL314_SELF_TEST_MIN_DEVIATION 100
225 #define ADXL314_SELF_TEST_MAX_DEVIATION 8000
228 #define ADXL313_RANGE_FACTOR 4
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)
587 uint8_t *entries_no);
599 int16_t *x_raw, int16_t *y_raw, int16_t *z_raw);
638 uint32_t act_thresh_ug,
645 uint32_t inact_thresh_ug,
667 uint8_t inact_thr, uint8_t time_inact_s);
uint8_t x_offset_raw
Definition: adxl313.h:507
uint8_t value
Definition: adxl313.h:435
Union holding the flags for ADXL313 interrupt source.
Definition: adxl313.h:442
Data format in which the acceleration values are converted.
Definition: adxl313.h:388
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1026
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1108
#define ADXL314_ACC_SCALE_FACTOR_MUL
Definition: adxl313.h:167
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1867
#define ADXL313_ACC_SCALE_FACTOR_MUL_DIVIDER
Definition: adxl313.h:160
@ ADXL313_WU_1_HZ
Definition: adxl313.h:286
#define ADXL312_SELF_TEST_MULT
Definition: adxl313.h:207
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz)
Definition: adxl313.c:1618
#define ADXL312_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:215
#define ADXL313_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:220
#define ADXL313_RANGE_FACTOR
Definition: adxl313.h:228
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1714
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:863
uint8_t DATA_READY
Definition: adxl313.h:417
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:425
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
#define ADXL313_REG_INT_SRC
Definition: adxl313.h:69
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
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
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:807
#define ADXL314_DEVID
Definition: adxl313.h:82
#define ADXL312_THRESH_SCALE_FACTOR
Definition: adxl313.h:184
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2089
@ ADXL313_SPI_COMM
Definition: adxl313.h:255
adxl313_odr
Enum for selecting output data rate.
Definition: adxl313.h:320
#define ADXL313_POWER_CTL_WAKEUP(x)
Definition: adxl313.h:100
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
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1579
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1821
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1407
adxl313_op_mode
Enum for operating mode.
Definition: adxl313.h:263
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1781
#define ADXL313_POWER_CTL_I2C_DISABLE
Definition: adxl313.h:95
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:434
#define ADXL313_REG_POWER_CTL
Definition: adxl313.h:66
Header file of SPI Interface.
Structure holding the parameters for ADXL313 communication initialization.
Definition: adxl313.h:377
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1368
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:942
#define ADXL313_ODR_OFFSET_VAL
Definition: adxl313.h:195
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
Structure holding the parameters for ADXL313 device initialization.
Definition: adxl313.h:397
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:457
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1471
int adxl313_link_mode_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1579
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
Enum for device type.
Definition: adxl313.h:244
#define ADXL313_OFFSET_SCALE_FACTOR
Definition: adxl313.h:176
#define ADXL313_POWER_CTL_SLEEP
Definition: adxl313.h:99
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:352
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2037
int adxl313_watermark_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1867
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
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:1523
int adxl313_reg_write_msk(struct adxl313_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Definition: adxl313.c:133
uint8_t act_thr
Definition: adxl313.h:521
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:600
#define ADXL313_DEVID1
Definition: adxl313.h:78
#define ADXL313_REG_BW_RATE
Definition: adxl313.h:65
Union holding the flags for ADXL313 interrupt enable.
Definition: adxl313.h:424
Header file of Delay functions.
int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1798
int adxl313_set_low_power_mode(struct adxl313_dev *dev, enum bit_action enable)
Definition: adxl313.c:1471
#define ADXL313_SELF_TEST_MULT
Definition: adxl313.h:208
#define ADXL313_MULTIBIT
Definition: adxl313.h:51
int adxl313_get_no_of_fifo_entries(struct adxl313_dev *dev, uint8_t *entries_no)
Definition: adxl313.c:807
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
int adxl313_get_range(struct adxl313_dev *dev, enum adxl313_range *range)
Definition: adxl313.c:2089
int64_t integer
Definition: adxl313.h:389
adxl313_comm_type
Enum for communication type.
Definition: adxl313.h:254
uint8_t INACT_Y_EN
Definition: adxl313.h:454
#define ADXL313_Z_EN
Definition: adxl313.h:234
Definition: ad9361_util.h:69
union adxl313_comm_desc com_desc
Definition: adxl313.h:490
int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug)
Definition: adxl313.c:985
#define ADXL313_REG_DATA_AXIS(index)
Definition: adxl313.h:71
@ ADXL313_LP_MODE_ON
Definition: adxl313.h:274
adxl313_lp_mode
Enum for low power operating mode.
Definition: adxl313.h:272
ADXL313 Device structure.
Definition: adxl313.h:488
@ ADXL313_ODR_1600HZ
Definition: adxl313.h:329
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:942
@ ADXL313_13_BIT_RES
Definition: adxl313.h:313
@ ADXL313_11_BIT_RES
Definition: adxl313.h:311
Structure holding the flags for ADXL313 interrupt sources.
Definition: adxl313.h:410
#define ADXL313_SPI_READ
Definition: adxl313.h:49
#define ADXL313_POWER_CTL_LINK
Definition: adxl313.h:96
#define ADXL313_RATE_MSK
Definition: adxl313.h:91
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
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1450
@ ID_ADXL312
Definition: adxl313.h:245
uint8_t OVERRUN
Definition: adxl313.h:411
@ ADXL313_ODR_6_25HZ
Definition: adxl313.h:321
#define ADXL313_REG_DEVID_AD
Definition: adxl313.h:54
@ ADXL313_I2C_COMM
Definition: adxl313.h:256
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:830
uint8_t time_inact
Definition: adxl313.h:525
@ ADXL313_1G_RANGE
Definition: adxl313.h:295
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:375
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1936
uint8_t value
Definition: adxl313.h:444
@ ADXL313_ODR_200HZ
Definition: adxl313.h:326
bit_action
Enum for selecting Set/Reset bit action.
Definition: adxl313.h:367
int64_t scale_factor_mult
Definition: adxl313.h:515
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1736
#define ADXL313_SELF_TEST_DIV
Definition: adxl313.h:210
@ ADXL313_STREAM_MODE
Definition: adxl313.h:350
int adxl313_data_ready_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1798
@ ADXL313_ODR_100HZ
Definition: adxl313.h:325
@ ADXL313_Z_AXIS
Definition: adxl313.h:340
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:1311
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:484
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1959
@ ADXL313_200G_RANGE
Definition: adxl313.h:302
#define ADXL313_MAX_FIFO_ENTRIES
Definition: adxl313.h:201
#define ADXL313_POWER_CTL_MEASURE
Definition: adxl313.h:98
uint8_t INACT_AC_EN
Definition: adxl313.h:456
#define ADXL313_REG_DATA_FORMAT
Definition: adxl313.h:70
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1985
struct no_os_spi_init_param spi_init
Definition: adxl313.h:381
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1431
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1844
enum adxl313_range range
Definition: adxl313.h:496
int adxl313_enable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1959
int adxl313_conf_act_thr(struct adxl313_dev *dev, uint32_t act_thr_ug)
Definition: adxl313.c:985
@ ADXL313_MEAS
Definition: adxl313.h:265
int adxl313_read(struct adxl313_dev *dev, uint8_t base_address, uint16_t size, uint8_t *read_data)
Definition: adxl313.c:66
#define ADXL313_REG_FIFO_CTL_MODE_MSK
Definition: adxl313.h:132
@ ADXL313_LP_MODE_NONE
Definition: adxl313.h:273
#define ADXL314_SELF_TEST_MULT
Definition: adxl313.h:209
uint8_t WATERMARK
Definition: adxl313.h:412
Union holding the communication parameters.
Definition: adxl313.h:477
#define ADXL312_OFFSET_SCALE_FACTOR
Definition: adxl313.h:172
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1067
int adxl313_conf_int_map(struct adxl313_dev *dev, union adxl313_int_map_reg_flags int_map)
Definition: adxl313.c:1781
int32_t fractional
Definition: adxl313.h:390
uint8_t reserved
Definition: adxl313.h:413
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1758
#define ADXL313_REG_THRESH_INACT
Definition: adxl313.h:62
@ DISABLE_E
Definition: adxl313.h:368
@ ADXL313_INT_ACTIVE_HIGH
Definition: adxl313.h:359
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:1311
#define ADXL313_REG_SOFT_RESET
Definition: adxl313.h:59
int adxl313_get_int_source_reg(struct adxl313_dev *dev, union adxl313_int_src_reg_flags *int_status_flags)
Definition: adxl313.c:1913
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
Definition: adxl313.h:322
@ ADXL313_INT_ACTIVE_LOW
Definition: adxl313.h:360
#define ADXL313_REG_FIFO_STS_ENTRIES_MSK
Definition: adxl313.h:138
@ ID_ADXL313
Definition: adxl313.h:246
@ ADXL313_4G_RANGE
Definition: adxl313.h:297
enum adxl313_comm_type comm_type
Definition: adxl313.h:492
@ ADXL313_ODR_800HZ
Definition: adxl313.h:328
#define ADXL313_REG_FIFO_STATUS
Definition: adxl313.h:73
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1145
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
#define ADXL314_OFFSET_SCALE_FACTOR
Definition: adxl313.h:180
int adxl313_set_range(struct adxl313_dev *dev, enum adxl313_range range)
Definition: adxl313.c:2037
@ ADXL313_ODR_50HZ
Definition: adxl313.h:324
enum adxl313_type dev_type
Definition: adxl313.h:403
int adxl313_disable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1431
adxl313_range
Enum for selecting range.
Definition: adxl313.h:293
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:1247
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1676
uint8_t INACT_Z_EN
Definition: adxl313.h:453
uint8_t ACT_AC_EN
Definition: adxl313.h:460
@ ADXL313_12G_RANGE
Definition: adxl313.h:301
int adxl313_get_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags *config)
Definition: adxl313.c:1213
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1168
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:1247
uint8_t comm_buff[24]
Definition: adxl313.h:529
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADXL313_REG_FIFO_CTL
Definition: adxl313.h:72
#define no_os_clamp(val, min_val, max_val)
Definition: no_os_util.h:69
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1890
int adxl313_inactivity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1758
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
#define ADXL313_X_EN
Definition: adxl313.h:232
uint8_t INACTIVITY
Definition: adxl313.h:414
@ ADXL313_TRIGGERED_MODE
Definition: adxl313.h:351
enum adxl313_type dev_type
Definition: adxl313.h:494
#define ADXL314_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:223
#define ADXL313_REG_DATA_FORMAT_SELF_TEST
Definition: adxl313.h:124
#define ADXL313_REG_DATA_FORMAT_INT_INV
Definition: adxl313.h:126
@ ADXL313_FIFO_MODE
Definition: adxl313.h:349
@ ADXL313_1_5G_RANGE
Definition: adxl313.h:298
uint8_t ACT_X_EN
Definition: adxl313.h:459
int adxl313_get_int_source_reg(struct adxl313_dev *dev, union adxl313_int_src_reg_flags *int_status_flags)
Definition: adxl313.c:1913
union adxl313_act_inact_ctl_flags act_inact_ctl
Definition: adxl313.h:527
int adxl313_enable_i2c(struct adxl313_dev *dev)
Definition: adxl313.c:1450
@ ADXL313_ODR_25HZ
Definition: adxl313.h:323
int adxl313_activity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1821
#define ADXL313_REG_OFS_AXIS(index)
Definition: adxl313.h:60
@ ADXL313_X_AXIS
Definition: adxl313.h:338
int adxl313_overrun_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1890
adxl313_wake_up_f
Enum for frequency of wake-up events during sleep.
Definition: adxl313.h:282
#define ADXL314_SELF_TEST_MAX_DEVIATION
Definition: adxl313.h:225
uint8_t fifo_samples
Definition: adxl313.h:519
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
Definition: adxl313.h:348
#define ADXL312_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:213
int adxl313_set_odr(struct adxl313_dev *dev, enum adxl313_odr odr)
Definition: adxl313.c:1368
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
Union holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:468
enum adxl313_comm_type comm_type
Definition: adxl313.h:401
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
int adxl313_get_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode *op_mode)
Definition: adxl313.c:457
Structure holding the flags corresponding to ACT AC/DC and INACT AC/DC Bits.
Definition: adxl313.h:452
@ ADXL313_WU_8_HZ
Definition: adxl313.h:283
@ ADXL313_0_5G_RANGE
Definition: adxl313.h:294
int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res)
Definition: adxl313.c:2013
#define ADXL313_REG_DATA_FORMAT_FULL_RES
Definition: adxl313.h:127
@ ENABLE_E
Definition: adxl313.h:369
Header file of I2C Interface.
#define ADXL313_REG_INT_EN
Definition: adxl313.h:67
@ ADXL313_Y_AXIS
Definition: adxl313.h:339
int adxl313_remove(struct adxl313_dev *dev)
Definition: adxl313.c:352
uint8_t z_offset_raw
Definition: adxl313.h:513
@ ADXL313_10_BIT_RES
Definition: adxl313.h:310
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:1523
int adxl313_get_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags *config)
Definition: adxl313.c:1213
int adxl313_get_time_inact(struct adxl313_dev *dev, uint8_t *time_inact_s)
Definition: adxl313.c:1168
int adxl313_set_raw_offset(struct adxl313_dev *dev, int32_t offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:600
union adxl313_comm_init_param comm_init
Definition: adxl313.h:399
int adxl313_inactivity_int_map(struct adxl313_dev *dev, uint8_t int_pin)
Definition: adxl313.c:1844
@ ADXL313_WU_4_HZ
Definition: adxl313.h:284
@ ADXL313_12_BIT_RES
Definition: adxl313.h:312
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
int adxl313_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags config)
Definition: adxl313.c:1190
enum adxl313_resolution resolution
Definition: adxl313.h:498
#define ADXL313_REG_PARTID
Definition: adxl313.h:56
#define ADXL313_REG_DATA_FORMAT_RANGE
Definition: adxl313.h:129
#define ADXL313_DEVID
Definition: adxl313.h:76
#define ADXL313_LOW_POWER_OP
Definition: adxl313.h:92
enum adxl313_op_mode op_mode
Definition: adxl313.h:500
uint8_t inact_thr
Definition: adxl313.h:523
int adxl313_sleep(struct adxl313_dev *dev, enum adxl313_wake_up_f wake_up_f_hz)
Definition: adxl313.c:1618
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
int adxl313_activity_int_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1714
#define ADXL313_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:157
int adxl313_set_fifo_mode(struct adxl313_dev *dev, enum adxl313_fifo_mode mode)
Definition: adxl313.c:863
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
int adxl313_conf_act_inact_ctl(struct adxl313_dev *dev, union adxl313_act_inact_ctl_flags config)
Definition: adxl313.c:1190
uint8_t reserved1
Definition: adxl313.h:416
#define ADXL313_REG_ACT_INACT_CTL
Definition: adxl313.h:64
struct no_os_spi_desc * spi_desc
Definition: adxl313.h:481
enum adxl313_odr odr
Definition: adxl313.h:504
@ ADXL313_6G_RANGE
Definition: adxl313.h:300
#define ADXL313_MAX_FIFO_SAMPLES_VAL
Definition: adxl313.h:88
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
struct _adxl313_int_reg_flags fields
Definition: adxl313.h:443
#define ADXL313_SELF_TEST_MIN_DEVIATION
Definition: adxl313.h:218
uint8_t value
Definition: adxl313.h:426
@ ADXL313_2G_RANGE
Definition: adxl313.h:296
#define ADXL312_ACC_SCALE_FACTOR_MUL_FULL_RES
Definition: adxl313.h:145
uint8_t INACT_X_EN
Definition: adxl313.h:455
@ ADXL313_LP_MODE_AUTOSLEEP
Definition: adxl313.h:275
int adxl313_set_fifo_samples(struct adxl313_dev *dev, uint8_t samples_no)
Definition: adxl313.c:830
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:419
int adxl313_software_reset(struct adxl313_dev *dev)
Definition: adxl313.c:375
uint8_t ACT_Y_EN
Definition: adxl313.h:458
int adxl313_set_int_pol(struct adxl313_dev *dev, enum adxl313_int_pol int_pol)
Definition: adxl313.c:1936
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1598
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2120
int adxl313_inactivity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1736
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1648
enum adxl313_fifo_mode fifo_mode
Definition: adxl313.h:517
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
Definition: adxl313.h:330
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1692
int adxl313_set_offset(struct adxl313_dev *dev, int32_t offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:484
#define ADXL313_REGS_PER_ENTRY
Definition: adxl313.h:198
int adxl313_set_op_mode(struct adxl313_dev *dev, enum adxl313_op_mode op_mode)
Definition: adxl313.c:419
int adxl313_disable_full_res(struct adxl313_dev *dev)
Definition: adxl313.c:1985
#define ADXL314_THRESH_SCALE_FACTOR
Definition: adxl313.h:192
#define ADXL313_PARTID
Definition: adxl313.h:80
uint8_t ACT_Z_EN
Definition: adxl313.h:457
int adxl313_exit_sleep(struct adxl313_dev *dev)
Definition: adxl313.c:1648
#define ADXL313_Y_EN
Definition: adxl313.h:233
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
#define ADXL313_SELF_TEST_SAMPLES
Definition: adxl313.h:204
struct _adxl313_act_inact_ctl_flags fields
Definition: adxl313.h:469
@ ADXL313_3G_RANGE
Definition: adxl313.h:299
int adxl313_get_act_thr(struct adxl313_dev *dev, uint32_t *act_thr_ug)
Definition: adxl313.c:1026
Header file of utility functions.
int adxl313_get_offset(struct adxl313_dev *dev, int32_t *offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:540
int adxl313_get_inact_thr(struct adxl313_dev *dev, uint32_t *inact_thr_ug)
Definition: adxl313.c:1108
Header file of ADXL313 Driver.
int adxl313_write(struct adxl313_dev *dev, uint8_t base_address, uint16_t size, uint8_t *write_data)
Definition: adxl313.c:101
#define ADXL313_POWER_CTL_AUTO_SLEEP
Definition: adxl313.h:97
#define ADXL313_REG_DEVID1_AD
Definition: adxl313.h:55
#define ADXL313_REG_FIFO_CTL_SAMPLES_MSK
Definition: adxl313.h:134
#define ADXL313_REG_INT_MAP
Definition: adxl313.h:68
uint8_t y_offset_raw
Definition: adxl313.h:510
adxl313_int_pol
Enum for selecting interrupt polarity.
Definition: adxl313.h:358
#define ADXL313_RESET_KEY
Definition: adxl313.h:85
#define ADXL313_ACC_SCALE_FACTOR_DIV
Definition: adxl313.h:168
#define ADXL313_SPI_WRITE
Definition: adxl313.h:50
Union holding the flags for ADXL313 interrupt mapping.
Definition: adxl313.h:433
uint8_t value
Definition: adxl313.h:470
enum adxl313_lp_mode lp_mode
Definition: adxl313.h:502
int adxl313_conf_inact_thr(struct adxl313_dev *dev, uint32_t inact_thr_ug)
Definition: adxl313.c:1067
adxl313_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl313.h:347
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:694
struct no_os_i2c_init_param i2c_init
Definition: adxl313.h:379
#define ADXL313_THRESH_SCALE_FACTOR
Definition: adxl313.h:188
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:162
int adxl313_get_offset(struct adxl313_dev *dev, int32_t *offset_ug, enum adxl313_axis axis)
Definition: adxl313.c:540
int adxl313_link_mode_disable(struct adxl313_dev *dev)
Definition: adxl313.c:1598
@ ADXL313_WU_2_HZ
Definition: adxl313.h:285
adxl313_resolution
Enum for specifying resolution.
Definition: adxl313.h:309
int adxl313_self_test(struct adxl313_dev *dev)
Definition: adxl313.c:2120
@ ADXL313_STDBY
Definition: adxl313.h:264
int adxl313_activity_int_enable(struct adxl313_dev *dev)
Definition: adxl313.c:1692
#define ADXL313_REG_TIME_INACT
Definition: adxl313.h:63
Error macro definition for ARM Compiler.
int adxl313_get_full_res_setting(struct adxl313_dev *dev, uint8_t *full_res)
Definition: adxl313.c:2013
struct no_os_i2c_desc * i2c_desc
Definition: adxl313.h:479
int adxl313_get_odr(struct adxl313_dev *dev, enum adxl313_odr *odr)
Definition: adxl313.c:1407
int adxl313_get_raw_offset(struct adxl313_dev *dev, int32_t *offset_raw, enum adxl313_axis axis)
Definition: adxl313.c:694
@ ADXL313_ODR_400HZ
Definition: adxl313.h:327
uint8_t ACTIVITY
Definition: adxl313.h:415
int adxl313_conf_time_inact(struct adxl313_dev *dev, uint8_t time_inact_s)
Definition: adxl313.c:1145
int adxl313_init(struct adxl313_dev **device, struct adxl313_init_param init_param)
Definition: adxl313.c:162
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define ADXL313_REG_THRESH_ACT
Definition: adxl313.h:61
adxl313_axis
Enum for accelerometer axis.
Definition: adxl313.h:337
@ ID_ADXL314
Definition: adxl313.h:247
int adxl313_conf_int_enable(struct adxl313_dev *dev, union adxl313_int_en_reg_flags en_ctl)
Definition: adxl313.c:1676