Go to the documentation of this file.
52 #define ADA4250_REG_GAIN_MUX 0x00
53 #define ADA4250_REG_REFBUF_EN 0x01
54 #define ADA4250_REG_RESET 0x02
55 #define ADA4250_REG_SNSR_CAL_VAL 0x04
56 #define ADA4250_REG_SNSR_CAL_CNFG 0x05
57 #define ADA4250_REG_DIE_REV 0x18
58 #define ADA4250_REG_CHIP_ID1 0x19
59 #define ADA4250_REG_CHIP_ID2 0x1a
62 #define ADA4250_GAIN_MUX_MSK NO_OS_GENMASK(2, 0)
63 #define ADA4250_GAIN_MUX(x) no_os_field_prep(ADA4250_GAIN_MUX_MSK, x)
66 #define ADA4250_REFBUF_MSK NO_OS_BIT(0)
67 #define ADA4250_REFBUF(x) no_os_field_prep(ADA4250_REFBUF_MSK, x)
70 #define ADA4250_BUF_ENABLE 0x01
71 #define ADA4250_BUF_DISABLE 0x00
74 #define ADA4250_RESET_MSK NO_OS_BIT(0)
75 #define ADA4250_RESET(x) no_os_field_prep(ADA4250_RESET_MSK, x)
78 #define ADA4250_RESET_ENABLE 0x01
79 #define ADA4250_RESET_DISABLE 0x00
82 #define ADA4250_SNSR_CAL_VAL_MSK NO_OS_GENMASK(7, 0)
83 #define ADA4250_SNSR_CAL_VAL(x) no_os_field_prep(ADA4250_SNSR_CAL_VAL_MSK, x)
86 #define ADA4250_BIAS_SET_MSK NO_OS_GENMASK(3, 2)
87 #define ADA4250_BIAS_SET(x) no_os_field_prep(ADA4250_BIAS_SET_MSK, x)
88 #define ADA4250_RANGE_SET_MSK NO_OS_GENMASK(1, 0)
89 #define ADA4250_RANGE_SET(x) no_os_field_prep(ADA4250_RANGE_SET_MSK, x)
92 #define ADA4250_SPI_WRITE_CMD 0x0
93 #define ADA4250_BUFF_SIZE_BYTES 2
94 #define ADA4250_SPI_READ_CMD NO_OS_BIT(7)
95 #define ADA4250_DIE_REV 0x0
96 #define ADA4250_CHIP_ID 0x4250
99 #define ADA4250_SPI_DUMMY_DATA 0x00
249 uint8_t mask, uint8_t data);
struct no_os_gpio_init_param * gpio_g2_param
Definition: ada4250.h:179
#define ADA4250_RESET_MSK
Definition: ada4250.h:74
int32_t ada4250_set_bias(struct ada4250_dev *dev, enum ada4250_bias bias)
Set current bias for ADA4250.
Definition: ada4250.c:227
@ ADA4250_GAIN_128
Definition: ada4250.h:147
uint32_t timeout
Definition: ad413x.c:49
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
@ ADA4250
Definition: ada4250.h:111
int32_t ada4250_read(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t *data)
Reads data from ada4250 over SPI.
Definition: ada4250.c:76
int32_t ada4250_remove(struct ada4250_dev *dev)
Free resoulces allocated for ADA4250.
Definition: ada4250.c:657
struct no_os_gpio_desc * gpio_slp
Definition: ada4250.h:215
@ ADA4250_BIAS_BANDGAP_REF
Definition: ada4250.h:120
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
ADA4250 Initialization Parameters structure.
Definition: ada4250.h:173
@ ADA4250_RANGE2
Definition: ada4250.h:130
Header file of SPI Interface.
@ ADA4250_POWER_SHUTDOWN
Definition: ada4250.h:166
#define ADA4250_REFBUF(x)
Definition: ada4250.h:67
#define ADA4250_GAIN_MUX_MSK
Definition: ada4250.h:62
enum ada4250_power_mode power_mode
Definition: ada4250.h:230
@ ADA4250_BIAS_AVDD
Definition: ada4250.h:121
struct no_os_spi_desc * spi_desc
Definition: ada4250.h:208
int32_t ada4250_set_offset(struct ada4250_dev *dev, int64_t offset)
Set offset value for ADA4250.
Definition: ada4250.c:304
int32_t ada4250_set_slp_shtdwn_mode(struct ada4250_dev *dev, enum ada4250_power_mode pwrmode)
Set the ADA4250 into sleep or shutdown mode.
Definition: ada4250.c:435
int32_t ada4250_update(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update ADA4250 register.
Definition: ada4250.c:105
#define ADA4250_BUFF_SIZE_BYTES
Definition: ada4250.h:93
bool refbuf_en
Definition: ada4250.h:220
#define ADA4250_RESET(x)
Definition: ada4250.h:75
ada4250_id
Current bias settings.
Definition: ada4250.h:109
struct no_os_gpio_desc * gpio_g2
Definition: ada4250.h:210
Header file of Delay functions.
enum ada4250_bias bias
Definition: ada4250.h:226
int32_t offset_nv
Definition: ada4250.h:197
int32_t ada4250_init(struct ada4250_dev **device, struct ada4250_init_param *init_param)
Initialize the ADA4250 device.
Definition: ada4250.c:515
int32_t ada4250_set_offset(struct ada4250_dev *dev, int64_t offset)
Set offset value for ADA4250.
Definition: ada4250.c:304
#define ADA4250_REG_RESET
Definition: ada4250.h:54
struct no_os_spi_init_param * spi_init
Definition: ada4250.h:177
@ ADA4250_POWER_SLEEP
Definition: ada4250.h:165
int32_t ada4250_write(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t data)
Writes data to ada4250 over SPI.
Definition: ada4250.c:54
Definition: ad9361_util.h:69
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
#define ADA4250_SPI_DUMMY_DATA
Definition: ada4250.h:99
ada4250_power_mode
Power Modes.
Definition: ada4250.h:163
int32_t ada4250_set_bandwidth(struct ada4250_dev *dev, enum ada4250_bandwidth bw)
Set the bandwidth value for ADA4250.
Definition: ada4250.c:362
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
@ ADA4250_RANGE4
Definition: ada4250.h:132
int32_t ada4250_update(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t data)
Update ADA4250 register.
Definition: ada4250.c:105
struct no_os_gpio_desc * gpio_g1
Definition: ada4250.h:211
int32_t ada4250_soft_reset(struct ada4250_dev *dev)
Software reset.
Definition: ada4250.c:160
#define ADA4250_REG_SNSR_CAL_VAL
Definition: ada4250.h:55
#define ADA4250_GAIN_MUX(x)
Definition: ada4250.h:63
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
int32_t ada4250_write(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t data)
Writes data to ada4250 over SPI.
Definition: ada4250.c:54
#define ADA4250_BIAS_SET(x)
Definition: ada4250.h:87
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
ada4250_bandwidth
Bandwidth modes.
Definition: ada4250.h:154
#define ADA4250_BIAS_SET_MSK
Definition: ada4250.h:86
int32_t avdd_v
Definition: ada4250.h:218
@ ADA4250_BANDWIDTH_LOW
Definition: ada4250.h:155
int32_t ada4250_init(struct ada4250_dev **device, struct ada4250_init_param *init_param)
Initialize the ADA4250 device.
Definition: ada4250.c:515
int32_t ada4250_update_desc(struct ada4250_dev *dev)
Update ADA4250 device descriptor.
Definition: ada4250.c:131
@ ADA4250_GAIN_32
Definition: ada4250.h:145
@ ADA4250_GAIN_4
Definition: ada4250.h:142
enum ada4250_bias bias
Definition: ada4250.h:193
#define ADA4250_REG_GAIN_MUX
Definition: ada4250.h:52
struct no_os_gpio_init_param * gpio_g0_param
Definition: ada4250.h:181
enum ada4250_id device_id
Definition: ada4250.h:206
#define ADA4250_SPI_READ_CMD
Definition: ada4250.h:94
int32_t ada4250_set_bias(struct ada4250_dev *dev, enum ada4250_bias bias)
Set current bias for ADA4250.
Definition: ada4250.c:227
bool refbuf_en
Definition: ada4250.h:189
struct no_os_gpio_init_param * gpio_bufen_param
Definition: ada4250.h:183
int32_t ada4250_set_gain(struct ada4250_dev *dev, enum ada4250_gain gain)
Set gain for ADA4250.
Definition: ada4250.c:272
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
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
@ ADA4250_BANDWIDTH_HIGH
Definition: ada4250.h:156
#define ADA4250_SPI_WRITE_CMD
Definition: ada4250.h:92
@ ADA4250_RANGE3
Definition: ada4250.h:131
int32_t ada4250_set_bandwidth(struct ada4250_dev *dev, enum ada4250_bandwidth bw)
Set the bandwidth value for ADA4250.
Definition: ada4250.c:362
ada4250_offset_range
Sensor offset trim range.
Definition: ada4250.h:128
struct no_os_gpio_init_param * gpio_slp
Definition: ada4250.h:184
enum ada4250_gain gain
Definition: ada4250.h:222
struct no_os_gpio_init_param * gpio_bw_param
Definition: ada4250.h:182
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ ADA4250_GAIN_16
Definition: ada4250.h:144
enum ada4250_gain gain
Definition: ada4250.h:191
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
int32_t ada4250_read(struct ada4250_dev *dev, uint8_t reg_addr, uint8_t *data)
Reads data from ada4250 over SPI.
Definition: ada4250.c:76
@ ADA4250_GAIN_8
Definition: ada4250.h:143
ADA4250 Device Descriptor.
Definition: ada4250.h:204
Header file for ada4250 Driver.
int32_t ada4250_set_normal_mode(struct ada4250_dev *dev, bool reconfig)
Sets the ADA4250 into normal mode and reconfigures it according to the user input.
Definition: ada4250.c:468
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
struct no_os_gpio_desc * gpio_shtdwn
Definition: ada4250.h:216
#define ADA4250_RESET_ENABLE
Definition: ada4250.h:78
#define ADA4250_RANGE_SET(x)
Definition: ada4250.h:89
@ ADA4250_GAIN_2
Definition: ada4250.h:141
ada4250_bias
Current bias settings.
Definition: ada4250.h:118
enum ada4250_offset_range offset_range
Definition: ada4250.h:224
@ ADA4230
Definition: ada4250.h:110
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
enum ada4250_bandwidth bandwidth
Definition: ada4250.h:195
int32_t ada4250_set_gain(struct ada4250_dev *dev, enum ada4250_gain gain)
Set gain for ADA4250.
Definition: ada4250.c:272
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
#define ADA4250_REG_REFBUF_EN
Definition: ada4250.h:53
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
struct no_os_gpio_init_param * gpio_shtdwn
Definition: ada4250.h:185
int32_t avdd_v
Definition: ada4250.h:187
int32_t ada4250_set_normal_mode(struct ada4250_dev *dev, bool reconfig)
Sets the ADA4250 into normal mode and reconfigures it according to the user input.
Definition: ada4250.c:468
int32_t ada4250_en_refbuf(struct ada4250_dev *dev, bool refbuf)
Enable/Disable Reference Buffer.
Definition: ada4250.c:198
#define ADA4250_CHIP_ID
Definition: ada4250.h:96
@ ADA4250_BIAS_DISABLE
Definition: ada4250.h:119
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
@ ADA4250_RANGE1
Definition: ada4250.h:129
int32_t ada4250_soft_reset(struct ada4250_dev *dev)
Software reset.
Definition: ada4250.c:160
#define ADA4250_REG_SNSR_CAL_CNFG
Definition: ada4250.h:56
Header file of GPIO Interface.
enum ada4250_id device_id
Definition: ada4250.h:175
struct no_os_gpio_init_param * gpio_g1_param
Definition: ada4250.h:180
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
struct no_os_gpio_desc * gpio_bw
Definition: ada4250.h:213
int32_t ada4250_remove(struct ada4250_dev *dev)
Free resoulces allocated for ADA4250.
Definition: ada4250.c:657
Header file of utility functions.
int32_t ada4250_set_slp_shtdwn_mode(struct ada4250_dev *dev, enum ada4250_power_mode pwrmode)
Set the ADA4250 into sleep or shutdown mode.
Definition: ada4250.c:435
@ ADA4250_GAIN_64
Definition: ada4250.h:146
#define ADA4250_REG_CHIP_ID1
Definition: ada4250.h:58
struct no_os_gpio_desc * gpio_bufen
Definition: ada4250.h:214
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
struct no_os_gpio_desc * gpio_g0
Definition: ada4250.h:212
enum ada4250_bandwidth bandwidth
Definition: ada4250.h:228
ada4250_gain
Gain value.
Definition: ada4250.h:139
@ ADA4250_GAIN_1
Definition: ada4250.h:140
int32_t ada4250_en_refbuf(struct ada4250_dev *dev, bool refbuf)
Enable/Disable Reference Buffer.
Definition: ada4250.c:198
#define ADA4250_REG_CHIP_ID2
Definition: ada4250.h:59
int32_t ada4250_update_desc(struct ada4250_dev *dev)
Update ADA4250 device descriptor.
Definition: ada4250.c:131
int32_t offset_nv
Definition: ada4250.h:232
@ ADA4250_POWER_NORMAL
Definition: ada4250.h:164
chip_id
Definition: ad9172.h:51
#define ADA4250_RANGE_SET_MSK
Definition: ada4250.h:88
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
#define ADA4250_REFBUF_MSK
Definition: ada4250.h:66
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