Go to the documentation of this file.
54 #define ADXL362_WRITE_REG 0x0A
55 #define ADXL362_READ_REG 0x0B
56 #define ADXL362_WRITE_FIFO 0x0D
59 #define ADXL362_REG_DEVID_AD 0x00
60 #define ADXL362_REG_DEVID_MST 0x01
61 #define ADXL362_REG_PARTID 0x02
62 #define ADXL362_REG_REVID 0x03
63 #define ADXL362_REG_XDATA 0x08
64 #define ADXL362_REG_YDATA 0x09
65 #define ADXL362_REG_ZDATA 0x0A
66 #define ADXL362_REG_STATUS 0x0B
67 #define ADXL362_REG_FIFO_L 0x0C
68 #define ADXL362_REG_FIFO_H 0x0D
69 #define ADXL362_REG_XDATA_L 0x0E
70 #define ADXL362_REG_XDATA_H 0x0F
71 #define ADXL362_REG_YDATA_L 0x10
72 #define ADXL362_REG_YDATA_H 0x11
73 #define ADXL362_REG_ZDATA_L 0x12
74 #define ADXL362_REG_ZDATA_H 0x13
75 #define ADXL362_REG_TEMP_L 0x14
76 #define ADXL362_REG_TEMP_H 0x15
77 #define ADXL362_REG_SOFT_RESET 0x1F
78 #define ADXL362_REG_THRESH_ACT_L 0x20
79 #define ADXL362_REG_THRESH_ACT_H 0x21
80 #define ADXL362_REG_TIME_ACT 0x22
81 #define ADXL362_REG_THRESH_INACT_L 0x23
82 #define ADXL362_REG_THRESH_INACT_H 0x24
83 #define ADXL362_REG_TIME_INACT_L 0x25
84 #define ADXL362_REG_TIME_INACT_H 0x26
85 #define ADXL362_REG_ACT_INACT_CTL 0x27
86 #define ADXL362_REG_FIFO_CTL 0x28
87 #define ADXL362_REG_FIFO_SAMPLES 0x29
88 #define ADXL362_REG_INTMAP1 0x2A
89 #define ADXL362_REG_INTMAP2 0x2B
90 #define ADXL362_REG_FILTER_CTL 0x2C
91 #define ADXL362_REG_POWER_CTL 0x2D
92 #define ADXL362_REG_SELF_TEST 0x2E
95 #define ADXL362_STATUS_ERR_USER_REGS (1 << 7)
96 #define ADXL362_STATUS_AWAKE (1 << 6)
97 #define ADXL362_STATUS_INACT (1 << 5)
98 #define ADXL362_STATUS_ACT (1 << 4)
99 #define ADXL362_STATUS_FIFO_OVERRUN (1 << 3)
100 #define ADXL362_STATUS_FIFO_WATERMARK (1 << 2)
101 #define ADXL362_STATUS_FIFO_RDY (1 << 1)
102 #define ADXL362_STATUS_DATA_RDY (1 << 0)
105 #define ADXL362_ACT_INACT_CTL_LINKLOOP(x) (((x) & 0x3) << 4)
106 #define ADXL362_ACT_INACT_CTL_INACT_REF (1 << 3)
107 #define ADXL362_ACT_INACT_CTL_INACT_EN (1 << 2)
108 #define ADXL362_ACT_INACT_CTL_ACT_REF (1 << 1)
109 #define ADXL362_ACT_INACT_CTL_ACT_EN (1 << 0)
112 #define ADXL362_MODE_DEFAULT 0
113 #define ADXL362_MODE_LINK 1
114 #define ADXL362_MODE_LOOP 3
117 #define ADXL362_FIFO_CTL_AH (1 << 3)
118 #define ADXL362_FIFO_CTL_FIFO_TEMP (1 << 2)
119 #define ADXL362_FIFO_CTL_FIFO_MODE(x) (((x) & 0x3) << 0)
122 #define ADXL362_FIFO_DISABLE 0
123 #define ADXL362_FIFO_OLDEST_SAVED 1
124 #define ADXL362_FIFO_STREAM 2
125 #define ADXL362_FIFO_TRIGGERED 3
128 #define ADXL362_INTMAP1_INT_LOW (1 << 7)
129 #define ADXL362_INTMAP1_AWAKE (1 << 6)
130 #define ADXL362_INTMAP1_INACT (1 << 5)
131 #define ADXL362_INTMAP1_ACT (1 << 4)
132 #define ADXL362_INTMAP1_FIFO_OVERRUN (1 << 3)
133 #define ADXL362_INTMAP1_FIFO_WATERMARK (1 << 2)
134 #define ADXL362_INTMAP1_FIFO_READY (1 << 1)
135 #define ADXL362_INTMAP1_DATA_READY (1 << 0)
138 #define ADXL362_INTMAP2_INT_LOW (1 << 7)
139 #define ADXL362_INTMAP2_AWAKE (1 << 6)
140 #define ADXL362_INTMAP2_INACT (1 << 5)
141 #define ADXL362_INTMAP2_ACT (1 << 4)
142 #define ADXL362_INTMAP2_FIFO_OVERRUN (1 << 3)
143 #define ADXL362_INTMAP2_FIFO_WATERMARK (1 << 2)
144 #define ADXL362_INTMAP2_FIFO_READY (1 << 1)
145 #define ADXL362_INTMAP2_DATA_READY (1 << 0)
148 #define ADXL362_FILTER_CTL_RANGE(x) (((x) & 0x3) << 6)
149 #define ADXL362_FILTER_CTL_RES (1 << 5)
150 #define ADXL362_FILTER_CTL_HALF_BW (1 << 4)
151 #define ADXL362_FILTER_CTL_EXT_SAMPLE (1 << 3)
152 #define ADXL362_FILTER_CTL_ODR(x) (((x) & 0x7) << 0)
155 #define ADXL362_RANGE_2G 0
156 #define ADXL362_RANGE_4G 1
157 #define ADXL362_RANGE_8G 2
160 #define ADXL362_ODR_12_5_HZ 0
161 #define ADXL362_ODR_25_HZ 1
162 #define ADXL362_ODR_50_HZ 2
163 #define ADXL362_ODR_100_HZ 3
164 #define ADXL362_ODR_200_HZ 4
165 #define ADXL362_ODR_400_HZ 5
168 #define ADXL362_POWER_CTL_RES (1 << 7)
169 #define ADXL362_POWER_CTL_EXT_CLK (1 << 6)
170 #define ADXL362_POWER_CTL_LOW_NOISE(x) (((x) & 0x3) << 4)
171 #define ADXL362_POWER_CTL_WAKEUP (1 << 3)
172 #define ADXL362_POWER_CTL_AUTOSLEEP (1 << 2)
173 #define ADXL362_POWER_CTL_MEASURE(x) (((x) & 0x3) << 0)
176 #define ADXL362_NOISE_MODE_NORMAL 0
177 #define ADXL362_NOISE_MODE_LOW 1
178 #define ADXL362_NOISE_MODE_ULTRALOW 2
181 #define ADXL362_MEASURE_STANDBY 0
182 #define ADXL362_MEASURE_ON 2
185 #define ADXL362_SELF_TEST_ST (1 << 0)
188 #define ADXL362_DEVICE_AD 0xAD
189 #define ADXL362_DEVICE_MST 0x1D
190 #define ADXL362_PART_ID 0xF2
193 #define ADXL362_RESET_KEY 0x52
232 uint16_t register_value,
233 uint8_t register_address,
234 uint8_t bytes_number);
239 uint8_t register_address,
240 uint8_t bytes_number);
245 uint16_t bytes_number);
280 uint16_t water_mark_lvl,
281 uint8_t en_temp_read);
int iio_adxl355_trigger_init(struct adxl355_iio_trig **iio_trig, struct adxl355_iio_trig_init_param *init_param)
Initialize ADXL355 device trigger.
Definition: iio_adxl355_trig.c:148
char name[TRIG_MAX_NAME_SIZE+1]
Definition: iio_adxl355.h:74
struct iio_trigger adxl355_iio_trigger_desc
Definition: iio_adxl355_trig.c:62
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:108
void adxl362_software_reset(struct adxl362_dev *dev)
Resets the device via SPI communication bus.
Definition: adxl362.c:194
#define ADXL362_REG_TEMP_L
Definition: adxl362.h:75
#define ADXL362_REG_THRESH_ACT_L
Definition: adxl362.h:78
void adxl362_fifo_setup(struct adxl362_dev *dev, uint8_t mode, uint16_t water_mark_lvl, uint8_t en_temp_read)
Configures the FIFO feature.
Definition: adxl362.c:388
void adxl362_setup_activity_detection(struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl362.c:423
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:82
#define ADXL362_POWER_CTL_MEASURE(x)
Definition: adxl362.h:173
ADXL362 Device structure.
Definition: adxl362.h:203
Structure describing a callback to be registered.
Definition: no_os_irq.h:133
float adxl362_read_temperature(struct adxl362_dev *dev)
Reads the temperature of the device.
Definition: adxl362.c:355
void iio_adxl355_trigger_remove(struct adxl355_iio_trig *trig)
Free the resources allocated by iio_adxl355_trigger_init().
Definition: iio_adxl355_trig.c:227
Header file of SPI Interface.
#define ADXL362_MEASURE_ON
Definition: adxl362.h:182
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:82
#define ADXL362_REG_THRESH_INACT_L
Definition: adxl362.h:81
no_os_spi_desc * spi_desc
Definition: adxl362.h:205
Structure holding channel attributess.
Definition: iio_types.h:95
struct iio_desc ** iio_desc
Definition: iio_adxl355.h:71
#define ADXL362_WRITE_FIFO
Definition: adxl362.h:56
Definition: iio_adxl355.h:77
#define ADXL362_ACT_INACT_CTL_INACT_EN
Definition: adxl362.h:107
Definition: ad9361_util.h:75
struct iio_trigger adxl355_iio_software_trigger_desc
Definition: iio_adxl355_trig.c:76
void adxl362_set_output_rate(struct adxl362_dev *dev, uint8_t out_rate)
Selects the Output Data Rate of the device.
Definition: adxl362.c:275
void adxl362_set_register_value(struct adxl362_dev *dev, uint16_t register_value, uint8_t register_address, uint8_t bytes_number)
Writes data into a register.
Definition: adxl362.c:114
void adxl362_get_xyz(struct adxl362_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl362.c:303
void adxl362_get_xyz(struct adxl362_dev *dev, int16_t *x, int16_t *y, int16_t *z)
Reads the 3-axis raw data from the accelerometer.
Definition: adxl362.c:303
#define ADXL362_RESET_KEY
Definition: adxl362.h:193
#define ADXL362_FIFO_CTL_FIFO_TEMP
Definition: adxl362.h:118
no_os_spi_init_param spi_init
Definition: adxl362.h:216
void adxl362_get_g_xyz(struct adxl362_dev *dev, float *x, float *y, float *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl362.c:329
#define ADXL362_PART_ID
Definition: adxl362.h:190
#define ADXL362_FILTER_CTL_RANGE(x)
Definition: adxl362.h:148
struct no_os_irq_init_param * irq_init_param
Definition: iio_adxl355.h:73
const char * name
Definition: iio_types.h:134
#define ADXL362_REG_POWER_CTL
Definition: adxl362.h:91
#define TRIG_MAX_NAME_SIZE
Definition: iio_trigger.h:53
void adxl362_get_fifo_value(struct adxl362_dev *dev, uint8_t *buffer, uint16_t bytes_number)
Reads multiple bytes from the device's FIFO buffer.
Definition: adxl362.c:169
float adxl362_read_temperature(struct adxl362_dev *dev)
Reads the temperature of the device.
Definition: adxl362.c:355
#define ADXL362_REG_FIFO_CTL
Definition: adxl362.h:86
Definition: iio_adxl355.h:70
Structure holding the parameters for ADXL362 device initialization.
Definition: adxl362.h:214
#define ADXL362_ACT_INACT_CTL_ACT_EN
Definition: adxl362.h:109
uint32_t irq_ctrl_id
Definition: no_os_irq.h:102
Structure holding pointers to show and store functions.
Definition: iio_types.h:132
#define ADXL362_REG_SOFT_RESET
Definition: adxl362.h:77
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
Header file of IIO ADXL355 Driver.
void adxl362_get_register_value(struct adxl362_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: adxl362.c:140
void(* callback)(void *context)
Definition: no_os_irq.h:135
struct no_os_irq_ctrl_desc * irq_ctrl
Definition: iio_adxl355.h:72
#define ADXL362_REG_ACT_INACT_CTL
Definition: adxl362.h:85
void adxl362_set_register_value(struct adxl362_dev *dev, uint16_t register_value, uint8_t register_address, uint8_t bytes_number)
Writes data into a register.
Definition: adxl362.c:114
void adxl362_get_register_value(struct adxl362_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: adxl362.c:140
int32_t adxl362_init(struct adxl362_dev **device, struct adxl362_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl362.c:61
int iio_process_trigger_type(struct iio_desc *desc, char *trigger_name)
Searches for trigger name and processes the trigger based on its type (sync or async with the interru...
Definition: iio.c:994
uint8_t selected_range
Definition: adxl362.h:207
void adxl362_get_g_xyz(struct adxl362_dev *dev, float *x, float *y, float *z)
Reads the 3-axis raw data from the accelerometer and converts it to g.
Definition: adxl362.c:329
#define ADXL362_REG_PARTID
Definition: adxl362.h:61
Definition: iio_adxl355.h:84
#define ADXL362_FIFO_CTL_FIFO_MODE(x)
Definition: adxl362.h:119
int iio_adxl355_software_trigger_init(struct adxl355_iio_trig **iio_trig, struct adxl355_iio_sw_trig_init_param *init_param)
Initialize ADXL355 software trigger.
Definition: iio_adxl355_trig.c:201
void adxl362_fifo_setup(struct adxl362_dev *dev, uint8_t mode, uint16_t water_mark_lvl, uint8_t en_temp_read)
Configures the FIFO feature.
Definition: adxl362.c:388
Definition: iio_types.h:225
void adxl362_get_fifo_value(struct adxl362_dev *dev, uint8_t *buffer, uint16_t bytes_number)
Reads multiple bytes from the device's FIFO buffer.
Definition: adxl362.c:169
uint32_t irq_ctrl_id
Definition: no_os_irq.h:118
void adxl362_setup_inactivity_detection(struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl362.c:470
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
void adxl362_setup_activity_detection(struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint8_t time)
Configures activity detection.
Definition: adxl362.c:423
@ NO_OS_EVT_GPIO
Definition: no_os_irq.h:68
void adxl362_set_range(struct adxl362_dev *dev, uint8_t g_range)
Selects the measurement range.
Definition: adxl362.c:242
@ NO_OS_IRQ_EDGE_RISING
Definition: no_os_irq.h:79
void adxl362_set_output_rate(struct adxl362_dev *dev, uint8_t out_rate)
Selects the Output Data Rate of the device.
Definition: adxl362.c:275
#define ADXL362_REG_TIME_INACT_L
Definition: adxl362.h:83
int32_t adxl362_init(struct adxl362_dev **device, struct adxl362_init_param init_param)
Initializes communication with the device and checks if the part is present by reading the device id.
Definition: adxl362.c:61
void adxl362_set_power_mode(struct adxl362_dev *dev, uint8_t pwr_mode)
Places the device into standby/measure mode.
Definition: adxl362.c:212
#define ADXL362_WRITE_REG
Definition: adxl362.h:54
int32_t adxl362_remove(struct adxl362_dev *dev)
Free the resources allocated by adxl362_init().
Definition: adxl362.c:93
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:70
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:144
Header file of ADXL362 Driver.
void adxl362_set_power_mode(struct adxl362_dev *dev, uint8_t pwr_mode)
Places the device into standby/measure mode.
Definition: adxl362.c:212
@ NO_OS_GPIO_IRQ
Definition: no_os_irq.h:84
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:51
#define ADXL362_REG_FIFO_SAMPLES
Definition: adxl362.h:87
bool is_synchronous
Definition: iio_types.h:228
#define ADXL362_REG_FILTER_CTL
Definition: adxl362.h:90
void adxl362_setup_inactivity_detection(struct adxl362_dev *dev, uint8_t ref_or_abs, uint16_t threshold, uint16_t time)
Configures inactivity detection.
Definition: adxl362.c:470
#define ADXL362_ACT_INACT_CTL_ACT_REF
Definition: adxl362.h:108
void adxl362_set_range(struct adxl362_dev *dev, uint8_t g_range)
Selects the measurement range.
Definition: adxl362.c:242
void adxl362_software_reset(struct adxl362_dev *dev)
Resets the device via SPI communication bus.
Definition: adxl362.c:194
#define ADXL362_FILTER_CTL_ODR(x)
Definition: adxl362.h:152
int32_t no_os_irq_trigger_level_set(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, enum no_os_irq_trig_level trig)
Set interrupt trigger level.
Definition: no_os_irq.c:128
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:155
#define ADXL362_READ_REG
Definition: adxl362.h:55
int32_t adxl362_remove(struct adxl362_dev *dev)
Free the resources allocated by adxl362_init().
Definition: adxl362.c:93
#define ADXL362_REG_TIME_ACT
Definition: adxl362.h:80
#define ADXL362_ACT_INACT_CTL_INACT_REF
Definition: adxl362.h:106
#define ADXL362_REG_XDATA_L
Definition: adxl362.h:69
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112