Go to the documentation of this file.
52 #define ADXRS290_ADI_ID 0xAD
53 #define ADXRS290_MEMS_ID 0x1D
54 #define ADXRS290_DEV_ID 0x92
57 #define ADXRS290_REG_ADI_ID 0x00
58 #define ADXRS290_REG_MEMS_ID 0x01
59 #define ADXRS290_REG_DEV_ID 0x02
60 #define ADXRS290_REG_REV_ID 0x03
61 #define ADXRS290_REG_SN0 0x04
62 #define ADXRS290_REG_SN1 0x05
63 #define ADXRS290_REG_SN2 0x06
64 #define ADXRS290_REG_SN3 0x07
65 #define ADXRS290_REG_DATAX0 0x08
66 #define ADXRS290_REG_DATAX1 0x09
67 #define ADXRS290_REG_DATAY0 0x0A
68 #define ADXRS290_REG_DATAY1 0x0B
69 #define ADXRS290_REG_TEMP0 0x0C
70 #define ADXRS290_REG_TEMP1 0x0D
72 #define ADXRS290_REG_POWER_CTL 0x10
73 #define ADXRS290_REG_FILTER 0x11
74 #define ADXRS290_REG_DATA_READY 0x12
76 #define ADXRS290_READ NO_OS_BIT(7)
77 #define ADXRS290_TSM NO_OS_BIT(0)
78 #define ADXRS290_MEASUREMENT NO_OS_BIT(1)
79 #define ADXRS290_DATA_RDY_OUT NO_OS_BIT(0)
80 #define ADXRS290_SYNC_MASK 0x03
81 #define ADXRS290_SYNC(x) (x) & ADXRS290_SYNC_MASK
82 #define ADXRS290_LPF_MASK 0x07
83 #define ADXRS290_LPF(x) (x) & ADXRS290_LPF_MASK
84 #define ADXRS290_HPF_MASK 0xF0
85 #define ADXRS290_HPF(x) ((x) & ADXRS290_HPF_MASK ) >> 4
87 #define ADXRS290_READ_REG(reg) (ADXRS290_READ | (reg))
89 #define ADXRS290_MAX_TRANSITION_TIME_MS 100
90 #define ADXRS290_CHANNEL_COUNT 3
91 #define ADXRS290_CHANNEL_MASK 0x07
int32_t adxrs290_get_lpf(struct adxrs290_dev *dev, enum adxrs290_lpf *lpf)
Get the low-pass filter pole location.
Definition: adxrs290.c:120
int32_t adxrs290_init(struct adxrs290_dev **device, const struct adxrs290_init_param *init_param)
Definition: adxrs290.c:333
#define ADXRS290_REG_FILTER
Definition: adxrs290.h:73
#define ADXRS290_REG_DATAX1
Definition: adxrs290.h:66
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int32_t adxrs290_set_active_channels(struct adxrs290_dev *dev, uint32_t mask)
Set the ADXRS290 active channels.
Definition: adxrs290.c:293
@ ADXRS290_LPF_160HZ
Definition: adxrs290.h:127
#define ADXRS290_TSM
Definition: adxrs290.h:77
enum adxrs290_mode mode
Definition: adxrs290.h:163
struct no_os_spi_desc * spi_desc
Definition: adxrs290.h:176
int32_t adxrs290_get_rate_data(struct adxrs290_dev *dev, enum adxrs290_channel ch, int16_t *rate)
Get the Gyro data channels.
Definition: adxrs290.c:203
int32_t adxrs290_set_hpf(struct adxrs290_dev *dev, enum adxrs290_hpf hpf)
Set the low-pass filter pole location.
Definition: adxrs290.c:181
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
@ ADXRS290_LPF_320HZ
Definition: adxrs290.h:126
Header file of SPI Interface.
@ ADXRS290_HPF_0HZ087
Definition: adxrs290.h:144
@ ADXRS290_HPF_0HZ022
Definition: adxrs290.h:142
@ ADXRS290_HPF_0HZ700
Definition: adxrs290.h:147
@ ADXRS290_HPF_2HZ800
Definition: adxrs290.h:149
int32_t no_os_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: no_os_gpio.c:221
@ ADXRS290_LPF_40HZ
Definition: adxrs290.h:130
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:50
int32_t adxrs290_get_burst_data(struct adxrs290_dev *dev, int16_t *burst_data, uint8_t *ch_cnt)
Get the burst data.
Definition: adxrs290.c:253
int32_t adxrs290_reg_read(struct adxrs290_dev *dev, uint8_t address, uint8_t *data)
Read device register.
Definition: adxrs290.c:55
@ ADXRS290_LPF_480HZ
Definition: adxrs290.h:125
Definition: ad9361_util.h:69
@ ADXRS290_MODE_MEASUREMENT
Definition: adxrs290.h:104
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
struct no_os_gpio_desc * gpio_sync
Definition: adxrs290.h:178
int32_t no_os_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: no_os_gpio.c:124
enum ad7616_mode mode
Definition: ad7616.h:226
struct no_os_spi_init_param spi_init
Definition: adxrs290.h:159
@ ADXRS290_HPF_ALL_PASS
Definition: adxrs290.h:140
int32_t adxrs290_set_hpf(struct adxrs290_dev *dev, enum adxrs290_hpf hpf)
Set the low-pass filter pole location.
Definition: adxrs290.c:181
#define ADXRS290_HPF(x)
Definition: adxrs290.h:85
@ ADXRS290_CHANNEL_Y
Definition: adxrs290.h:115
int32_t adxrs290_set_lpf(struct adxrs290_dev *dev, enum adxrs290_lpf lpf)
Set the low-pass filter pole location.
Definition: adxrs290.c:140
@ ADXRS290_HPF_1HZ400
Definition: adxrs290.h:148
int32_t adxrs290_get_temp_data(struct adxrs290_dev *dev, int16_t *temp)
Get the temperature data.
Definition: adxrs290.c:227
@ ADXRS290_LPF_80HZ
Definition: adxrs290.h:128
@ ADXRS290_HPF_0HZ175
Definition: adxrs290.h:145
@ ADXRS290_HPF_11HZ30
Definition: adxrs290.h:150
#define ADXRS290_CHANNEL_COUNT
Definition: adxrs290.h:90
@ ADXRS290_LPF_20HZ
Definition: adxrs290.h:132
@ ADXRS290_LPF_56HZ6
Definition: adxrs290.h:129
@ ADXRS290_CHANNEL_X
Definition: adxrs290.h:113
@ ADXRS290_HPF_0HZ011
Definition: adxrs290.h:141
int32_t adxrs290_get_burst_data(struct adxrs290_dev *dev, int16_t *burst_data, uint8_t *ch_cnt)
Get the burst data.
Definition: adxrs290.c:253
int32_t adxrs290_set_active_channels(struct adxrs290_dev *dev, uint32_t mask)
Set the ADXRS290 active channels.
Definition: adxrs290.c:293
int32_t adxrs290_get_data_ready(struct adxrs290_dev *dev, bool *rdy)
Get the state of data ready.
Definition: adxrs290.c:306
Implementation of ADXRS290 Driver.
#define ADXRS290_DEV_ID
Definition: adxrs290.h:54
int32_t adxrs290_remove(struct adxrs290_dev *dev)
Free memory allocated by adxrs290_setup().
Definition: adxrs290.c:412
int32_t adxrs290_get_temp_data(struct adxrs290_dev *dev, int16_t *temp)
Get the temperature data.
Definition: adxrs290.c:227
int32_t adxrs290_get_rate_data(struct adxrs290_dev *dev, enum adxrs290_channel ch, int16_t *rate)
Get the Gyro data channels.
Definition: adxrs290.c:203
#define ADXRS290_REG_DATA_READY
Definition: adxrs290.h:74
#define ADXRS290_REG_POWER_CTL
Definition: adxrs290.h:72
Device driver initialization structure.
Definition: adxrs290.h:157
int32_t adxrs290_remove(struct adxrs290_dev *dev)
Free memory allocated by adxrs290_setup().
Definition: adxrs290.c:412
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
@ ADXRS290_HPF_0HZ350
Definition: adxrs290.h:146
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
int32_t adxrs290_set_lpf(struct adxrs290_dev *dev, enum adxrs290_lpf lpf)
Set the low-pass filter pole location.
Definition: adxrs290.c:140
Device driver handler.
Definition: adxrs290.h:174
#define ADXRS290_LPF(x)
Definition: adxrs290.h:83
@ ADXRS290_CHANNEL_TEMP
Definition: adxrs290.h:117
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define ADXRS290_CHANNEL_MASK
Definition: adxrs290.h:91
int32_t adxrs290_get_data_ready(struct adxrs290_dev *dev, bool *rdy)
Get the state of data ready.
Definition: adxrs290.c:306
int32_t adxrs290_reg_read(struct adxrs290_dev *dev, uint8_t address, uint8_t *data)
Read device register.
Definition: adxrs290.c:55
int32_t adxrs290_init(struct adxrs290_dev **device, const struct adxrs290_init_param *init_param)
Definition: adxrs290.c:333
@ ADXRS290_LPF_28HZ3
Definition: adxrs290.h:131
#define ADXRS290_REG_DEV_ID
Definition: adxrs290.h:59
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
@ ADXRS290_MODE_STANDBY
Definition: adxrs290.h:102
uint8_t ch_mask
Definition: adxrs290.h:180
int32_t adxrs290_reg_write(struct adxrs290_dev *dev, uint8_t address, uint8_t data)
Write device register.
Definition: adxrs290.c:77
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
int32_t adxrs290_set_op_mode(struct adxrs290_dev *dev, enum adxrs290_mode mode)
Set device operation mode.
Definition: adxrs290.c:91
int32_t adxrs290_reg_write(struct adxrs290_dev *dev, uint8_t address, uint8_t data)
Write device register.
Definition: adxrs290.c:77
#define ADXRS290_REG_DATAX0
Definition: adxrs290.h:65
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
int32_t adxrs290_set_op_mode(struct adxrs290_dev *dev, enum adxrs290_mode mode)
Set device operation mode.
Definition: adxrs290.c:91
int32_t adxrs290_get_hpf(struct adxrs290_dev *dev, enum adxrs290_hpf *hpf)
Get the high-pass filter pole location.
Definition: adxrs290.c:161
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
#define ADXRS290_DATA_RDY_OUT
Definition: adxrs290.h:79
Header file of GPIO Interface.
#define ADXRS290_REG_TEMP1
Definition: adxrs290.h:70
#define ADXRS290_LPF_MASK
Definition: adxrs290.h:82
int32_t adxrs290_get_lpf(struct adxrs290_dev *dev, enum adxrs290_lpf *lpf)
Get the low-pass filter pole location.
Definition: adxrs290.c:120
adxrs290_lpf
Low-Pass filter pole location.
Definition: adxrs290.h:124
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
adxrs290_hpf
High-Pass filter pole location.
Definition: adxrs290.h:139
Header file of utility functions.
enum adxrs290_hpf hpf
Definition: adxrs290.h:167
adxrs290_channel
Channel of teh adxrs290 data rate.
Definition: adxrs290.h:111
int32_t adxrs290_get_hpf(struct adxrs290_dev *dev, enum adxrs290_hpf *hpf)
Get the high-pass filter pole location.
Definition: adxrs290.c:161
#define ADXRS290_HPF_MASK
Definition: adxrs290.h:84
#define ADXRS290_REG_TEMP0
Definition: adxrs290.h:69
struct no_os_gpio_init_param * gpio_sync
Definition: adxrs290.h:161
enum adxrs290_lpf lpf
Definition: adxrs290.h:165
#define ADXRS290_MEASUREMENT
Definition: adxrs290.h:78
adxrs290_mode
Mode of the adxrs290.
Definition: adxrs290.h:100
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
@ ADXRS290_HPF_0HZ044
Definition: adxrs290.h:143
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75