Go to the documentation of this file.
50 #define ADXL38X_SPI_READ 0x01
51 #define ADXL38X_SPI_WRITE 0x00
54 #define ADXL38X_DEVID_AD 0x00
55 #define ADXL38X_DEVID_MST 0x01
56 #define ADXL38X_PART_ID 0x02
57 #define ADXL38X_PART_ID_REV_ID 0x03
58 #define ADXL38X_SERIAL_NUMBER_0 0x04
59 #define ADXL38X_SERIAL_NUMBER_1 0x05
60 #define ADXL38X_SERIAL_NUMBER_2 0x06
61 #define ADXL38X_SERIAL_NUMBER_3 0x07
62 #define ADXL38X_SERIAL_NUMBER_4 0x08
63 #define ADXL38X_SERIAL_NUMBER_5 0x09
64 #define ADXL38X_SERIAL_NUMBER_6 0x0A
65 #define ADXL38X_DEV_DELTA_Q_X 0x0B
66 #define ADXL38X_DEV_DELTA_Q_Y 0x0C
67 #define ADXL38X_DEV_DELTA_Q_Z 0x0D
68 #define ADXL38X_DEV_DELTA_F0_X 0x0E
69 #define ADXL38X_DEV_DELTA_F0_Y 0x0F
70 #define ADXL38X_DEV_DELTA_F0_Z 0x10
71 #define ADXL38X_STATUS0 0x11
72 #define ADXL38X_STATUS1 0x12
73 #define ADXL38X_STATUS2 0x13
74 #define ADXL38X_STATUS3 0x14
75 #define ADXL38X_XDATA_H 0x15
76 #define ADXL38X_XDATA_L 0x16
77 #define ADXL38X_YDATA_H 0x17
78 #define ADXL38X_YDATA_L 0x18
79 #define ADXL38X_ZDATA_H 0x19
80 #define ADXL38X_ZDATA_L 0x1A
81 #define ADXL38X_TDATA_H 0x1B
82 #define ADXL38X_TDATA_L 0x1C
83 #define ADXL38X_FIFO_DATA 0x1D
84 #define ADXL38X_FIFO_STATUS0 0x1E
85 #define ADXL38X_FIFO_STATUS1 0x1F
86 #define ADXL38X_MISC0 0x20
87 #define ADXL38X_MISC1 0x21
88 #define ADXL38X_SENS_DSM 0x24
89 #define ADXL38X_CLK_CTRL 0x25
90 #define ADXL38X_OP_MODE 0x26
91 #define ADXL38X_DIG_EN 0x27
92 #define ADXL38X_SAR_I2C 0x28
93 #define ADXL38X_NVM_CTL 0x29
94 #define ADXL38X_REG_RESET 0x2A
95 #define ADXL38X_INT0_MAP0 0x2B
96 #define ADXL38X_INT0_MAP1 0x2C
97 #define ADXL38X_INT1_MAP0 0x2D
98 #define ADXL38X_INT1_MAP1 0x2E
99 #define ADXL38X_TEST_EN 0x2F
100 #define ADXL38X_FIFO_CFG0 0x30
101 #define ADXL38X_FIFO_CFG1 0x31
102 #define ADXL38X_SPT_CFG0 0x32
103 #define ADXL38X_SPT_CFG1 0x33
104 #define ADXL38X_SPT_CFG2 0x34
105 #define ADXL38X_SYNC_CFG 0x35
106 #define ADXL38X_PDM_CFG 0x36
107 #define ADXL38X_ACT_INACT_CTL 0x37
108 #define ADXL38X_SNSR_AXIS_EN 0x38
109 #define ADXL38X_THRESH_ACT_H 0x39
110 #define ADXL38X_THRESH_ACT_L 0x3A
111 #define ADXL38X_TIME_ACT_H 0x3B
112 #define ADXL38X_TIME_ACT_M 0x3C
113 #define ADXL38X_TIME_ACT_L 0x3D
114 #define ADXL38X_THRESH_INACT_H 0x3E
115 #define ADXL38X_THRESH_INACT_L 0x3F
116 #define ADXL38X_TIME_INACT_H 0x40
117 #define ADXL38X_TIME_INACT_M 0x41
118 #define ADXL38X_TIME_INACT_L 0x42
119 #define ADXL38X_TAP_THRESH 0x43
120 #define ADXL38X_TAP_DUR 0x44
121 #define ADXL38X_TAP_LATENT 0x45
122 #define ADXL38X_TAP_WINDOW 0x46
123 #define ADXL38X_TAP_CFG 0x47
124 #define ADXL38X_OR_CFG 0x48
125 #define ADXL38X_TRIG_CFG 0x49
126 #define ADXL38X_X_SAR_OFFSET 0x4A
127 #define ADXL38X_Y_SAR_OFFSET 0x4B
128 #define ADXL38X_Z_SAR_OFFSET 0x4C
129 #define ADXL38X_X_DSM_OFFSET 0x4D
130 #define ADXL38X_Y_DSM_OFFSET 0x4E
131 #define ADXL38X_Z_DSM_OFFSET 0x4F
132 #define ADXL38X_FILTER 0x50
133 #define ADXL38X_USER_TEMP_SENS_0 0x55
134 #define ADXL38X_USER_TEMP_SENS_1 0x56
135 #define ADXL38X_MISO 0x58
136 #define ADXL38X_SOUT0 0x59
137 #define ADXL38X_MCLK 0x5A
138 #define ADXL38X_BCLK 0x5B
139 #define ADXL38X_FSYNC 0x5C
140 #define ADXL38X_INT0 0x5D
141 #define ADXL38X_INT1 0x5E
144 #define ADXL38X_RESET_ZERO 0x00
145 #define ADXL38X_RESET_DEVID_AD 0xAD
146 #define ADXL38X_RESET_DEVID_MST 0x1D
147 #define ADXL38X_RESET_PART_ID 0x17
148 #define ADXL38X_RESET_PART_ID_REV_ID 0xC1
149 #define ADXL38X_RESET_STATUS0 0x80
150 #define ADXL38X_RESET_STATUS2 0x04
151 #define ADXL38X_RESET_INT0_MAP0 0x80
152 #define ADXL38X_RESET_INT1_MAP1 0x80
153 #define ADXL38X_RESET_SPT_CFG1 0x08
154 #define ADXL38X_RESET_SPT_CFG2 0x1A
157 #define ADXL38X_MASK_RANGE 0xC0
158 #define ADXL38X_MASK_OP_MODE 0x0F
159 #define ADXL38X_MASK_CHEN_DIG_EN 0xF0
160 #define ADXL38X_NEG_ACC_MSK NO_OS_GENMASK(31, 16)
161 #define ADXL38X_SLF_TST_CTRL_MSK 0xE0
162 #define ADXL38X_FIFOCFG_FIFOMODE_MSK 0x30
165 #define ADXL38X_RESET_CODE 0x52
166 #define ADXL38X_RESET_STATUS 0x80000400
176 #define ADXL380_ACC_SCALE_FACTOR_GEE_MUL (int64_t) 1333
184 #define ADXL382_ACC_SCALE_FACTOR_GEE_MUL (int64_t) 5000
186 #define ADXL38X_ACC_SCALE_FACTOR_GEE_DIV (int32_t) 10000000
195 #define ADXL38X_TEMP_OFFSET (int32_t) 295
196 #define ADXL38X_TEMP_SCALE_NUM (int32_t) 102
197 #define ADXL38X_TEMP_SCALE_DEN (int32_t) 10
206 #define ADXL380_ACC_SENSITIVITY (int32_t) 7500
213 #define ADXL382_ACC_SENSITIVITY (int32_t) 2000
217 #define ADXL380_XY_ST_LIMIT_MIN 29
218 #define ADXL380_Z_ST_LIMIT_MIN 27
219 #define ADXL380_XY_ST_LIMIT_MAX 50
220 #define ADXL380_Z_ST_LIMIT_MAX 32
222 #define ADXL382_XY_ST_LIMIT_MIN 31
223 #define ADXL382_Z_ST_LIMIT_MIN 26
224 #define ADXL382_XY_ST_LIMIT_MAX 42
225 #define ADXL382_Z_ST_LIMIT_MAX 34
227 #define ADXL38X_ST_LIMIT_DENOMINATOR 10
406 uint16_t size, uint8_t *read_data);
408 uint16_t size, uint8_t *write_data);
436 bool st_force,
bool st_dir);
442 uint16_t *raw_y, uint16_t *raw_z);
449 uint16_t *raw_x, uint16_t *raw_y,
450 uint16_t *raw_z, uint16_t *raw_temp);
458 bool *st_x,
bool *st_y,
bool *st_z);
462 bool chIDEnable,
bool readReset);
adxl38x_comm_type
Definition: adxl38x.h:241
#define ADXL38X_RESET_DEVID_MST
Definition: adxl38x.h:146
int adxl38x_register_update_bits(struct adxl38x_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t update_val)
Updates register with specified bits using given mask.
Definition: adxl38x.c:136
@ ADXL382_RANGE_15G
Definition: adxl38x.h:252
#define ADXL38X_RESET_CODE
Definition: adxl38x.h:165
@ ADXL38X_MODE_HP_SERIAL_VLP_OP
Definition: adxl38x.h:276
#define ADXL38X_FIFO_CFG1
Definition: adxl38x.h:101
@ ADXL38X_MODE_VLP
Definition: adxl38x.h:267
Header file of ADXL38X Driver.
enum adxl38x_comm_type comm_type
Definition: adxl38x.h:358
@ ADXL38X_I2C_COMM
Definition: adxl38x.h:243
uint8_t OVER_RANGE
Definition: adxl38x.h:380
#define ADXL38X_DEVID_MST
Definition: adxl38x.h:55
struct _adxl38x_sts_reg_flags fields
Definition: adxl38x.h:397
enum adxl38x_id dev_type
Definition: adxl38x.h:337
int32_t adxl372_spi_reg_read_multiple(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
Definition: adxl372_spi.c:94
@ ADXL38X_MODE_LP_SERIAL_ULP_OP
Definition: adxl38x.h:269
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
uint32_t value
Definition: adxl38x.h:398
uint8_t FIFO_OVR
Definition: adxl38x.h:388
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
#define ADXL38X_MISC0
Definition: adxl38x.h:86
uint8_t DOUBLE_TAP
Definition: adxl38x.h:378
@ ADXL38X_CH_EN_Z
Definition: adxl38x.h:288
uint8_t NVM_BUSY_STATUS
Definition: adxl38x.h:393
#define ADXL380_ACC_SCALE_FACTOR_GEE_MUL
Definition: adxl38x.h:176
@ ADXL382_RANGE_60G
Definition: adxl38x.h:256
#define ADXL38X_SLF_TST_CTRL_MSK
Definition: adxl38x.h:161
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
#define ADXL38X_ACC_SCALE_FACTOR_GEE_DIV
Definition: adxl38x.h:186
struct no_os_spi_desc * spi_desc
Definition: adxl38x.h:321
Definition: adxl38x.h:363
@ ADXL38X_FIFO_NORMAL
Definition: adxl38x.h:303
@ ADXL38X_MODE_HP_SERIAL_ULP_OP
Definition: adxl38x.h:275
#define ADXL382_Z_ST_LIMIT_MIN
Definition: adxl38x.h:223
union adxl38x_comm_desc com_desc
Definition: adxl38x.h:339
uint8_t ACT
Definition: adxl38x.h:382
Header file of SPI Interface.
#define ADXL382_ACC_SENSITIVITY
Definition: adxl38x.h:213
int adxl38x_get_xyz_gees(struct adxl38x_dev *dev, enum adxl38x_ch_select channels, struct adxl38x_fractional_val *x, struct adxl38x_fractional_val *y, struct adxl38x_fractional_val *z)
Reads the raw output data of each axis and converts it to g.
Definition: adxl38x.c:666
uint8_t NVM_IRQ
Definition: adxl38x.h:384
int adxl38x_data_raw_to_gees(struct adxl38x_dev *dev, uint8_t *raw_accel_data, struct adxl38x_fractional_val *data_frac)
Function to convert accel data to gees.
Definition: adxl38x.c:957
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
#define ADXL38X_DEVID_AD
Definition: adxl38x.h:54
@ ADXL38X_CH_EN_ZT
Definition: adxl38x.h:292
#define ADXL382_XY_ST_LIMIT_MAX
Definition: adxl38x.h:224
@ ADXL38X_MODE_LP_SERIAL_VLP_OP
Definition: adxl38x.h:270
#define ADXL38X_PART_ID
Definition: adxl38x.h:56
@ ADXL38X_MODE_RBW
Definition: adxl38x.h:271
#define ADXL38X_STATUS0
Definition: adxl38x.h:71
int adxl38x_get_sts_reg(struct adxl38x_dev *dev, union adxl38x_sts_reg_flags *status_flags)
Reads the status registers.
Definition: adxl38x.c:466
Header file of Delay functions.
int adxl38x_clear_self_test_registers(struct adxl38x_dev *dev)
Resets the self test registers for the part.
Definition: adxl38x.c:446
@ ADXL38X_FIFO_DISABLE
Definition: adxl38x.h:302
uint8_t NVM_CRC_DONE
Definition: adxl38x.h:372
#define ADXL38X_TEMP_SCALE_DEN
Definition: adxl38x.h:197
#define ADXL38X_SPI_WRITE
Definition: adxl38x.h:51
@ ADXL38X_MODE_HRT_SND
Definition: adxl38x.h:265
#define ADXL38X_TEMP_SCALE_NUM
Definition: adxl38x.h:196
Definition: ad9361_util.h:69
Header file for adxl372 Driver.
uint8_t FIFO_READY
Definition: adxl38x.h:390
uint8_t DATA_READY
Definition: adxl38x.h:365
int adxl38x_accel_set_FIFO(struct adxl38x_dev *dev, uint16_t numSamples, bool externalTrigger, enum adxl38x_fifo_mode fifo_mode, bool chIDEnable, bool readReset)
Function to set the paramenters for FIFO mode.
Definition: adxl38x.c:896
ADXL38X Operating modes (OP MODE[3:0]).
int adxl38x_get_raw_data(struct adxl38x_dev *dev, enum adxl38x_ch_select channels, uint16_t *raw_x, uint16_t *raw_y, uint16_t *raw_z, uint16_t *raw_temp)
Reads the raw output data using burst read.
Definition: adxl38x.c:581
@ ADXL38X_CH_DSB_ALL
Definition: adxl38x.h:284
#define ADXL380_XY_ST_LIMIT_MIN
Definition: adxl38x.h:217
int adxl38x_get_xyz_gees(struct adxl38x_dev *dev, enum adxl38x_ch_select channels, struct adxl38x_fractional_val *x, struct adxl38x_fractional_val *y, struct adxl38x_fractional_val *z)
Reads the raw output data of each axis and converts it to g.
Definition: adxl38x.c:666
@ ADXL38X_FIFO_STREAM
Definition: adxl38x.h:304
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 NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
int adxl38x_get_deviceID(struct adxl38x_dev *dev, enum adxl38x_id *devID)
Gets the current device type.
Definition: adxl38x.c:390
uint8_t NVM_ECC_DONE
Definition: adxl38x.h:375
uint8_t RESERVED2
Definition: adxl38x.h:366
@ ADXL38X_MODE_STDBY
Definition: adxl38x.h:264
enum adxl38x_op_mode op_mode
Definition: adxl38x.h:345
#define ADXL38X_DIG_EN
Definition: adxl38x.h:91
int adxl38x_soft_reset(struct adxl38x_dev *dev)
Performs a soft reset of the device.
Definition: adxl38x.c:270
ADXL38X Device structure.
Definition: adxl38x.h:335
int adxl38x_get_sts_reg(struct adxl38x_dev *dev, union adxl38x_sts_reg_flags *status_flags)
Reads the status registers.
Definition: adxl38x.c:466
int adxl38x_get_deviceID(struct adxl38x_dev *dev, enum adxl38x_id *devID)
Gets the current device type.
Definition: adxl38x.c:390
#define ADXL38X_RESET_PART_ID
Definition: adxl38x.h:147
@ ADXL38X_MODE_ULP
Definition: adxl38x.h:266
enum adxl38x_range range
Definition: adxl38x.h:343
struct no_os_i2c_desc * i2c_desc
Definition: adxl38x.h:319
@ ADXL38X_CH_EN_YZ
Definition: adxl38x.h:289
uint8_t RESERVED1
Definition: adxl38x.h:370
int64_t no_os_div_s64(int64_t dividend, int32_t divisor)
@ ADXL380_RANGE_4G
Definition: adxl38x.h:251
int adxl38x_accel_set_FIFO(struct adxl38x_dev *dev, uint16_t num_samples, bool external_trigger, enum adxl38x_fifo_mode fifo_mode, bool ch_ID_enable, bool read_reset)
Function to set the paramenters for FIFO mode.
Definition: adxl38x.c:896
uint8_t UV_FLAG
Definition: adxl38x.h:368
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
int adxl38x_soft_reset(struct adxl38x_dev *dev)
Performs a soft reset of the device.
Definition: adxl38x.c:270
#define ADXL38X_RESET_ZERO
Definition: adxl38x.h:144
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ ADXL38X_FIFO_TRIGGER
Definition: adxl38x.h:305
#define ADXL38X_REG_RESET
Definition: adxl38x.h:94
@ ADXL38X_CH_EN_XYZT
Definition: adxl38x.h:294
#define ADXL38X_OP_MODE
Definition: adxl38x.h:90
uint8_t comm_buff[320]
Definition: adxl38x.h:347
uint8_t NVM_CRC_ERR
Definition: adxl38x.h:371
@ ADXL38X_MODE_HP
Definition: adxl38x.h:274
#define ADXL38X_TEMP_OFFSET
Definition: adxl38x.h:195
#define ADXL372_REG_WRITE(x)
Definition: adxl372.h:116
#define ADXL382_ACC_SCALE_FACTOR_GEE_MUL
Definition: adxl38x.h:184
@ ID_ADXL380
Definition: adxl38x.h:237
int adxl38x_read_device_data(struct adxl38x_dev *dev, uint8_t base_address, uint16_t size, uint8_t *read_data)
Reads from the device.
Definition: adxl38x.c:69
uint8_t UV_FLAG_STICKY
Definition: adxl38x.h:369
adxl38x_ch_select
Definition: adxl38x.h:283
#define ADXL38X_MASK_RANGE
Definition: adxl38x.h:157
int32_t adxl372_i2c_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adxl372_i2c.c:47
@ ADXL38X_MODE_RBW_SERIAL_ULP_OP
Definition: adxl38x.h:272
@ ADXL38X_CH_EN_XY
Definition: adxl38x.h:287
int32_t adxl372_spi_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adxl372_spi.c:47
Definition: adxl372.h:362
@ ADXL382_RANGE_30G
Definition: adxl38x.h:254
Definition: adxl38x.h:396
ADXL38X FIFO mode (FIFO_CFG1[5:4]).
int adxl38x_set_range(struct adxl38x_dev *dev, enum adxl38x_range range_val)
Sets the measurement range register value.
Definition: adxl38x.c:345
#define ADXL38X_FIFOCFG_FIFOMODE_MSK
Definition: adxl38x.h:162
uint8_t OVER_RANGE_STICKY
Definition: adxl38x.h:381
int64_t integer
Definition: adxl38x.h:313
#define ADXL38X_SPI_READ
Definition: adxl38x.h:50
#define ADXL38X_XDATA_H
Definition: adxl38x.h:75
#define ADXL38X_SNSR_AXIS_EN
Definition: adxl38x.h:108
int adxl38x_register_update_bits(struct adxl38x_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t update_val)
Updates register with specified bits using given mask.
Definition: adxl38x.c:136
int adxl38x_write_device_data(struct adxl38x_dev *dev, uint8_t base_address, uint16_t size, uint8_t *write_data)
Writes to the device.
Definition: adxl38x.c:107
int adxl38x_get_range(struct adxl38x_dev *dev, enum adxl38x_range *range_val)
Gets the current range setting of the device.
Definition: adxl38x.c:366
int adxl38x_get_raw_xyz(struct adxl38x_dev *dev, uint16_t *raw_x, uint16_t *raw_y, uint16_t *raw_z)
Reads the raw output data using continuous read.
Definition: adxl38x.c:490
#define ADXL38X_ST_LIMIT_DENOMINATOR
Definition: adxl38x.h:227
int adxl38x_selftest(struct adxl38x_dev *dev, enum adxl38x_op_mode op_mode, bool *st_x, bool *st_y, bool *st_z)
Executed Selftest on the sensing axes and returns the outcome of the test.
Definition: adxl38x.c:759
int adxl38x_get_op_mode(struct adxl38x_dev *dev, enum adxl38x_op_mode *op_mode)
Gets the current operation mode of the device.
Definition: adxl38x.c:321
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int adxl38x_get_temp(struct adxl38x_dev *dev, struct adxl38x_fractional_val *raw_temp)
Reads the raw temperature data using burst read.
Definition: adxl38x.c:531
#define ADXL38X_YDATA_H
Definition: adxl38x.h:77
int32_t adxl372_i2c_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adxl372_i2c.c:76
int adxl38x_init(struct adxl38x_dev **device, struct adxl38x_init_param init_param)
Initializes the device and checks for valid peripheral communication.
Definition: adxl38x.c:167
adxl38x_id
Definition: adxl38x.h:236
#define ADXL38X_FIFO_CFG0
Definition: adxl38x.h:100
@ ADXL380_RANGE_8G
Definition: adxl38x.h:253
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
int adxl38x_get_temp(struct adxl38x_dev *dev, struct adxl38x_fractional_val *temp_degC)
Reads the raw temperature data using burst read.
Definition: adxl38x.c:531
Data format in which the values are converted.
Definition: adxl38x.h:312
uint8_t RESERVED
Definition: adxl38x.h:374
uint8_t FIFO_FULL
Definition: adxl38x.h:387
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
@ ADXL38X_SPI_COMM
Definition: adxl38x.h:242
int adxl38x_data_raw_to_gees(struct adxl38x_dev *dev, uint8_t *raw_accel_data, struct adxl38x_fractional_val *data_frac)
Function to convert accel data to gees.
Definition: adxl38x.c:957
Header file of I2C Interface.
#define ADXL380_Z_ST_LIMIT_MAX
Definition: adxl38x.h:220
int adxl38x_get_range(struct adxl38x_dev *dev, enum adxl38x_range *range_val)
Gets the current range setting of the device.
Definition: adxl38x.c:366
int adxl38x_get_raw_xyz(struct adxl38x_dev *dev, uint16_t *raw_x, uint16_t *raw_y, uint16_t *raw_z)
Reads the raw output data using continuous read.
Definition: adxl38x.c:490
#define ADXL38X_NEG_ACC_MSK
Definition: adxl38x.h:160
@ ID_ADXL382
Definition: adxl38x.h:238
enum adxl38x_comm_type comm_type
Definition: adxl38x.h:341
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
int adxl38x_set_op_mode(struct adxl38x_dev *dev, enum adxl38x_op_mode op_mode)
Places the device into the given operation mode.
Definition: adxl38x.c:298
struct no_os_spi_init_param spi_init
Definition: adxl38x.h:328
int adxl38x_selftest(struct adxl38x_dev *dev, enum adxl38x_op_mode op_mode, bool *st_x, bool *st_y, bool *st_z)
Executed Selftest on the sensing axes and returns the outcome of the test.
Definition: adxl38x.c:759
struct no_os_i2c_init_param i2c_init
Definition: adxl38x.h:326
ADXL38X Range (OP MODE[7:6]).
#define ADXL382_Z_ST_LIMIT_MAX
Definition: adxl38x.h:225
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
uint8_t TRIPLE_TAP
Definition: adxl38x.h:379
int adxl38x_remove(struct adxl38x_dev *dev)
Free the resources allocated by the init function.
Definition: adxl38x.c:250
int adxl38x_set_op_mode(struct adxl38x_dev *dev, enum adxl38x_op_mode op_mode)
Places the device into the given operation mode.
Definition: adxl38x.c:298
#define ADXL38X_RESET_DEVID_AD
Definition: adxl38x.h:145
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
#define NULL
Definition: wrapper.h:64
uint8_t PARITY_ERR_STICKY
Definition: adxl38x.h:386
#define ADXL38X_TDATA_H
Definition: adxl38x.h:81
int adxl38x_init(struct adxl38x_dev **device, struct adxl38x_init_param init_param)
Initializes the device and checks for valid peripheral communication.
Definition: adxl38x.c:167
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int adxl38x_get_raw_data(struct adxl38x_dev *dev, enum adxl38x_ch_select channels, uint16_t *raw_x, uint16_t *raw_y, uint16_t *raw_z, uint16_t *raw_temp)
Reads the raw output data using burst read.
Definition: adxl38x.c:581
enum adxl38x_id dev_type
Definition: adxl38x.h:360
int32_t adxl372_spi_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adxl372_spi.c:73
uint8_t NVM_DONE
Definition: adxl38x.h:392
#define ADXL380_ACC_SENSITIVITY
Definition: adxl38x.h:206
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
@ ADXL38X_CH_EN_YZT
Definition: adxl38x.h:293
@ ADXL38X_MODE_RBW_SERIAL_VLP_OP
Definition: adxl38x.h:273
int adxl38x_write_device_data(struct adxl38x_dev *dev, uint8_t base_address, uint16_t size, uint8_t *write_data)
Writes to the device.
Definition: adxl38x.c:107
@ ADXL38X_CH_EN_X
Definition: adxl38x.h:285
int32_t fractional
Definition: adxl38x.h:314
@ ADXL38X_CH_EN_T
Definition: adxl38x.h:291
struct no_os_i2c_desc * i2c_desc
Definition: adxl372.h:366
#define ADXL380_XY_ST_LIMIT_MAX
Definition: adxl38x.h:219
@ ADXL38X_CH_EN_XYZ
Definition: adxl38x.h:290
int adxl38x_set_self_test_registers(struct adxl38x_dev *dev, bool st_mode, bool st_force, bool st_dir)
Sets the part to execute self-test routine.
Definition: adxl38x.c:418
int adxl38x_remove(struct adxl38x_dev *dev)
Free the resources allocated by the init function.
Definition: adxl38x.c:250
uint8_t FIFO_WATERMARK
Definition: adxl38x.h:389
int32_t adxl372_i2c_reg_read_multiple(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data, uint16_t count)
Definition: adxl372_i2c.c:97
int adxl38x_get_op_mode(struct adxl38x_dev *dev, enum adxl38x_op_mode *op_mode)
Gets the current operation mode of the device.
Definition: adxl38x.c:321
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
uint8_t INACT
Definition: adxl38x.h:383
#define ADXL382_XY_ST_LIMIT_MIN
Definition: adxl38x.h:222
Header file of utility functions.
int32_t no_os_sign_extend32(uint32_t value, int index)
int adxl38x_read_device_data(struct adxl38x_dev *dev, uint8_t base_address, uint16_t size, uint8_t *read_data)
Reads from the device.
Definition: adxl38x.c:69
@ ADXL38X_MODE_LP
Definition: adxl38x.h:268
uint8_t EFUSE_BUSY_REGERR_STICKY
Definition: adxl38x.h:391
@ ADXL38X_CH_EN_Y
Definition: adxl38x.h:286
Definition: adxl38x.h:324
uint8_t NVM_ECC_DET
Definition: adxl38x.h:373
Error macro definition for ARM Compiler.
Definition: adxl38x.h:317
Structure holding the parameters for ADXL38X device initialization.
Definition: adxl38x.h:354
int adxl38x_set_range(struct adxl38x_dev *dev, enum adxl38x_range range_val)
Sets the measurement range register value.
Definition: adxl38x.c:345
#define ADXL38X_ZDATA_H
Definition: adxl38x.h:79
#define ADXL38X_MASK_OP_MODE
Definition: adxl38x.h:158
int adxl38x_set_self_test_registers(struct adxl38x_dev *dev, bool st_mode, bool st_force, bool st_dir)
Sets the part to execute self-test routine.
Definition: adxl38x.c:418
#define ADXL380_Z_ST_LIMIT_MIN
Definition: adxl38x.h:218
struct no_os_spi_desc * spi_desc
Definition: adxl372.h:364
uint8_t SINGLE_TAP
Definition: adxl38x.h:377
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define ADXL38X_MASK_CHEN_DIG_EN
Definition: adxl38x.h:159
#define ADXL372_REG_READ(x)
Definition: adxl372.h:115
@ ADXL380_RANGE_16G
Definition: adxl38x.h:255
union adxl38x_comm_init_param comm_init
Definition: adxl38x.h:356