Go to the documentation of this file.
50 #define ADXL367_WRITE_REG 0x0A
51 #define ADXL367_READ_REG 0x0B
52 #define ADXL367_READ_FIFO 0x0D
53 #define ADXL367_I2C_READ 0x01
54 #define ADXL367_I2C_WRITE 0x00
57 #define ADXL367_REG_DEVID_AD 0x00
58 #define ADXL367_REG_DEVID_MST 0x01
59 #define ADXL367_REG_PARTID 0x02
60 #define ADXL367_REG_REVID 0x03
61 #define ADXL367_REG_SERIAL_NUMBER_3 0x04
62 #define ADXL367_REG_SERIAL_NUMBER_2 0x05
63 #define ADXL367_REG_SERIAL_NUMBER_1 0x06
64 #define ADXL367_REG_SERIAL_NUMBER_0 0x07
65 #define ADXL367_REG_XDATA 0x08
66 #define ADXL367_REG_YDATA 0x09
67 #define ADXL367_REG_ZDATA 0x0A
68 #define ADXL367_REG_STATUS 0x0B
69 #define ADXL367_REG_FIFO_ENTRIES_L 0x0C
70 #define ADXL367_REG_FIFO_ENTRIES_H 0x0D
71 #define ADXL367_REG_XDATA_H 0x0E
72 #define ADXL367_REG_XDATA_L 0x0F
73 #define ADXL367_REG_YDATA_H 0x10
74 #define ADXL367_REG_YDATA_L 0x11
75 #define ADXL367_REG_ZDATA_H 0x12
76 #define ADXL367_REG_ZDATA_L 0x13
77 #define ADXL367_REG_TEMP_H 0x14
78 #define ADXL367_REG_TEMP_L 0x15
79 #define ADXL367_REG_EX_ADC_H 0x16
80 #define ADXL367_REG_EX_ADC_L 0x17
81 #define ADXL367_REG_I2C_FIFO_DATA 0x18
82 #define ADXL367_REG_SOFT_RESET 0x1F
83 #define ADXL367_REG_THRESH_ACT_H 0x20
84 #define ADXL367_REG_THRESH_ACT_L 0x21
85 #define ADXL367_REG_TIME_ACT 0x22
86 #define ADXL367_REG_THRESH_INACT_H 0x23
87 #define ADXL367_REG_THRESH_INACT_L 0x24
88 #define ADXL367_REG_TIME_INACT_H 0x25
89 #define ADXL367_REG_TIME_INACT_L 0x26
90 #define ADXL367_REG_ACT_INACT_CTL 0x27
91 #define ADXL367_REG_FIFO_CONTROL 0x28
92 #define ADXL367_REG_FIFO_SAMPLES 0x29
93 #define ADXL367_REG_INTMAP1_LWR 0x2A
94 #define ADXL367_REG_INTMAP2_LWR 0x2B
95 #define ADXL367_REG_FILTER_CTL 0x2C
96 #define ADXL367_REG_POWER_CTL 0x2D
97 #define ADXL367_REG_SELF_TEST 0x2E
98 #define ADXL367_REG_TAP_THRESH 0x2F
99 #define ADXL367_REG_TAP_DUR 0x30
100 #define ADXL367_REG_TAP_LATENT 0x31
101 #define ADXL367_REG_TAP_WINDOW 0x32
102 #define ADXL367_REG_X_OFFSET 0x33
103 #define ADXL367_REG_Y_OFFSET 0x34
104 #define ADXL367_REG_Z_OFFSET 0x35
105 #define ADXL367_REG_X_SENS 0x36
106 #define ADXL367_REG_Y_SENS 0x37
107 #define ADXL367_REG_Z_SENS 0x38
108 #define ADXL367_REG_TIMER_CTL 0x39
109 #define ADXL367_REG_INTMAP1_UPPER 0x3A
110 #define ADXL367_REG_INTMAP2_UPPER 0x3B
111 #define ADXL367_REG_ADC_CTL 0x3C
112 #define ADXL367_REG_TEMP_CTL 0x3D
113 #define ADXL367_REG_TEMP_ADC_OV_TH_H 0x3E
114 #define ADXL367_REG_TEMP_ADC_OV_TH_L 0x3F
115 #define ADXL367_REG_TEMP_ADC_UN_TH_H 0x40
116 #define ADXL367_REG_TEMP_ADC_UN_TH_L 0x41
117 #define ADXL367_REG_TEMP_ADC_TIMER 0x42
118 #define ADXL367_REG_AXIS_MASK 0x43
119 #define ADXL367_REG_STATUS_COPY 0x44
120 #define ADXL367_REG_STATUS_2 0x45
123 #define ADXL367_STATUS_ERR_USER_REGS NO_OS_BIT(7)
124 #define ADXL367_STATUS_AWAKE NO_OS_BIT(6)
125 #define ADXL367_STATUS_INACT NO_OS_BIT(5)
126 #define ADXL367_STATUS_ACT NO_OS_BIT(4)
127 #define ADXL367_STATUS_FIFO_OVERRUN NO_OS_BIT(3)
128 #define ADXL367_STATUS_FIFO_WATERMARK NO_OS_BIT(2)
129 #define ADXL367_STATUS_FIFO_RDY NO_OS_BIT(1)
130 #define ADXL367_STATUS_DATA_RDY NO_OS_BIT(0)
133 #define ADXL367_THRESH_H 0x7F
136 #define ADXL367_THRESH_L 0xFC
139 #define ADXL367_ACT_INACT_CTL_LINKLOOP_MSK NO_OS_GENMASK(5, 4)
140 #define ADXL367_ACT_INACT_CTL_INACT_EN_MSK NO_OS_GENMASK(3, 2)
141 #define ADXL367_ACT_INACT_CTL_ACT_EN_MSK NO_OS_GENMASK(1, 0)
144 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED 0x0
145 #define ADXL367_INACTIVITY_ENABLE 0x1
146 #define ADXL367_NO_INACTIVITY_DETECTION_ENABLED_2 0x2
147 #define ADXL367_REFERENCED_INACTIVITY_ENABLE 0x3
150 #define ADXL367_NO_ACTIVITY_DETECTION 0x0
151 #define ADXL367_ACTIVITY_ENABLE 0x1
152 #define ADXL367_NO_ACTIVITY_DETECTION_2 0x2
153 #define ADXL367_REFERENCED_ACTIVITY_ENABLE 0x3
156 #define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK NO_OS_GENMASK(6, 3)
157 #define ADXL367_FIFO_CONTROL_FIFO_SAMPLES NO_OS_BIT(2)
158 #define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK NO_OS_GENMASK(1, 0)
161 #define ADXL367_ALL_AXIS 0x0
162 #define ADXL367_X_AXIS 0x1
163 #define ADXL367_Y_AXIS 0x2
164 #define ADXL367_X_AXIS_2 0x3
165 #define ADXL367_ALL_AXIS_TEMP 0x4
166 #define ADXL367_X_AXIS_TEMP 0x5
167 #define ADXL367_Y_AXIS_TEMP 0x6
168 #define ADXL367_Z_AXIS_TEMP 0x7
169 #define ADXL367_ALL_AXIS_EXT_ADC 0x8
170 #define ADXL367_X_AXIS_EXT_ADC 0x9
171 #define ADXL367_Y_AXIS_EXT_ADC 0xA
172 #define ADXL367_Z_AXIS_EXT_ADC 0xB
175 #define ADXL367_FIFO_DISABLE 0
176 #define ADXL367_FIFO_OLDEST_SAVED 1
177 #define ADXL367_FIFO_STREAM 2
178 #define ADXL367_FIFO_TRIGGERED 3
181 #define ADXL367_INTMAP1_INT_LOW_INT1 NO_OS_BIT(7)
182 #define ADXL367_INTMAP1_AWAKE_INT1 NO_OS_BIT(6)
183 #define ADXL367_INTMAP1_INACT_INT1 NO_OS_BIT(5)
184 #define ADXL367_INTMAP1_ACT_INT1 NO_OS_BIT(4)
185 #define ADXL367_INTMAP1_FIFO_OVERRUN_INT1 NO_OS_BIT(3)
186 #define ADXL367_INTMAP1_FIFO_WATERMARK_INT1 NO_OS_BIT(2)
187 #define ADXL367_INTMAP1_FIFO_RDY_INT1 NO_OS_BIT(1)
188 #define ADXL367_INTMAP1_DATA_RDY_INT1 NO_OS_BIT(0)
191 #define ADXL367_INTMAP2_INT_LOW_INT2 NO_OS_BIT(7)
192 #define ADXL367_INTMAP2_AWAKE_INT2 NO_OS_BIT(6)
193 #define ADXL367_INTMAP2_INACT_INT2 NO_OS_BIT(5)
194 #define ADXL367_INTMAP2_ACT_INT2 NO_OS_BIT(4)
195 #define ADXL367_INTMAP2_FIFO_OVERRUN_INT2 NO_OS_BIT(3)
196 #define ADXL367_INTMAP2_FIFO_WATERMARK_INT2 NO_OS_BIT(2)
197 #define ADXL367_INTMAP2_FIFO_RDY_INT2 NO_OS_BIT(1)
198 #define ADXL367_INTMAP2_DATA_RDY_INT2 NO_OS_BIT(0)
201 #define ADXL367_FILTER_CTL_RANGE_MSK NO_OS_GENMASK(7, 6)
202 #define ADXL367_FILTER_I2C_HS NO_OS_BIT(5)
203 #define ADXL367_FILTER_CTL_RES NO_OS_BIT(4)
204 #define ADXL367_FILTER_CTL_EXT_SAMPLE NO_OS_BIT(3)
205 #define ADXL367_FILTER_CTL_ODR_MSK NO_OS_GENMASK(2, 0)
208 #define ADXL367_RANGE_2G 0
209 #define ADXL367_RANGE_4G 1
210 #define ADXL367_RANGE_8G 2
213 #define ADXL367_POWER_CTL_RES NO_OS_BIT(7)
214 #define ADXL367_POWER_CTL_EXT_CLK NO_OS_BIT(6)
215 #define ADXL367_POWER_CTL_LOW_NOISE_MSK NO_OS_GENMASK(5, 4)
216 #define ADXL367_POWER_CTL_WAKEUP NO_OS_BIT(3)
217 #define ADXL367_POWER_CTL_AUTOSLEEP NO_OS_BIT(2)
218 #define ADXL367_POWER_CTL_MEASURE_MSK NO_OS_GENMASK(1, 0)
221 #define ADXL367_NOISE_MODE_NORMAL 0
222 #define ADXL367_NOISE_MODE_LOW 1
223 #define ADXL367_NOISE_MODE_ULTRALOW 2
226 #define ADXL367_SELF_TEST_ST_FORCE NO_OS_BIT(1)
227 #define ADXL367_SELF_TEST_ST NO_OS_BIT(0)
230 #define ADXL367_XYZ_AXIS_OFFSET_MASK 0x1F
233 #define ADXL367_INTMAPX_UPPER_MASK 0xDF
236 #define ADXL367_FIFO_8_12BIT_MSK NO_OS_GENMASK(7,6)
237 #define ADXL367_ADC_INACT_EN NO_OS_BIT(3)
238 #define ADXL367_ADC_ACT_EN NO_OS_BIT(1)
239 #define ADXL367_ADC_EN NO_OS_BIT(0)
242 #define ADXL367_TEMP_INACT_EN NO_OS_BIT(3)
243 #define ADXL367_TEMP_ACT_EN NO_OS_BIT(1)
244 #define ADXL367_TEMP_EN NO_OS_BIT(0)
247 #define ADXL367_DEVICE_AD 0xAD
248 #define ADXL367_DEVICE_MST 0x1D
249 #define ADXL367_PART_ID 0xF7
252 #define ADXL367_RESET_KEY 0x52
255 #define ADXL367_FIFO_X_ID 0x00
256 #define ADXL367_FIFO_Y_ID 0x01
257 #define ADXL367_FIFO_Z_ID 0x02
258 #define ADXL367_FIFO_TEMP_ADC_ID 0x03
260 #define ADXL367_ABSOLUTE 0x00
261 #define ADXL367_REFERENCED 0x01
269 #define ADXL367_ACC_SCALE_FACTOR_MUL 245166ULL
270 #define ADXL367_ACC_SCALE_FACTOR_DIV 1000000000
277 #define ADXL367_TEMP_OFFSET 1185
278 #define ADXL367_TEMP_25C 165
279 #define ADXL367_TEMP_SCALE 18518518
280 #define ADXL367_TEMP_SCALE_DIV 1000000000
283 #define ADXL367_SELF_TEST_MIN 90 * 100 / 25
285 #define ADXL367_SELF_TEST_MAX 270 * 100 / 25
478 uint8_t register_value,
479 uint8_t register_address);
484 uint8_t register_address,
485 uint8_t bytes_number);
510 uint16_t y_offset, uint16_t z_offset);
568 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:709
#define ADXL367_I2C_READ
Definition: adxl367.h:53
@ ADXL367_12B_CHID
Definition: adxl367.h:380
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1198
#define ADXL367_REG_THRESH_INACT_L
Definition: adxl367.h:87
#define ADXL367_REG_TEMP_H
Definition: adxl367.h:77
#define ADXL367_REG_XDATA_L
Definition: adxl367.h:72
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:523
@ ADXL367_ODR_100HZ
Definition: adxl367.h:327
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1143
#define ADXL367_REG_TIME_INACT_H
Definition: adxl367.h:88
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:665
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
uint8_t i2c_slave_address
Definition: adxl367.h:459
struct no_os_i2c_desc * i2c_desc
Definition: adxl367.h:430
#define ADXL367_REG_STATUS_2
Definition: adxl367.h:120
#define ADXL367_SELF_TEST_MAX
Definition: adxl367.h:285
enum adxl367_range range
Definition: adxl367.h:434
int adxl367_int_map(struct adxl367_dev *dev, struct adxl367_int_map *map, uint8_t pin)
Enables specified events to interrupt pin.
Definition: adxl367.c:1198
@ ADXL367_OP_STANDBY
Definition: adxl367.h:305
uint8_t fifo_watermark
Definition: adxl367.h:406
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
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
int64_t integer
Definition: adxl367.h:416
int adxl367_set_offset(struct adxl367_dev *dev, uint16_t x_offset, uint16_t y_offset, uint16_t z_offset)
Sets offset for each axis.
Definition: adxl367.c:523
uint8_t err_user_regs
Definition: adxl367.h:395
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t bytes_number)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:284
@ ADXL367_14B_CHID
Definition: adxl367.h:386
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:830
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
adxl367_odr
Enum for selecting output data rate.
Definition: adxl367.h:323
#define ADXL367_FIFO_TEMP_ADC_ID
Definition: adxl367.h:258
#define ADXL367_THRESH_L
Definition: adxl367.h:136
@ ADXL367_FIFO_FORMAT_Y
Definition: adxl367.h:353
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:854
int adxl367_get_register_value(struct adxl367_dev *dev, uint8_t *read_data, uint8_t register_address, uint8_t register_nb)
Performs a burst read of a specified number of registers.
Definition: adxl367.c:284
#define ADXL367_FILTER_CTL_ODR_MSK
Definition: adxl367.h:205
Header file of SPI Interface.
uint8_t awake
Definition: adxl367.h:402
#define ADXL367_ACC_SCALE_FACTOR_MUL
Definition: adxl367.h:269
@ ADXL367_STREAM_MODE
Definition: adxl367.h:339
int adxl367_get_nb_of_fifo_entries(struct adxl367_dev *dev, uint16_t *entr_nb)
Reads the number of FIFO entries.
Definition: adxl367.c:830
@ ADXL367_FIFO_FORMAT_XYZT
Definition: adxl367.h:357
#define ADXL367_RESET_KEY
Definition: adxl367.h:252
uint8_t fifo_ready
Definition: adxl367.h:407
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
enum adxl367_comm_type comm_type
Definition: adxl367.h:426
#define ADXL367_REG_THRESH_ACT_H
Definition: adxl367.h:83
int adxl367_adc_read_en(struct adxl367_dev *dev, bool enable)
Enables ADC reading. Disables temperature reading.
Definition: adxl367.c:682
int adxl367_set_fifo_sample_sets_nb(struct adxl367_dev *dev, uint16_t sets_nb)
Sets the number of FIFO sample sets.
Definition: adxl367.c:854
#define ADXL367_REG_POWER_CTL
Definition: adxl367.h:96
@ ADXL367_ODR_12P5HZ
Definition: adxl367.h:324
#define ADXL367_DEVICE_MST
Definition: adxl367.h:248
@ ADXL367_I2C_COMM
Definition: adxl367.h:297
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
#define ADXL367_REFERENCED_ACTIVITY_ENABLE
Definition: adxl367.h:153
uint8_t fifo_overrun
Definition: adxl367.h:405
#define ADXL367_REG_EX_ADC_H
Definition: adxl367.h:79
int adxl367_temp_read_en(struct adxl367_dev *dev, bool enable)
Enables temperature reading.
Definition: adxl367.c:665
@ ADXL367_ODR_400HZ
Definition: adxl367.h:329
Header file of Delay functions.
uint8_t err_fuse
Definition: adxl367.h:394
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:792
#define ADXL367_ACTIVITY_ENABLE
Definition: adxl367.h:151
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
@ ADXL367_FIFO_FORMAT_XYZA
Definition: adxl367.h:365
uint8_t i2c_slave_address
Definition: adxl367.h:432
uint8_t fifo_buffer[1027]
Definition: adxl367.h:441
#define ADXL367_THRESH_H
Definition: adxl367.h:133
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:255
#define ADXL367_ACC_SCALE_FACTOR_DIV
Definition: adxl367.h:270
int adxl367_set_range(struct adxl367_dev *dev, enum adxl367_range range)
Selects the measurement range.
Definition: adxl367.c:465
adxl367_op_mode
Enum for operating mode.
Definition: adxl367.h:304
#define ADXL367_REG_ACT_INACT_CTL
Definition: adxl367.h:90
Definition: ad9361_util.h:69
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:496
int adxl367_read_adc(struct adxl367_dev *dev, int16_t *data)
Reads ADC data. If ADXL367_ADC_EN is not set, use adxl367_adc_read_en() first to enable ADC reading.
Definition: adxl367.c:792
enum adxl367_op_mode op_mode
Definition: adxl367.h:435
#define ADXL367_REG_SELF_TEST
Definition: adxl367.h:97
@ ADXL367_FIFO_FORMAT_YT
Definition: adxl367.h:361
ADXL367 Device structure.
Definition: adxl367.h:424
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1249
adxl367_comm_type
Enum for communication type.
Definition: adxl367.h:295
@ ADXL367_2G_RANGE
Definition: adxl367.h:314
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
#define ADXL367_REG_STATUS
Definition: adxl367.h:68
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1306
int adxl367_set_output_rate(struct adxl367_dev *dev, enum adxl367_odr odr)
Selects the Output Data Rate of the device.
Definition: adxl367.c:496
int32_t fractional
Definition: adxl367.h:417
#define ADXL367_TEMP_SCALE_DIV
Definition: adxl367.h:280
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:391
@ ADXL367_FIFO_FORMAT_XYZ
Definition: adxl367.h:349
Structure holding the parameters for ADXL367 device initialization.
Definition: adxl367.h:451
int adxl367_read_raw_temp(struct adxl367_dev *dev, int16_t *raw_temp)
Reads the raw temperature of the device. If ADXL367_TEMP_EN is not set, use adxl367_temp_read_en() fi...
Definition: adxl367.c:709
enum adxl367_odr odr
Definition: adxl367.h:436
#define ADXL367_PART_ID
Definition: adxl367.h:249
@ ADXL367_FIFO_DISABLED
Definition: adxl367.h:337
@ ADXL367_8B
Definition: adxl367.h:382
uint8_t tap_two
Definition: adxl367.h:399
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1055
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
#define ADXL367_FIFO_X_ID
Definition: adxl367.h:255
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:465
uint8_t inact
Definition: adxl367.h:403
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:368
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:138
@ ADXL367_FIFO_FORMAT_ZA
Definition: adxl367.h:371
#define ADXL367_XYZ_AXIS_OFFSET_MASK
Definition: adxl367.h:230
adxl367_fifo_read_mode
Enum for selecting FIFO reading mode.
Definition: adxl367.h:378
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:65
int adxl367_setup_activity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl367.c:1249
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:770
uint8_t temp_adc_low
Definition: adxl367.h:398
#define ADXL367_FIFO_Y_ID
Definition: adxl367.h:256
#define ADXL367_TEMP_SCALE
Definition: adxl367.h:279
int adxl367_reg_write_msk(struct adxl367_dev *dev, uint8_t reg_addr, uint8_t data, uint8_t mask)
Performs a masked write to a register.
Definition: adxl367.c:368
#define ADXL367_REG_INTMAP2_UPPER
Definition: adxl367.h:110
#define ADXL367_TEMP_OFFSET
Definition: adxl367.h:277
#define ADXL367_REG_INTMAP1_UPPER
Definition: adxl367.h:109
#define ADXL367_REG_I2C_FIFO_DATA
Definition: adxl367.h:81
enum adxl367_fifo_read_mode fifo_read_mode
Definition: adxl367.h:439
uint16_t y_offset
Definition: adxl367.h:443
#define ADXL367_READ_REG
Definition: adxl367.h:51
enum adxl367_fifo_format fifo_format
Definition: adxl367.h:438
#define ADXL367_REG_ADC_CTL
Definition: adxl367.h:111
#define ADXL367_REG_INTMAP1_LWR
Definition: adxl367.h:93
@ ADXL367_OP_MEASURE
Definition: adxl367.h:306
#define ADXL367_REG_FIFO_ENTRIES_L
Definition: adxl367.h:69
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:159
#define ADXL367_FIFO_Z_ID
Definition: adxl367.h:257
#define ADXL367_FILTER_CTL_RANGE_MSK
Definition: adxl367.h:201
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:562
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
#define ADXL367_REG_SOFT_RESET
Definition: adxl367.h:82
adxl367_range
Enum for selecting range.
Definition: adxl367.h:313
#define ADXL367_INTMAPX_UPPER_MASK
Definition: adxl367.h:233
@ ADXL367_FIFO_FORMAT_XA
Definition: adxl367.h:367
int adxl367_get_raw_xyz(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl367.c:562
@ ADXL367_FIFO_FORMAT_X
Definition: adxl367.h:351
#define ADXL367_REG_FILTER_CTL
Definition: adxl367.h:95
uint8_t data_ready
Definition: adxl367.h:408
uint16_t z_offset
Definition: adxl367.h:444
uint8_t act
Definition: adxl367.h:404
@ ADXL367_TRIGGERED_MODE
Definition: adxl367.h:340
Data format in which the values are converted.
Definition: adxl367.h:415
struct no_os_spi_desc * spi_desc
Definition: adxl367.h:428
#define ADXL367_REG_THRESH_ACT_L
Definition: adxl367.h:84
@ ADXL367_ODR_50HZ
Definition: adxl367.h:326
uint8_t kpalv_timer
Definition: adxl367.h:396
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
@ ADXL367_FIFO_FORMAT_ZT
Definition: adxl367.h:363
#define ADXL367_TEMP_EN
Definition: adxl367.h:244
#define ADXL367_ADC_EN
Definition: adxl367.h:239
int adxl367_self_test(struct adxl367_dev *dev)
Performs self test.
Definition: adxl367.c:159
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
#define ADXL367_DEVICE_AD
Definition: adxl367.h:247
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:682
uint8_t int_low
Definition: adxl367.h:401
int adxl367_set_fifo_format(struct adxl367_dev *dev, enum adxl367_fifo_format format)
Sets FIFO format.
Definition: adxl367.c:949
#define ADXL367_INACTIVITY_ENABLE
Definition: adxl367.h:145
int adxl367_read_raw_fifo(struct adxl367_dev *dev, int16_t *x, int16_t *y, int16_t *z, int16_t *temp_adc, uint16_t *entries)
Reads all available raw values from FIFO. If, after setting FIFO mode, any of x, y,...
Definition: adxl367.c:1055
@ ADXL367_FIFO_FORMAT_YA
Definition: adxl367.h:369
#define ADXL367_REG_XDATA_H
Definition: adxl367.h:71
#define ADXL367_POWER_CTL_MEASURE_MSK
Definition: adxl367.h:218
@ ADXL367_FIFO_FORMAT_Z
Definition: adxl367.h:355
@ ADXL367_4G_RANGE
Definition: adxl367.h:315
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
Contains bit options from INT registers.
Definition: adxl367.h:393
#define ADXL367_FIFO_CONTROL_FIFO_SAMPLES
Definition: adxl367.h:157
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
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:949
int adxl367_read_converted_fifo(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z, struct adxl367_fractional_val *temp_adc, uint16_t *entries)
Reads converted values from FIFO. If, after setting FIFO mode, any of x, y, z, temp or adc aren't sel...
Definition: adxl367.c:1143
#define ADXL367_REFERENCED_INACTIVITY_ENABLE
Definition: adxl367.h:147
int adxl367_read_temperature(struct adxl367_dev *dev, struct adxl367_fractional_val *temp)
Reads the temperature of the device.
Definition: adxl367.c:770
int adxl367_set_register_value(struct adxl367_dev *dev, uint8_t register_value, uint8_t register_address)
Writes data into a register.
Definition: adxl367.c:255
#define ADXL367_FIFO_8_12BIT_MSK
Definition: adxl367.h:236
#define ADXL367_SELF_TEST_MIN
Definition: adxl367.h:283
@ ADXL367_ODR_25HZ
Definition: adxl367.h:325
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:912
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
#define ADXL367_REG_DEVID_AD
Definition: adxl367.h:57
#define NULL
Definition: wrapper.h:64
#define ADXL367_STATUS_DATA_RDY
Definition: adxl367.h:130
enum adxl367_comm_type comm_type
Definition: adxl367.h:453
#define ADXL367_REG_Y_OFFSET
Definition: adxl367.h:103
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1018
#define ADXL367_FIFO_CONTROL_FIFO_MODE_MSK
Definition: adxl367.h:158
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:883
#define ADXL367_SELF_TEST_ST
Definition: adxl367.h:227
adxl367_fifo_format
Enum for selecting FIFO storage mode.
Definition: adxl367.h:347
struct no_os_spi_init_param spi_init
Definition: adxl367.h:455
int adxl367_set_fifo_read_mode(struct adxl367_dev *dev, enum adxl367_fifo_read_mode read_mode)
Sets FIFO read mode.
Definition: adxl367.c:912
@ ADXL367_ODR_200HZ
Definition: adxl367.h:328
int adxl367_fifo_setup(struct adxl367_dev *dev, enum adxl367_fifo_mode mode, enum adxl367_fifo_format format, uint8_t sets_nb)
Configures the FIFO feature. Uses ADXL367_14B_CHID read mode as default.
Definition: adxl367.c:1018
#define ADXL367_REG_TEMP_CTL
Definition: adxl367.h:112
#define ADXL367_ACT_INACT_CTL_INACT_EN_MSK
Definition: adxl367.h:140
int adxl367_software_reset(struct adxl367_dev *dev)
Performs soft-reset.
Definition: adxl367.c:391
int adxl367_set_fifo_mode(struct adxl367_dev *dev, enum adxl367_fifo_mode mode)
Sets FIFO mode.
Definition: adxl367.c:883
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
uint16_t x_offset
Definition: adxl367.h:442
#define ADXL367_REG_FIFO_CONTROL
Definition: adxl367.h:91
#define ADXL367_REG_Z_OFFSET
Definition: adxl367.h:104
#define ADXL367_REG_TIME_INACT_L
Definition: adxl367.h:89
#define ADXL367_READ_FIFO
Definition: adxl367.h:52
#define ADXL367_REG_FIFO_SAMPLES
Definition: adxl367.h:92
#define ADXL367_REG_TIME_ACT
Definition: adxl367.h:85
@ ADXL367_OLDEST_SAVED
Definition: adxl367.h:338
#define ADXL367_REG_PARTID
Definition: adxl367.h:59
#define ADXL367_FIFO_CONTROL_FIFO_CHANNEL_MSK
Definition: adxl367.h:156
struct no_os_i2c_init_param i2c_init
Definition: adxl367.h:457
enum adxl367_fifo_mode fifo_mode
Definition: adxl367.h:437
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
int adxl367_remove(struct adxl367_dev *dev)
Frees the resources allocated by adxl367_init().
Definition: adxl367.c:138
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:635
@ ADXL367_12B
Definition: adxl367.h:384
Header file of utility functions.
#define ADXL367_ABSOLUTE
Definition: adxl367.h:260
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:433
int adxl367_init(struct adxl367_dev **device, struct adxl367_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl367.c:65
int adxl367_get_g_xyz(struct adxl367_dev *dev, struct adxl367_fractional_val *x, struct adxl367_fractional_val *y, struct adxl367_fractional_val *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl367.c:635
#define ADXL367_ACT_INACT_CTL_ACT_EN_MSK
Definition: adxl367.h:141
#define ADXL367_SELF_TEST_ST_FORCE
Definition: adxl367.h:226
int adxl367_set_power_mode(struct adxl367_dev *dev, enum adxl367_op_mode mode)
Places the device into standby/measure mode.
Definition: adxl367.c:433
#define ADXL367_REFERENCED
Definition: adxl367.h:261
#define ADXL367_WRITE_REG
Definition: adxl367.h:50
#define ADXL367_REG_DEVID_MST
Definition: adxl367.h:58
#define ADXL367_I2C_WRITE
Definition: adxl367.h:54
uint8_t tap_one
Definition: adxl367.h:400
adxl367_fifo_mode
Enum for selecting FIFO operating mode.
Definition: adxl367.h:336
#define ADXL367_REG_X_OFFSET
Definition: adxl367.h:102
int adxl367_setup_inactivity_detection(struct adxl367_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl367.c:1306
#define ADXL367_REG_THRESH_INACT_H
Definition: adxl367.h:86
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
@ ADXL367_8G_RANGE
Definition: adxl367.h:316
uint8_t temp_adc_hi
Definition: adxl367.h:397
@ ADXL367_FIFO_FORMAT_XT
Definition: adxl367.h:359
@ ADXL367_SPI_COMM
Definition: adxl367.h:296