Go to the documentation of this file.
56 #define ADXL367_WRITE_REG 0x0A
57 #define ADXL367_READ_REG 0x0B
58 #define ADXL367_READ_FIFO 0x0D
59 #define ADXL367_I2C_READ 0x01
60 #define ADXL367_I2C_WRITE 0x00
63 #define ADXL367_REG_DEVID_AD 0x00
64 #define ADXL367_REG_DEVID_MST 0x01
65 #define ADXL367_REG_PARTID 0x02
66 #define ADXL367_REG_REVID 0x03
67 #define ADXL367_REG_SERIAL_NUMBER_3 0x04
68 #define ADXL367_REG_SERIAL_NUMBER_2 0x05
69 #define ADXL367_REG_SERIAL_NUMBER_1 0x06
70 #define ADXL367_REG_SERIAL_NUMBER_0 0x07
71 #define ADXL367_REG_XDATA 0x08
72 #define ADXL367_REG_YDATA 0x09
73 #define ADXL367_REG_ZDATA 0x0A
74 #define ADXL367_REG_STATUS 0x0B
75 #define ADXL367_REG_FIFO_ENTRIES_L 0x0C
76 #define ADXL367_REG_FIFO_ENTRIES_H 0x0D
77 #define ADXL367_REG_XDATA_H 0x0E
78 #define ADXL367_REG_XDATA_L 0x0F
79 #define ADXL367_REG_YDATA_H 0x10
80 #define ADXL367_REG_YDATA_L 0x11
81 #define ADXL367_REG_ZDATA_H 0x12
82 #define ADXL367_REG_ZDATA_L 0x13
83 #define ADXL367_REG_TEMP_H 0x14
84 #define ADXL367_REG_TEMP_L 0x15
85 #define ADXL367_REG_EX_ADC_H 0x16
86 #define ADXL367_REG_EX_ADC_L 0x17
87 #define ADXL367_REG_I2C_FIFO_DATA 0x18
88 #define ADXL367_REG_SOFT_RESET 0x1F
89 #define ADXL367_REG_THRESH_ACT_H 0x20
90 #define ADXL367_REG_THRESH_ACT_L 0x21
91 #define ADXL367_REG_TIME_ACT 0x22
92 #define ADXL367_REG_THRESH_INACT_H 0x23
93 #define ADXL367_REG_THRESH_INACT_L 0x24
94 #define ADXL367_REG_TIME_INACT_H 0x25
95 #define ADXL367_REG_TIME_INACT_L 0x26
96 #define ADXL367_REG_ACT_INACT_CTL 0x27
97 #define ADXL367_REG_FIFO_CONTROL 0x28
98 #define ADXL367_REG_FIFO_SAMPLES 0x29
99 #define ADXL367_REG_INTMAP1_LWR 0x2A
100 #define ADXL367_REG_INTMAP2_LWR 0x2B
101 #define ADXL367_REG_FILTER_CTL 0x2C
102 #define ADXL367_REG_POWER_CTL 0x2D
103 #define ADXL367_REG_SELF_TEST 0x2E
104 #define ADXL367_REG_TAP_THRESH 0x2F
105 #define ADXL367_REG_TAP_DUR 0x30
106 #define ADXL367_REG_TAP_LATENT 0x31
107 #define ADXL367_REG_TAP_WINDOW 0x32
108 #define ADXL367_REG_X_OFFSET 0x33
109 #define ADXL367_REG_Y_OFFSET 0x34
110 #define ADXL367_REG_Z_OFFSET 0x35
111 #define ADXL367_REG_X_SENS 0x36
112 #define ADXL367_REG_Y_SENS 0x37
113 #define ADXL367_REG_Z_SENS 0x38
114 #define ADXL367_REG_TIMER_CTL 0x39
115 #define ADXL367_REG_INTMAP1_UPPER 0x3A
116 #define ADXL367_REG_INTMAP2_UPPER 0x3B
117 #define ADXL367_REG_ADC_CTL 0x3C
118 #define ADXL367_REG_TEMP_CTL 0x3D
119 #define ADXL367_REG_TEMP_ADC_OV_TH_H 0x3E
120 #define ADXL367_REG_TEMP_ADC_OV_TH_L 0x3F
121 #define ADXL367_REG_TEMP_ADC_UN_TH_H 0x40
122 #define ADXL367_REG_TEMP_ADC_UN_TH_L 0x41
123 #define ADXL367_REG_TEMP_ADC_TIMER 0x42
124 #define ADXL367_REG_AXIS_MASK 0x43
125 #define ADXL367_REG_STATUS_COPY 0x44
126 #define ADXL367_REG_STATUS_2 0x45
129 #define ADXL367_STATUS_ERR_USER_REGS NO_OS_BIT(7)
130 #define ADXL367_STATUS_AWAKE NO_OS_BIT(6)
131 #define ADXL367_STATUS_INACT NO_OS_BIT(5)
132 #define ADXL367_STATUS_ACT NO_OS_BIT(4)
133 #define ADXL367_STATUS_FIFO_OVERRUN NO_OS_BIT(3)
134 #define ADXL367_STATUS_FIFO_WATERMARK NO_OS_BIT(2)
135 #define ADXL367_STATUS_FIFO_RDY NO_OS_BIT(1)
136 #define ADXL367_STATUS_DATA_RDY NO_OS_BIT(0)
139 #define ADXL367_THRESH_H 0x7F
142 #define ADXL367_THRESH_L 0xFC
145 #define ADXL367_ACT_INACT_CTL_LINKLOOP_MSK NO_OS_GENMASK(5, 4)
146 #define ADXL367_ACT_INACT_CTL_INACT_EN_MSK NO_OS_GENMASK(3, 2)
147 #define ADXL367_ACT_INACT_CTL_ACT_EN_MSK NO_OS_GENMASK(1, 0)
150 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED 0x0
151 #define ADXL367_INACTIVITY_ENABLE 0x1
152 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED_2 0x2
153 #define ADXL367_REFERENCED_INACTIVITY_ENABLE 0x3
156 #define ADXL367_NO_ACTIVITY_DETECTION 0x0
157 #define ADXL367_ACTIVITY_ENABLE 0x1
158 #define ADXL367_NO_ACTIVITY_DETECTION_2 0x2
159 #define ADXL367_REFERENCED_ACTIVITY_ENABLE 0x3
162 #define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK NO_OS_GENMASK(6, 3)
163 #define ADXL367_FIFO_CONTROL_FIFO_SAMPLES NO_OS_BIT(2)
164 #define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK NO_OS_GENMASK(1, 0)
167 #define ADXL367_ALL_AXIS 0x0
168 #define ADXL367_X_AXIS 0x1
169 #define ADXL367_Y_AXIS 0x2
170 #define ADXL367_X_AXIS_2 0x3
171 #define ADXL367_ALL_AXIS_TEMP 0x4
172 #define ADXL367_X_AXIS_TEMP 0x5
173 #define ADXL367_Y_AXIS_TEMP 0x6
174 #define ADXL367_Z_AXIS_TEMP 0x7
175 #define ADXL367_ALL_AXIS_EXT_ADC 0x8
176 #define ADXL367_X_AXIS_EXT_ADC 0x9
177 #define ADXL367_Y_AXIS_EXT_ADC 0xA
178 #define ADXL367_Z_AXIS_EXT_ADC 0xB
181 #define ADXL367_FIFO_DISABLE 0
182 #define ADXL367_FIFO_OLDEST_SAVED 1
183 #define ADXL367_FIFO_STREAM 2
184 #define ADXL367_FIFO_TRIGGERED 3
187 #define ADXL367_INTMAP1_INT_LOW_INT1 NO_OS_BIT(7)
188 #define ADXL367_INTMAP1_AWAKE_INT1 NO_OS_BIT(6)
189 #define ADXL367_INTMAP1_INACT_INT1 NO_OS_BIT(5)
190 #define ADXL367_INTMAP1_ACT_INT1 NO_OS_BIT(4)
191 #define ADXL367_INTMAP1_FIFO_OVERRUN_INT1 NO_OS_BIT(3)
192 #define ADXL367_INTMAP1_FIFO_WATERMARK_INT1 NO_OS_BIT(2)
193 #define ADXL367_INTMAP1_FIFO_RDY_INT1 NO_OS_BIT(1)
194 #define ADXL367_INTMAP1_DATA_RDY_INT1 NO_OS_BIT(0)
197 #define ADXL367_INTMAP2_INT_LOW_INT2 NO_OS_BIT(7)
198 #define ADXL367_INTMAP2_AWAKE_INT2 NO_OS_BIT(6)
199 #define ADXL367_INTMAP2_INACT_INT2 NO_OS_BIT(5)
200 #define ADXL367_INTMAP2_ACT_INT2 NO_OS_BIT(4)
201 #define ADXL367_INTMAP2_FIFO_OVERRUN_INT2 NO_OS_BIT(3)
202 #define ADXL367_INTMAP2_FIFO_WATERMARK_INT2 NO_OS_BIT(2)
203 #define ADXL367_INTMAP2_FIFO_RDY_INT2 NO_OS_BIT(1)
204 #define ADXL367_INTMAP2_DATA_RDY_INT2 NO_OS_BIT(0)
207 #define ADXL367_FILTER_CTL_RANGE_MSK NO_OS_GENMASK(7, 6)
208 #define ADXL367_FILTER_I2C_HS NO_OS_BIT(5)
209 #define ADXL367_FILTER_CTL_RES NO_OS_BIT(4)
210 #define ADXL367_FILTER_CTL_EXT_SAMPLE NO_OS_BIT(3)
211 #define ADXL367_FILTER_CTL_ODR_MSK NO_OS_GENMASK(2, 0)
214 #define ADXL367_RANGE_2G 0
215 #define ADXL367_RANGE_4G 1
216 #define ADXL367_RANGE_8G 2
219 #define ADXL367_POWER_CTL_RES NO_OS_BIT(7)
220 #define ADXL367_POWER_CTL_EXT_CLK NO_OS_BIT(6)
221 #define ADXL367_POWER_CTL_LOW_NOISE_MSK NO_OS_GENMASK(5, 4)
222 #define ADXL367_POWER_CTL_WAKEUP NO_OS_BIT(3)
223 #define ADXL367_POWER_CTL_AUTOSLEEP NO_OS_BIT(2)
224 #define ADXL367_POWER_CTL_MEASURE_MSK NO_OS_GENMASK(1, 0)
227 #define ADXL367_NOISE_MODE_NORMAL 0
228 #define ADXL367_NOISE_MODE_LOW 1
229 #define ADXL367_NOISE_MODE_ULTRALOW 2
232 #define ADXL367_SELF_TEST_ST_FORCE NO_OS_BIT(1)
233 #define ADXL367_SELF_TEST_ST NO_OS_BIT(0)
236 #define ADXL367_XYZ_AXIS_OFFSET_MASK 0x1F
239 #define ADXL367_INTMAPX_UPPER_MASK 0xDF
242 #define ADXL367_FIFO_8_12BIT_MSK NO_OS_GENMASK(7,6)
243 #define ADXL367_ADC_INACT_EN NO_OS_BIT(3)
244 #define ADXL367_ADC_ACT_EN NO_OS_BIT(1)
245 #define ADXL367_ADC_EN NO_OS_BIT(0)
248 #define ADXL367_TEMP_INACT_EN NO_OS_BIT(3)
249 #define ADXL367_TEMP_ACT_EN NO_OS_BIT(1)
250 #define ADXL367_TEMP_EN NO_OS_BIT(0)
253 #define ADXL367_DEVICE_AD 0xAD
254 #define ADXL367_DEVICE_MST 0x1D
255 #define ADXL367_PART_ID 0xF7
258 #define ADXL367_RESET_KEY 0x52
261 #define ADXL367_FIFO_X_ID 0x00
262 #define ADXL367_FIFO_Y_ID 0x01
263 #define ADXL367_FIFO_Z_ID 0x02
264 #define ADXL367_FIFO_TEMP_ADC_ID 0x03
266 #define ADXL367_ABSOLUTE 0x00
267 #define ADXL367_REFERENCED 0x01
275 #define ADXL367_ACC_SCALE_FACTOR_MUL 245166ULL
276 #define ADXL367_ACC_SCALE_FACTOR_DIV 1000000000
283 #define ADXL367_TEMP_OFFSET 1185
284 #define ADXL367_TEMP_25C 165
285 #define ADXL367_TEMP_SCALE 18518518
286 #define ADXL367_TEMP_SCALE_DIV 1000000000
289 #define ADXL367_SELF_TEST_MIN 90 * 100 / 25
291 #define ADXL367_SELF_TEST_MAX 270 * 100 / 25
484 uint8_t register_value,
485 uint8_t register_address);
490 uint8_t register_address,
491 uint8_t bytes_number);
516 uint16_t y_offset, uint16_t z_offset);
574 int16_t *z, int16_t *temp_adc, uint16_t *entries);
int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp)
Reads the raw temperature of the device. If ADXL367_TEMP_EN is not set, use adxl367_temp_read_en() fi...
Definition: adxl367.c:715
#define ADXL367_I2C_READ
Definition: adxl367.h:59
@ ADXL367_12B_CHID
Definition: adxl367.h:386
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1204
#define ADXL367_REG_THRESH_INACT_L
Definition: adxl367.h:93
#define ADXL367_REG_TEMP_H
Definition: adxl367.h:83
#define ADXL367_REG_XDATA_L
Definition: adxl367.h:78
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:529
@ ADXL367_ODR_100HZ
Definition: adxl367.h:333
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1149
#define ADXL367_REG_TIME_INACT_H
Definition: adxl367.h:94
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:671
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
uint8_t i2c_slave_address
Definition: adxl367.h:465
struct no_os_i2c_desc * i2c_desc
Definition: adxl367.h:436
#define ADXL367_REG_STATUS_2
Definition: adxl367.h:126
#define ADXL367_SELF_TEST_MAX
Definition: adxl367.h:291
enum adxl367_range range
Definition: adxl367.h:440
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1204
@ ADXL367_OP_STANDBY
Definition: adxl367.h:311
uint8_t fifo_watermark
Definition: adxl367.h:412
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
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
int64_t integer
Definition: adxl367.h:422
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:529
uint8_t err_user_regs
Definition: adxl367.h:401
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t bytes_number)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:290
@ ADXL367_14B_CHID
Definition: adxl367.h:392
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:836
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:88
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
adxl367_odr
Enum for selecting output data rate.
Definition: adxl367.h:329
#define ADXL367_FIFO_TEMP_ADC_ID
Definition: adxl367.h:264
#define ADXL367_THRESH_L
Definition: adxl367.h:142
@ ADXL367_FIFO_FORMAT_Y
Definition: adxl367.h:359
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:860
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t register_nb)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:290
#define ADXL367_FILTER_CTL_ODR_MSK
Definition: adxl367.h:211
Header file of SPI Interface.
uint8_t awake
Definition: adxl367.h:408
#define ADXL367_ACC_SCALE_FACTOR_MUL
Definition: adxl367.h:275
@ ADXL367_STREAM_MODE
Definition: adxl367.h:345
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:836
@ ADXL367_FIFO_FORMAT_XYZT
Definition: adxl367.h:363
#define ADXL367_RESET_KEY
Definition: adxl367.h:258
uint8_t fifo_ready
Definition: adxl367.h:413
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
enum adxl367_comm_type comm_type
Definition: adxl367.h:432
#define ADXL367_REG_THRESH_ACT_H
Definition: adxl367.h:89
int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable)
Enables ADC reading. Disables temperature reading.
Definition: adxl367.c:688
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:860
#define ADXL367_REG_POWER_CTL
Definition: adxl367.h:102
@ ADXL367_ODR_12P5HZ
Definition: adxl367.h:330
#define ADXL367_DEVICE_MST
Definition: adxl367.h:254
@ ADXL367_I2C_COMM
Definition: adxl367.h:303
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:94
#define ADXL367_REFERENCED_ACTIVITY_ENABLE
Definition: adxl367.h:159
uint8_t fifo_overrun
Definition: adxl367.h:411
#define ADXL367_REG_EX_ADC_H
Definition: adxl367.h:85
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:671
@ ADXL367_ODR_400HZ
Definition: adxl367.h:335
Header file of Delay functions.
uint8_t err_fuse
Definition: adxl367.h:400
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:798
#define ADXL367_ACTIVITY_ENABLE
Definition: adxl367.h:157
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:121
@ ADXL367_FIFO_FORMAT_XYZA
Definition: adxl367.h:371
uint8_t i2c_slave_address
Definition: adxl367.h:438
uint8_t fifo_buffer[1027]
Definition: adxl367.h:447
#define ADXL367_THRESH_H
Definition: adxl367.h:139
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:261
#define ADXL367_ACC_SCALE_FACTOR_DIV
Definition: adxl367.h:276
int adxl367_set_range(struct adxl367_dev *dev, enum adxl367_range range)
Selects the measurement range.
Definition: adxl367.c:471
adxl367_op_mode
Enum for operating mode.
Definition: adxl367.h:310
#define ADXL367_REG_ACT_INACT_CTL
Definition: adxl367.h:96
Definition: ad9361_util.h:75
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:502
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:798
enum adxl367_op_mode op_mode
Definition: adxl367.h:441
#define ADXL367_REG_SELF_TEST
Definition: adxl367.h:103
@ ADXL367_FIFO_FORMAT_YT
Definition: adxl367.h:367
ADXL367 Device structure.
Definition: adxl367.h:430
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1255
adxl367_comm_type
Enum for communication type.
Definition: adxl367.h:301
@ ADXL367_2G_RANGE
Definition: adxl367.h:320
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
#define ADXL367_REG_STATUS
Definition: adxl367.h:74
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1312
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:502
int32_t fractional
Definition: adxl367.h:423
#define ADXL367_TEMP_SCALE_DIV
Definition: adxl367.h:286
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:397
@ ADXL367_FIFO_FORMAT_XYZ
Definition: adxl367.h:355
Structure holding the parameters for ADXL367 device initialization.
Definition: adxl367.h:457
int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp)
Reads the raw temperature of the device. If ADXL367_TEMP_EN is not set, use adxl367_temp_read_en() fi...
Definition: adxl367.c:715
enum adxl367_odr odr
Definition: adxl367.h:442
#define ADXL367_PART_ID
Definition: adxl367.h:255
@ ADXL367_FIFO_DISABLED
Definition: adxl367.h:343
@ ADXL367_8B
Definition: adxl367.h:388
uint8_t tap_two
Definition: adxl367.h:405
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1061
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
#define ADXL367_FIFO_X_ID
Definition: adxl367.h:261
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
int adxl367_set_range(struct adxl367_dev *dev, enum adxl367_range range)
Selects the measurement range.
Definition: adxl367.c:471
uint8_t inact
Definition: adxl367.h:409
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:374
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:144
@ ADXL367_FIFO_FORMAT_ZA
Definition: adxl367.h:377
#define ADXL367_XYZ_AXIS_OFFSET_MASK
Definition: adxl367.h:236
adxl367_fifo_read_mode
Enum for selecting FIFO reading mode.
Definition: adxl367.h:384
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:71
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1255
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:776
uint8_t temp_adc_low
Definition: adxl367.h:404
#define ADXL367_FIFO_Y_ID
Definition: adxl367.h:262
#define ADXL367_TEMP_SCALE
Definition: adxl367.h:285
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:374
#define ADXL367_REG_INTMAP2_UPPER
Definition: adxl367.h:116
#define ADXL367_TEMP_OFFSET
Definition: adxl367.h:283
#define ADXL367_REG_INTMAP1_UPPER
Definition: adxl367.h:115
#define ADXL367_REG_I2C_FIFO_DATA
Definition: adxl367.h:87
enum adxl367_fifo_read_mode fifo_read_mode
Definition: adxl367.h:445
uint16_t y_offset
Definition: adxl367.h:449
#define ADXL367_READ_REG
Definition: adxl367.h:57
enum adxl367_fifo_format fifo_format
Definition: adxl367.h:444
#define ADXL367_REG_ADC_CTL
Definition: adxl367.h:117
#define ADXL367_REG_INTMAP1_LWR
Definition: adxl367.h:99
@ ADXL367_OP_MEASURE
Definition: adxl367.h:312
#define ADXL367_REG_FIFO_ENTRIES_L
Definition: adxl367.h:75
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:165
#define ADXL367_FIFO_Z_ID
Definition: adxl367.h:263
#define ADXL367_FILTER_CTL_RANGE_MSK
Definition: adxl367.h:207
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:568
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
#define ADXL367_REG_SOFT_RESET
Definition: adxl367.h:88
adxl367_range
Enum for selecting range.
Definition: adxl367.h:319
#define ADXL367_INTMAPX_UPPER_MASK
Definition: adxl367.h:239
@ ADXL367_FIFO_FORMAT_XA
Definition: adxl367.h:373
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:568
@ ADXL367_FIFO_FORMAT_X
Definition: adxl367.h:357
#define ADXL367_REG_FILTER_CTL
Definition: adxl367.h:101
uint8_t data_ready
Definition: adxl367.h:414
uint16_t z_offset
Definition: adxl367.h:450
uint8_t act
Definition: adxl367.h:410
@ ADXL367_TRIGGERED_MODE
Definition: adxl367.h:346
Data format in which the values are converted.
Definition: adxl367.h:421
struct no_os_spi_desc * spi_desc
Definition: adxl367.h:434
#define ADXL367_REG_THRESH_ACT_L
Definition: adxl367.h:90
@ ADXL367_ODR_50HZ
Definition: adxl367.h:332
uint8_t kpalv_timer
Definition: adxl367.h:402
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:107
@ ADXL367_FIFO_FORMAT_ZT
Definition: adxl367.h:369
#define ADXL367_TEMP_EN
Definition: adxl367.h:250
#define ADXL367_ADC_EN
Definition: adxl367.h:245
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:165
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
#define ADXL367_DEVICE_AD
Definition: adxl367.h:253
Header file of I2C Interface.
int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable)
Enables ADC reading. Disables temperature reading.
Definition: adxl367.c:688
uint8_t int_low
Definition: adxl367.h:407
int adxl367_set_fifo_format(struct adxl367_dev *dev, enum adxl367_fifo_format format)
Sets FIFO format.
Definition: adxl367.c:955
#define ADXL367_INACTIVITY_ENABLE
Definition: adxl367.h:151
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1061
@ ADXL367_FIFO_FORMAT_YA
Definition: adxl367.h:375
#define ADXL367_REG_XDATA_H
Definition: adxl367.h:77
#define ADXL367_POWER_CTL_MEASURE_MSK
Definition: adxl367.h:224
@ ADXL367_FIFO_FORMAT_Z
Definition: adxl367.h:361
@ ADXL367_4G_RANGE
Definition: adxl367.h:321
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
Contains bit options from INT registers.
Definition: adxl367.h:399
#define ADXL367_FIFO_CONTROL_FIFO_SAMPLES
Definition: adxl367.h:163
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
Header file of ADXL367 Driver.
int adxl367_set_fifo_format(struct adxl367_dev *dev, enum adxl367_fifo_format format)
Sets FIFO format.
Definition: adxl367.c:955
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1149
#define ADXL367_REFERENCED_INACTIVITY_ENABLE
Definition: adxl367.h:153
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:776
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:261
#define ADXL367_FIFO_8_12BIT_MSK
Definition: adxl367.h:242
#define ADXL367_SELF_TEST_MIN
Definition: adxl367.h:289
@ ADXL367_ODR_25HZ
Definition: adxl367.h:331
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:918
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:70
#define ADXL367_REG_DEVID_AD
Definition: adxl367.h:63
#define NULL
Definition: wrapper.h:64
#define ADXL367_STATUS_DATA_RDY
Definition: adxl367.h:136
enum adxl367_comm_type comm_type
Definition: adxl367.h:459
#define ADXL367_REG_Y_OFFSET
Definition: adxl367.h:109
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1024
#define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK
Definition: adxl367.h:164
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:889
#define ADXL367_SELF_TEST_ST
Definition: adxl367.h:233
adxl367_fifo_format
Enum for selecting FIFO storage mode.
Definition: adxl367.h:353
struct no_os_spi_init_param spi_init
Definition: adxl367.h:461
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:918
@ ADXL367_ODR_200HZ
Definition: adxl367.h:334
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1024
#define ADXL367_REG_TEMP_CTL
Definition: adxl367.h:118
#define ADXL367_ACT_INACT_CTL_INACT_EN_MSK
Definition: adxl367.h:146
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:397
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:889
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
uint16_t x_offset
Definition: adxl367.h:448
#define ADXL367_REG_FIFO_CONTROL
Definition: adxl367.h:97
#define ADXL367_REG_Z_OFFSET
Definition: adxl367.h:110
#define ADXL367_REG_TIME_INACT_L
Definition: adxl367.h:95
#define ADXL367_READ_FIFO
Definition: adxl367.h:58
#define ADXL367_REG_FIFO_SAMPLES
Definition: adxl367.h:98
#define ADXL367_REG_TIME_ACT
Definition: adxl367.h:91
@ ADXL367_OLDEST_SAVED
Definition: adxl367.h:344
#define ADXL367_REG_PARTID
Definition: adxl367.h:65
#define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK
Definition: adxl367.h:162
struct no_os_i2c_init_param i2c_init
Definition: adxl367.h:463
enum adxl367_fifo_mode fifo_mode
Definition: adxl367.h:443
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
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:144
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:641
@ ADXL367_12B
Definition: adxl367.h:390
Header file of utility functions.
#define ADXL367_ABSOLUTE
Definition: adxl367.h:266
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:439
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:71
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:641
#define ADXL367_ACT_INACT_CTL_ACT_EN_MSK
Definition: adxl367.h:147
#define ADXL367_SELF_TEST_ST_FORCE
Definition: adxl367.h:232
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:439
#define ADXL367_REFERENCED
Definition: adxl367.h:267
#define ADXL367_WRITE_REG
Definition: adxl367.h:56
#define ADXL367_REG_DEVID_MST
Definition: adxl367.h:64
#define ADXL367_I2C_WRITE
Definition: adxl367.h:60
uint8_t tap_one
Definition: adxl367.h:406
adxl367_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl367.h:342
#define ADXL367_REG_X_OFFSET
Definition: adxl367.h:108
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1312
#define ADXL367_REG_THRESH_INACT_H
Definition: adxl367.h:92
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
@ ADXL367_8G_RANGE
Definition: adxl367.h:322
uint8_t temp_adc_hi
Definition: adxl367.h:403
@ ADXL367_FIFO_FORMAT_XT
Definition: adxl367.h:365
@ ADXL367_SPI_COMM
Definition: adxl367.h:302