Go to the documentation of this file.
56 #define ADXL38X_SPI_READ 0x01
57 #define ADXL38X_SPI_WRITE 0x00
60 #define ADXL38X_DEVID_AD 0x00
61 #define ADXL38X_DEVID_MST 0x01
62 #define ADXL38X_PART_ID 0x02
63 #define ADXL38X_PART_ID_REV_ID 0x03
64 #define ADXL38X_SERIAL_NUMBER_0 0x04
65 #define ADXL38X_SERIAL_NUMBER_1 0x05
66 #define ADXL38X_SERIAL_NUMBER_2 0x06
67 #define ADXL38X_SERIAL_NUMBER_3 0x07
68 #define ADXL38X_SERIAL_NUMBER_4 0x08
69 #define ADXL38X_SERIAL_NUMBER_5 0x09
70 #define ADXL38X_SERIAL_NUMBER_6 0x0A
71 #define ADXL38X_DEV_DELTA_Q_X 0x0B
72 #define ADXL38X_DEV_DELTA_Q_Y 0x0C
73 #define ADXL38X_DEV_DELTA_Q_Z 0x0D
74 #define ADXL38X_DEV_DELTA_F0_X 0x0E
75 #define ADXL38X_DEV_DELTA_F0_Y 0x0F
76 #define ADXL38X_DEV_DELTA_F0_Z 0x10
77 #define ADXL38X_STATUS0 0x11
78 #define ADXL38X_STATUS1 0x12
79 #define ADXL38X_STATUS2 0x13
80 #define ADXL38X_STATUS3 0x14
81 #define ADXL38X_XDATA_H 0x15
82 #define ADXL38X_XDATA_L 0x16
83 #define ADXL38X_YDATA_H 0x17
84 #define ADXL38X_YDATA_L 0x18
85 #define ADXL38X_ZDATA_H 0x19
86 #define ADXL38X_ZDATA_L 0x1A
87 #define ADXL38X_TDATA_H 0x1B
88 #define ADXL38X_TDATA_L 0x1C
89 #define ADXL38X_FIFO_DATA 0x1D
90 #define ADXL38X_FIFO_STATUS0 0x1E
91 #define ADXL38X_FIFO_STATUS1 0x1F
92 #define ADXL38X_MISC0 0x20
93 #define ADXL38X_MISC1 0x21
94 #define ADXL38X_SENS_DSM 0x24
95 #define ADXL38X_CLK_CTRL 0x25
96 #define ADXL38X_OP_MODE 0x26
97 #define ADXL38X_DIG_EN 0x27
98 #define ADXL38X_SAR_I2C 0x28
99 #define ADXL38X_NVM_CTL 0x29
100 #define ADXL38X_REG_RESET 0x2A
101 #define ADXL38X_INT0_MAP0 0x2B
102 #define ADXL38X_INT0_MAP1 0x2C
103 #define ADXL38X_INT1_MAP0 0x2D
104 #define ADXL38X_INT1_MAP1 0x2E
105 #define ADXL38X_TEST_EN 0x2F
106 #define ADXL38X_FIFO_CFG0 0x30
107 #define ADXL38X_FIFO_CFG1 0x31
108 #define ADXL38X_SPT_CFG0 0x32
109 #define ADXL38X_SPT_CFG1 0x33
110 #define ADXL38X_SPT_CFG2 0x34
111 #define ADXL38X_SYNC_CFG 0x35
112 #define ADXL38X_PDM_CFG 0x36
113 #define ADXL38X_ACT_INACT_CTL 0x37
114 #define ADXL38X_SNSR_AXIS_EN 0x38
115 #define ADXL38X_THRESH_ACT_H 0x39
116 #define ADXL38X_THRESH_ACT_L 0x3A
117 #define ADXL38X_TIME_ACT_H 0x3B
118 #define ADXL38X_TIME_ACT_M 0x3C
119 #define ADXL38X_TIME_ACT_L 0x3D
120 #define ADXL38X_THRESH_INACT_H 0x3E
121 #define ADXL38X_THRESH_INACT_L 0x3F
122 #define ADXL38X_TIME_INACT_H 0x40
123 #define ADXL38X_TIME_INACT_M 0x41
124 #define ADXL38X_TIME_INACT_L 0x42
125 #define ADXL38X_TAP_THRESH 0x43
126 #define ADXL38X_TAP_DUR 0x44
127 #define ADXL38X_TAP_LATENT 0x45
128 #define ADXL38X_TAP_WINDOW 0x46
129 #define ADXL38X_TAP_CFG 0x47
130 #define ADXL38X_OR_CFG 0x48
131 #define ADXL38X_TRIG_CFG 0x49
132 #define ADXL38X_X_SAR_OFFSET 0x4A
133 #define ADXL38X_Y_SAR_OFFSET 0x4B
134 #define ADXL38X_Z_SAR_OFFSET 0x4C
135 #define ADXL38X_X_DSM_OFFSET 0x4D
136 #define ADXL38X_Y_DSM_OFFSET 0x4E
137 #define ADXL38X_Z_DSM_OFFSET 0x4F
138 #define ADXL38X_FILTER 0x50
139 #define ADXL38X_USER_TEMP_SENS_0 0x55
140 #define ADXL38X_USER_TEMP_SENS_1 0x56
141 #define ADXL38X_MISO 0x58
142 #define ADXL38X_SOUT0 0x59
143 #define ADXL38X_MCLK 0x5A
144 #define ADXL38X_BCLK 0x5B
145 #define ADXL38X_FSYNC 0x5C
146 #define ADXL38X_INT0 0x5D
147 #define ADXL38X_INT1 0x5E
150 #define ADXL38X_RESET_ZERO 0x00
151 #define ADXL38X_RESET_DEVID_AD 0xAD
152 #define ADXL38X_RESET_DEVID_MST 0x1D
153 #define ADXL38X_RESET_PART_ID 0x17
154 #define ADXL38X_RESET_PART_ID_REV_ID 0xC1
155 #define ADXL38X_RESET_STATUS0 0x80
156 #define ADXL38X_RESET_STATUS2 0x04
157 #define ADXL38X_RESET_INT0_MAP0 0x80
158 #define ADXL38X_RESET_INT1_MAP1 0x80
159 #define ADXL38X_RESET_SPT_CFG1 0x08
160 #define ADXL38X_RESET_SPT_CFG2 0x1A
163 #define ADXL38X_MASK_RANGE 0xC0
164 #define ADXL38X_MASK_OP_MODE 0x0F
165 #define ADXL38X_MASK_CHEN_DIG_EN 0xF0
166 #define ADXL38X_NEG_ACC_MSK NO_OS_GENMASK(31, 16)
167 #define ADXL38X_SLF_TST_CTRL_MSK 0xE0
168 #define ADXL38X_FIFOCFG_FIFOMODE_MSK 0x30
171 #define ADXL38X_RESET_CODE 0x52
172 #define ADXL38X_RESET_STATUS 0x80000400
182 #define ADXL380_ACC_SCALE_FACTOR_GEE_MUL (int64_t) 1333
190 #define ADXL382_ACC_SCALE_FACTOR_GEE_MUL (int64_t) 5000
192 #define ADXL38X_ACC_SCALE_FACTOR_GEE_DIV (int32_t) 10000000
201 #define ADXL38X_TEMP_OFFSET (int32_t) 295
202 #define ADXL38X_TEMP_SCALE_NUM (int32_t) 102
203 #define ADXL38X_TEMP_SCALE_DEN (int32_t) 10
212 #define ADXL380_ACC_SENSITIVITY (int32_t) 7500
219 #define ADXL382_ACC_SENSITIVITY (int32_t) 2000
223 #define ADXL380_XY_ST_LIMIT_MIN 29
224 #define ADXL380_Z_ST_LIMIT_MIN 27
225 #define ADXL380_XY_ST_LIMIT_MAX 50
226 #define ADXL380_Z_ST_LIMIT_MAX 32
228 #define ADXL382_XY_ST_LIMIT_MIN 31
229 #define ADXL382_Z_ST_LIMIT_MIN 26
230 #define ADXL382_XY_ST_LIMIT_MAX 42
231 #define ADXL382_Z_ST_LIMIT_MAX 34
233 #define ADXL38X_ST_LIMIT_DENOMINATOR 10
412 uint16_t size, uint8_t *read_data);
414 uint16_t size, uint8_t *write_data);
442 bool st_force,
bool st_dir);
448 uint16_t *raw_y, uint16_t *raw_z);
455 uint16_t *raw_x, uint16_t *raw_y,
456 uint16_t *raw_z, uint16_t *raw_temp);
464 bool *st_x,
bool *st_y,
bool *st_z);
468 bool chIDEnable,
bool readReset);
adxl38x_comm_type
Definition: adxl38x.h:247
#define ADXL38X_RESET_DEVID_MST
Definition: adxl38x.h:152
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:142
@ ADXL382_RANGE_15G
Definition: adxl38x.h:258
#define ADXL38X_RESET_CODE
Definition: adxl38x.h:171
@ ADXL38X_MODE_HP_SERIAL_VLP_OP
Definition: adxl38x.h:282
#define ADXL38X_FIFO_CFG1
Definition: adxl38x.h:107
@ ADXL38X_MODE_VLP
Definition: adxl38x.h:273
Header file of ADXL38X Driver.
enum adxl38x_comm_type comm_type
Definition: adxl38x.h:364
@ ADXL38X_I2C_COMM
Definition: adxl38x.h:249
uint8_t OVER_RANGE
Definition: adxl38x.h:386
#define ADXL38X_DEVID_MST
Definition: adxl38x.h:61
struct _adxl38x_sts_reg_flags fields
Definition: adxl38x.h:403
enum adxl38x_id dev_type
Definition: adxl38x.h:343
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:100
@ ADXL38X_MODE_LP_SERIAL_ULP_OP
Definition: adxl38x.h:275
int64_t no_os_div_s64_rem(int64_t dividend, int32_t divisor, int32_t *remainder)
uint32_t value
Definition: adxl38x.h:404
uint8_t FIFO_OVR
Definition: adxl38x.h:394
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
#define ADXL38X_MISC0
Definition: adxl38x.h:92
uint8_t DOUBLE_TAP
Definition: adxl38x.h:384
@ ADXL38X_CH_EN_Z
Definition: adxl38x.h:294
uint8_t NVM_BUSY_STATUS
Definition: adxl38x.h:399
#define ADXL380_ACC_SCALE_FACTOR_GEE_MUL
Definition: adxl38x.h:182
@ ADXL382_RANGE_60G
Definition: adxl38x.h:262
#define ADXL38X_SLF_TST_CTRL_MSK
Definition: adxl38x.h:167
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
#define ADXL38X_ACC_SCALE_FACTOR_GEE_DIV
Definition: adxl38x.h:192
struct no_os_spi_desc * spi_desc
Definition: adxl38x.h:327
Definition: adxl38x.h:369
@ ADXL38X_FIFO_NORMAL
Definition: adxl38x.h:309
@ ADXL38X_MODE_HP_SERIAL_ULP_OP
Definition: adxl38x.h:281
#define ADXL382_Z_ST_LIMIT_MIN
Definition: adxl38x.h:229
union adxl38x_comm_desc com_desc
Definition: adxl38x.h:345
uint8_t ACT
Definition: adxl38x.h:388
Header file of SPI Interface.
#define ADXL382_ACC_SENSITIVITY
Definition: adxl38x.h:219
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:672
uint8_t NVM_IRQ
Definition: adxl38x.h:390
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:963
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
#define ADXL38X_DEVID_AD
Definition: adxl38x.h:60
@ ADXL38X_CH_EN_ZT
Definition: adxl38x.h:298
#define ADXL382_XY_ST_LIMIT_MAX
Definition: adxl38x.h:230
@ ADXL38X_MODE_LP_SERIAL_VLP_OP
Definition: adxl38x.h:276
#define ADXL38X_PART_ID
Definition: adxl38x.h:62
@ ADXL38X_MODE_RBW
Definition: adxl38x.h:277
#define ADXL38X_STATUS0
Definition: adxl38x.h:77
int adxl38x_get_sts_reg(struct adxl38x_dev *dev, union adxl38x_sts_reg_flags *status_flags)
Reads the status registers.
Definition: adxl38x.c:472
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:452
@ ADXL38X_FIFO_DISABLE
Definition: adxl38x.h:308
uint8_t NVM_CRC_DONE
Definition: adxl38x.h:378
#define ADXL38X_TEMP_SCALE_DEN
Definition: adxl38x.h:203
#define ADXL38X_SPI_WRITE
Definition: adxl38x.h:57
@ ADXL38X_MODE_HRT_SND
Definition: adxl38x.h:271
#define ADXL38X_TEMP_SCALE_NUM
Definition: adxl38x.h:202
Definition: ad9361_util.h:75
Header file for adxl372 Driver.
uint8_t FIFO_READY
Definition: adxl38x.h:396
uint8_t DATA_READY
Definition: adxl38x.h:371
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:902
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:587
@ ADXL38X_CH_DSB_ALL
Definition: adxl38x.h:290
#define ADXL380_XY_ST_LIMIT_MIN
Definition: adxl38x.h:223
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:672
@ ADXL38X_FIFO_STREAM
Definition: adxl38x.h:310
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 NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:55
int adxl38x_get_deviceID(struct adxl38x_dev *dev, enum adxl38x_id *devID)
Gets the current device type.
Definition: adxl38x.c:396
uint8_t NVM_ECC_DONE
Definition: adxl38x.h:381
uint8_t RESERVED2
Definition: adxl38x.h:372
@ ADXL38X_MODE_STDBY
Definition: adxl38x.h:270
enum adxl38x_op_mode op_mode
Definition: adxl38x.h:351
#define ADXL38X_DIG_EN
Definition: adxl38x.h:97
int adxl38x_soft_reset(struct adxl38x_dev *dev)
Performs a soft reset of the device.
Definition: adxl38x.c:276
ADXL38X Device structure.
Definition: adxl38x.h:341
int adxl38x_get_sts_reg(struct adxl38x_dev *dev, union adxl38x_sts_reg_flags *status_flags)
Reads the status registers.
Definition: adxl38x.c:472
int adxl38x_get_deviceID(struct adxl38x_dev *dev, enum adxl38x_id *devID)
Gets the current device type.
Definition: adxl38x.c:396
#define ADXL38X_RESET_PART_ID
Definition: adxl38x.h:153
@ ADXL38X_MODE_ULP
Definition: adxl38x.h:272
enum adxl38x_range range
Definition: adxl38x.h:349
struct no_os_i2c_desc * i2c_desc
Definition: adxl38x.h:325
@ ADXL38X_CH_EN_YZ
Definition: adxl38x.h:295
uint8_t RESERVED1
Definition: adxl38x.h:376
int64_t no_os_div_s64(int64_t dividend, int32_t divisor)
@ ADXL380_RANGE_4G
Definition: adxl38x.h:257
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:902
uint8_t UV_FLAG
Definition: adxl38x.h:374
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
int adxl38x_soft_reset(struct adxl38x_dev *dev)
Performs a soft reset of the device.
Definition: adxl38x.c:276
#define ADXL38X_RESET_ZERO
Definition: adxl38x.h:150
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
@ ADXL38X_FIFO_TRIGGER
Definition: adxl38x.h:311
#define ADXL38X_REG_RESET
Definition: adxl38x.h:100
@ ADXL38X_CH_EN_XYZT
Definition: adxl38x.h:300
#define ADXL38X_OP_MODE
Definition: adxl38x.h:96
uint8_t comm_buff[320]
Definition: adxl38x.h:353
uint8_t NVM_CRC_ERR
Definition: adxl38x.h:377
@ ADXL38X_MODE_HP
Definition: adxl38x.h:280
#define ADXL38X_TEMP_OFFSET
Definition: adxl38x.h:201
#define ADXL372_REG_WRITE(x)
Definition: adxl372.h:122
#define ADXL382_ACC_SCALE_FACTOR_GEE_MUL
Definition: adxl38x.h:190
@ ID_ADXL380
Definition: adxl38x.h:243
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:75
uint8_t UV_FLAG_STICKY
Definition: adxl38x.h:375
adxl38x_ch_select
Definition: adxl38x.h:289
#define ADXL38X_MASK_RANGE
Definition: adxl38x.h:163
int32_t adxl372_i2c_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adxl372_i2c.c:53
@ ADXL38X_MODE_RBW_SERIAL_ULP_OP
Definition: adxl38x.h:278
@ ADXL38X_CH_EN_XY
Definition: adxl38x.h:293
int32_t adxl372_spi_reg_read(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Definition: adxl372_spi.c:53
Definition: adxl372.h:368
@ ADXL382_RANGE_30G
Definition: adxl38x.h:260
Definition: adxl38x.h:402
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:351
#define ADXL38X_FIFOCFG_FIFOMODE_MSK
Definition: adxl38x.h:168
uint8_t OVER_RANGE_STICKY
Definition: adxl38x.h:387
int64_t integer
Definition: adxl38x.h:319
#define ADXL38X_SPI_READ
Definition: adxl38x.h:56
#define ADXL38X_XDATA_H
Definition: adxl38x.h:81
#define ADXL38X_SNSR_AXIS_EN
Definition: adxl38x.h:114
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:142
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:113
int adxl38x_get_range(struct adxl38x_dev *dev, enum adxl38x_range *range_val)
Gets the current range setting of the device.
Definition: adxl38x.c:372
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:496
#define ADXL38X_ST_LIMIT_DENOMINATOR
Definition: adxl38x.h:233
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:765
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:327
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
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:537
#define ADXL38X_YDATA_H
Definition: adxl38x.h:83
int32_t adxl372_i2c_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adxl372_i2c.c:82
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:173
adxl38x_id
Definition: adxl38x.h:242
#define ADXL38X_FIFO_CFG0
Definition: adxl38x.h:106
@ ADXL380_RANGE_8G
Definition: adxl38x.h:259
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:107
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:537
Data format in which the values are converted.
Definition: adxl38x.h:318
uint8_t RESERVED
Definition: adxl38x.h:380
uint8_t FIFO_FULL
Definition: adxl38x.h:393
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
@ ADXL38X_SPI_COMM
Definition: adxl38x.h:248
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:963
Header file of I2C Interface.
#define ADXL380_Z_ST_LIMIT_MAX
Definition: adxl38x.h:226
int adxl38x_get_range(struct adxl38x_dev *dev, enum adxl38x_range *range_val)
Gets the current range setting of the device.
Definition: adxl38x.c:372
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:496
#define ADXL38X_NEG_ACC_MSK
Definition: adxl38x.h:166
@ ID_ADXL382
Definition: adxl38x.h:244
enum adxl38x_comm_type comm_type
Definition: adxl38x.h:347
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:304
struct no_os_spi_init_param spi_init
Definition: adxl38x.h:334
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:765
struct no_os_i2c_init_param i2c_init
Definition: adxl38x.h:332
ADXL38X Range (OP MODE[7:6]).
#define ADXL382_Z_ST_LIMIT_MAX
Definition: adxl38x.h:231
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
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
uint8_t TRIPLE_TAP
Definition: adxl38x.h:385
int adxl38x_remove(struct adxl38x_dev *dev)
Free the resources allocated by the init function.
Definition: adxl38x.c:256
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:304
#define ADXL38X_RESET_DEVID_AD
Definition: adxl38x.h:151
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:120
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:70
#define NULL
Definition: wrapper.h:64
uint8_t PARITY_ERR_STICKY
Definition: adxl38x.h:392
#define ADXL38X_TDATA_H
Definition: adxl38x.h:87
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:173
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
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:587
enum adxl38x_id dev_type
Definition: adxl38x.h:366
int32_t adxl372_spi_reg_write(struct adxl372_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Definition: adxl372_spi.c:79
uint8_t NVM_DONE
Definition: adxl38x.h:398
#define ADXL380_ACC_SENSITIVITY
Definition: adxl38x.h:212
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
@ ADXL38X_CH_EN_YZT
Definition: adxl38x.h:299
@ ADXL38X_MODE_RBW_SERIAL_VLP_OP
Definition: adxl38x.h:279
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:113
@ ADXL38X_CH_EN_X
Definition: adxl38x.h:291
int32_t fractional
Definition: adxl38x.h:320
@ ADXL38X_CH_EN_T
Definition: adxl38x.h:297
struct no_os_i2c_desc * i2c_desc
Definition: adxl372.h:372
#define ADXL380_XY_ST_LIMIT_MAX
Definition: adxl38x.h:225
@ ADXL38X_CH_EN_XYZ
Definition: adxl38x.h:296
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:424
int adxl38x_remove(struct adxl38x_dev *dev)
Free the resources allocated by the init function.
Definition: adxl38x.c:256
uint8_t FIFO_WATERMARK
Definition: adxl38x.h:395
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:103
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:327
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
uint16_t no_os_get_unaligned_be16(uint8_t *buf)
uint8_t INACT
Definition: adxl38x.h:389
#define ADXL382_XY_ST_LIMIT_MIN
Definition: adxl38x.h:228
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:75
@ ADXL38X_MODE_LP
Definition: adxl38x.h:274
uint8_t EFUSE_BUSY_REGERR_STICKY
Definition: adxl38x.h:397
@ ADXL38X_CH_EN_Y
Definition: adxl38x.h:292
Definition: adxl38x.h:330
uint8_t NVM_ECC_DET
Definition: adxl38x.h:379
Error macro definition for ARM Compiler.
Definition: adxl38x.h:323
Structure holding the parameters for ADXL38X device initialization.
Definition: adxl38x.h:360
int adxl38x_set_range(struct adxl38x_dev *dev, enum adxl38x_range range_val)
Sets the measurement range register value.
Definition: adxl38x.c:351
#define ADXL38X_ZDATA_H
Definition: adxl38x.h:85
#define ADXL38X_MASK_OP_MODE
Definition: adxl38x.h:164
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:424
#define ADXL380_Z_ST_LIMIT_MIN
Definition: adxl38x.h:224
struct no_os_spi_desc * spi_desc
Definition: adxl372.h:370
uint8_t SINGLE_TAP
Definition: adxl38x.h:383
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
#define ADXL38X_MASK_CHEN_DIG_EN
Definition: adxl38x.h:165
#define ADXL372_REG_READ(x)
Definition: adxl372.h:121
@ ADXL380_RANGE_16G
Definition: adxl38x.h:261
union adxl38x_comm_init_param comm_init
Definition: adxl38x.h:362