Go to the documentation of this file.
41 #define AD4858_R1B (1ul << 16)
42 #define AD4858_R2B (2ul << 16)
43 #define AD4858_R3B (3ul << 16)
44 #define AD4858_R4B (4ul << 16)
45 #define AD4858_LEN(x) ((x) >> 16)
46 #define AD4858_ADDR(x) ((x) & 0xFFFF)
49 #define AD4858_REG_INTERFACE_CONFIG_A (AD4858_R1B | 0x00)
50 #define AD4858_REG_INTERFACE_CONFIG_B (AD4858_R1B | 0x01)
51 #define AD4858_REG_DEVICE_CONFIG (AD4858_R1B | 0x02)
52 #define AD4858_REG_CHIP_TYPE (AD4858_R1B | 0x03)
53 #define AD4858_REG_PRODUCT_ID_L (AD4858_R1B | 0x04)
54 #define AD4858_REG_PRODUCT_ID_H (AD4858_R1B | 0x05)
55 #define AD4858_REG_CHIP_GRADE (AD4858_R1B | 0x06)
56 #define AD4858_REG_SCRATCH_PAD (AD4858_R1B | 0x0A)
57 #define AD4858_REG_SPI_REV (AD4858_R1B | 0x0B)
58 #define AD4858_REG_VENDOR_L (AD4858_R1B | 0x0C)
59 #define AD4858_REG_VENDOR_H (AD4858_R1B | 0x0D)
60 #define AD4858_REG_STREAM_MODE (AD4858_R1B | 0x0E)
61 #define AD4858_REG_TRANSFER_CONFIG (AD4858_R1B | 0x0F)
62 #define AD4858_REG_INTERFACE_CONFIG_C (AD4858_R1B | 0x10)
63 #define AD4858_REG_INTERFACE_STATUS_A (AD4858_R1B | 0x11)
64 #define AD4858_REG_SPI_CONFIG_D (AD4858_R1B | 0x14)
65 #define AD4858_REG_DEVICE_STATUS (AD4858_R1B | 0x20)
66 #define AD4858_REG_CH_OR_STATUS (AD4858_R1B | 0x21)
67 #define AD4858_REG_CH_UR_STATUS (AD4858_R1B | 0x22)
68 #define AD4858_REG_REGMAP_CRC (AD4858_R2B | 0x23)
69 #define AD4858_REG_DEVICE_CTRL (AD4858_R1B | 0x25)
70 #define AD4858_REG_PACKET (AD4858_R1B | 0x26)
71 #define AD4858_REG_OVERSAMPLE (AD4858_R1B | 0x27)
72 #define AD4858_REG_SEAMLESS_HDR (AD4858_R1B | 0x28)
73 #define AD4858_REG_CH_SLEEP (AD4858_R1B | 0x29)
74 #define AD4858_REG_CH_SOFTSPAN(chn) (AD4858_R1B | (0x2A + (0x12 * chn)))
75 #define AD4858_REG_CH_OFFSET(chn) (AD4858_R3B | (0x2B + (0x12 * chn)))
76 #define AD4858_REG_CH_GAIN(chn) (AD4858_R2B | (0x2E + (0x12 * chn)))
77 #define AD4858_REG_CH_PHASE(chn) (AD4858_R2B | (0x30 + (0x12 * chn)))
78 #define AD4858_REG_CH_OR(chn) (AD4858_R3B | (0x32 + (0x12 * chn)))
79 #define AD4858_REG_CH_UR(chn) (AD4858_R3B | (0x35 + (0x12 * chn)))
80 #define AD4858_REG_CH_TESTPAT(chn) (AD4858_R4B | (0x38 + (0x12 * chn)))
83 #define AD4858_SW_RESET_MSK NO_OS_BIT(7) | NO_OS_BIT(0)
84 #define AD4858_SDO_ENABLE_MSK NO_OS_BIT(4)
85 #define AD4858_ADDR_ASCENSION_MSK NO_OS_BIT(5)
88 #define AD4858_SINGLE_INST_MSK NO_OS_BIT(7)
91 #define AD4858_OPERATING_MODES_MSK NO_OS_GENMASK(1,0)
92 #define AD4858_STATUS_BIT0_MSK NO_OS_BIT(4)
93 #define AD4858_STATUS_BIT1_MSK NO_OS_BIT(5)
94 #define AD4858_STATUS_BIT2_MSK NO_OS_BIT(6)
95 #define AD4858_STATUS_BIT3_MSK NO_OS_BIT(7)
98 #define AD4858_KEEP_STRM_LEN_MSK NO_OS_BIT(2)
101 #define AD4858_ACTIVE_INF_MODE_MSK NO_OS_GENMASK(3,2)
102 #define AD4858_CRC_ENABLE_MSK NO_OS_GENMASK(7,6)
105 #define AD4858_ADDR_INVALID_ERR_MSK NO_OS_BIT(0)
106 #define AD4858_WR_TO_RD_ONLY_ERR_MSK NO_OS_BIT(2)
107 #define AD4858_CRC_ERR_MSK NO_OS_BIT(3)
108 #define AD4858_CLK_COUNT_ERR_MSK NO_OS_BIT(4)
109 #define AD4858_NOT_READY_ERR_MSK NO_OS_BIT(7)
112 #define AD4858_CSDO_ON_SDO_MSK NO_OS_BIT(0)
115 #define AD4858_TEST_PATTERN_MSK NO_OS_BIT(2)
116 #define AD4858_PACKET_FORMAT_MSK NO_OS_GENMASK(1,0)
119 #define AD4858_OS_ENABLE_MSK NO_OS_BIT(7)
120 #define AD4858_OS_RATIO_MSK NO_OS_GENMASK(3,0)
123 #define AD4858_SOFTSPAN_MSK NO_OS_GENMASK(3,0)
126 #define AD4858_OR_UR_STATUS_MSK_16_BIT NO_OS_BIT(7)
127 #define AD4858_CHN_ID_MSK_16_BIT NO_OS_GENMASK(6,4)
128 #define AD4858_SOFTSPAN_ID_MSK_16_BIT NO_OS_GENMASK(3,0)
131 #define AD4858_OR_UR_STATUS_MSK_20_BIT NO_OS_BIT(3)
132 #define AD4858_CHN_ID_MSK_20_BIT NO_OS_GENMASK(2,0)
133 #define AD4858_SOFTSPAN_ID_MSK_20_BIT NO_OS_GENMASK(7,4)
136 #define AD4858_RAW_DATA_MSK_20_BIT NO_OS_GENMASK(23,4)
137 #define AD4858_RAW_DATA_MSK_EVEN_20_BIT NO_OS_GENMASK(23,4)
138 #define AD4858_RAW_DATA_MSK_ODD_20_BIT NO_OS_GENMASK(19,0)
141 #define AD4858_REG_RD_BIT_MSK NO_OS_BIT(7)
142 #define AD4858_PRODUCT_ID_L 0x60
143 #define AD4857_PRODUCT_ID_L 0x61
144 #define AD4856_PRODUCT_ID_L 0x62
145 #define AD4855_PRODUCT_ID_L 0x63
146 #define AD4854_PRODUCT_ID_L 0x64
147 #define AD4853_PRODUCT_ID_L 0x65
148 #define AD4852_PRODUCT_ID_L 0x66
149 #define AD4851_PRODUCT_ID_L 0x67
150 #define AD4858I_PRODUCT_ID_L 0x6F
151 #define AD485X_PRODUCT_ID_H 0x00
152 #define AD4858_NUM_CHANNELS 8
153 #define AD4858_DEF_CHN_SOFTSPAN 0xf
154 #define AD4858_DEF_CHN_OFFSET 0x0
155 #define AD4858_DEF_CHN_GAIN 0x8000
156 #define AD4858_DEF_CHN_PHASE 0x0
157 #define AD4858_DEF_CHN_OR 0x7ffff0
158 #define AD4858_DEF_CHN_UR 0x800000
bool addr_ascension_enable
Definition: ad4858.h:316
@ AD4858_NUM_OF_SPI_DATA_MODES
Definition: ad4858.h:221
void no_os_memswap64(void *buf, uint32_t bytes, uint32_t step)
uint16_t chn_gain[AD4858_NUM_CHANNELS]
Definition: ad4858.h:383
uint32_t timeout
Definition: ad413x.c:49
ad4858_packet_format
Packet formats.
Definition: ad4858.h:252
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int ad4858_set_chn_ur_limit(struct ad4858_dev *dev, uint8_t chn, uint32_t ur_limit)
Set channel underrange (UR) limit.
Definition: ad4858.c:591
enum ad4858_chn_softspan chn_softspan[AD4858_NUM_CHANNELS]
Definition: ad4858.h:330
int ad4858_set_packet_format(struct ad4858_dev *dev, enum ad4858_packet_format packet_format)
Set packet format.
Definition: ad4858.c:336
@ AD4858_RANGE_NEG_25_0V_TO_POS_25_0V
Definition: ad4858.h:277
int ad4858_set_operating_mode(struct ad4858_dev *dev, enum ad4858_operating_mode mode)
Set the device operating mode.
Definition: ad4858.c:178
#define AD4858_SDO_ENABLE_MSK
Definition: ad4858.h:84
uint16_t chn_phase[AD4858_NUM_CHANNELS]
Definition: ad4858.h:336
int ad4858_set_config_interface_mode(struct ad4858_dev *dev)
Set device config interface mode.
Definition: ad4858.c:230
ad4858_ch_seamless_hdr
Enable/diable seamless high dynamic range.
Definition: ad4858.h:199
bool osr_enable
Definition: ad4858.h:371
ADC conversion data structure.
Definition: ad4858.h:287
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
@ AD4858_OSR_64
Definition: ad4858.h:234
int ad4858_set_data_interface_mode(struct ad4858_dev *dev)
Set device data interface mode.
Definition: ad4858.c:262
@ AD4858_DATA_INTERFACE_MODE
Definition: ad4858.h:210
int ad4858_read_data(struct ad4858_dev *dev, struct ad4858_conv_data *data)
Read ADC data (for all channels).
Definition: ad4858.c:802
uint16_t chn_ur[AD4858_NUM_CHANNELS]
Definition: ad4858.h:389
ad4858_prod_id
AD485X Product ID.
Definition: ad4858.h:164
@ AD4858_OSR_512
Definition: ad4858.h:237
Header file of SPI Interface.
#define AD4858_REG_RD_BIT_MSK
Definition: ad4858.h:141
@ AD4858_SEAMLESS_HDR_ENABLE
Definition: ad4858.h:201
@ AD4858I_PROD_ID_L
Definition: ad4858.h:173
@ AD4858_PACKET_24_BIT
Definition: ad4858.h:255
#define AD4858_REG_INTERFACE_CONFIG_A
Definition: ad4858.h:49
@ AD4858_RANGE_0V_TO_20_0V
Definition: ad4858.h:274
uint32_t raw[AD4858_NUM_CHANNELS]
Definition: ad4858.h:289
int ad4858_convst(struct ad4858_dev *dev)
Toggle the CNV pin to start a conversion.
Definition: ad4858.c:614
#define AD4858_SOFTSPAN_ID_MSK_16_BIT
Definition: ad4858.h:128
int ad4858_enable_ch_sleep(struct ad4858_dev *dev, uint8_t chn, enum ad4858_ch_sleep_value sleep_status)
Enable/Disable channel sleep.
Definition: ad4858.c:400
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
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
@ AD4858_RANGE_NEG_5_0V_TO_POS_5_0V
Definition: ad4858.h:267
int ad4858_set_chn_ur_limit(struct ad4858_dev *dev, uint8_t chn, uint32_t ur_limit)
Set channel underrange (UR) limit.
Definition: ad4858.c:591
@ AD4858_RANGE_0V_TO_2_5V
Definition: ad4858.h:264
Header file of Delay functions.
@ AD4858_OSR_256
Definition: ad4858.h:236
@ AD4858_SLEEP_ENABLE
Definition: ad4858.h:192
uint8_t chn_id[AD4858_NUM_CHANNELS]
Definition: ad4858.h:293
int ad4858_set_chn_or_limit(struct ad4858_dev *dev, uint8_t chn, uint32_t or_limit)
Set channel overrange (OR) limit.
Definition: ad4858.c:566
#define AD4858_SINGLE_INST_MSK
Definition: ad4858.h:88
@ AD4858_OSR_1024
Definition: ad4858.h:238
@ AD4852_PROD_ID_L
Definition: ad4858.h:171
#define AD4858_REG_OVERSAMPLE
Definition: ad4858.h:71
#define AD4858_REG_SEAMLESS_HDR
Definition: ad4858.h:72
enum ad4858_prod_id prod_id
Definition: ad4858.h:314
struct no_os_spi_init_param * spi_init
Definition: ad4858.h:304
Definition: ad9361_util.h:69
int ad4858_set_chn_offset(struct ad4858_dev *dev, uint8_t chn, uint32_t offset)
Set channel offset.
Definition: ad4858.c:490
AD4858 device descriptor.
Definition: ad4858.h:351
enum ad4858_operating_mode operating_mode
Definition: ad4858.h:367
@ AD4858_OSR_8192
Definition: ad4858.h:241
struct no_os_gpio_init_param * gpio_cmos_lvds
Definition: ad4858.h:308
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
@ AD4854_PROD_ID_L
Definition: ad4858.h:169
int ad4858_set_packet_format(struct ad4858_dev *dev, enum ad4858_packet_format packet_format)
Set packet format.
Definition: ad4858.c:336
struct no_os_gpio_desc * gpio_busy
Definition: ad4858.h:361
@ AD4858_OSR_16384
Definition: ad4858.h:242
enum ad4858_ch_seamless_hdr chn_seamless_hdr[AD4858_NUM_CHANNELS]
Definition: ad4858.h:344
int ad4858_spi_data_read(struct ad4858_dev *dev, struct ad4858_conv_data *data)
Read ADC conversion data over SPI.
Definition: ad4858.c:672
#define AD4858_REG_CH_SOFTSPAN(chn)
Definition: ad4858.h:74
@ AD4858_SEAMLESS_HDR_DISABLE
Definition: ad4858.h:200
struct no_os_gpio_init_param * gpio_busy
Definition: ad4858.h:312
#define AD4858_CHN_ID_MSK_16_BIT
Definition: ad4858.h:127
ad4858_interface_mode
Interface modes.
Definition: ad4858.h:208
@ AD4857_PROD_ID_L
Definition: ad4858.h:166
@ AD4858_NUM_OF_OP_MODES
Definition: ad4858.h:183
@ AD4858_OSR_16
Definition: ad4858.h:232
@ AD4858_OSR_2048
Definition: ad4858.h:239
#define AD4858_REG_CH_GAIN(chn)
Definition: ad4858.h:76
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
@ AD4858_OSR_2
Definition: ad4858.h:229
int ad4858_remove(struct ad4858_dev *dev)
Remove an AD4858 device (free memory allocated by ad4858_init function).
Definition: ad4858.c:1136
#define AD4858_DEF_CHN_OR
Definition: ad4858.h:157
#define AD4858_OS_ENABLE_MSK
Definition: ad4858.h:119
#define AD4858_RAW_DATA_MSK_20_BIT
Definition: ad4858.h:136
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
#define AD4858_REG_CH_UR(chn)
Definition: ad4858.h:79
#define AD4858_ADDR(x)
Definition: ad4858.h:46
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
bool addr_ascension_enable
Definition: ad4858.h:365
#define AD4858_SOFTSPAN_MSK
Definition: ad4858.h:123
int ad4858_reg_read(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t *reg_val)
Read device register.
Definition: ad4858.c:95
uint32_t chn_offset[AD4858_NUM_CHANNELS]
Definition: ad4858.h:381
uint16_t chn_phase[AD4858_NUM_CHANNELS]
Definition: ad4858.h:385
@ AD4858_OSR_32768
Definition: ad4858.h:243
@ AD4858_NUM_OF_INTF_MODES
Definition: ad4858.h:211
enum ad4858_packet_format packet_format
Definition: ad4858.h:375
int ad4858_set_config_interface_mode(struct ad4858_dev *dev)
Set device config interface mode.
Definition: ad4858.c:230
#define AD4858_REG_SPI_CONFIG_D
Definition: ad4858.h:64
int ad4858_reg_write(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t reg_val)
Write device register.
Definition: ad4858.c:47
@ AD4858_LOW_POWER_OP_MODE
Definition: ad4858.h:182
enum ad4858_chn_softspan chn_softspan[AD4858_NUM_CHANNELS]
Definition: ad4858.h:379
struct no_os_gpio_init_param * gpio_cnv
Definition: ad4858.h:310
int ad4858_set_osr_ratio(struct ad4858_dev *dev, enum ad4858_osr_ratio osr_ratio)
Set OSR ratio.
Definition: ad4858.c:310
#define AD4858_OR_UR_STATUS_MSK_16_BIT
Definition: ad4858.h:126
#define AD485X_PRODUCT_ID_H
Definition: ad4858.h:151
@ AD4855_PROD_ID_L
Definition: ad4858.h:168
@ AD4858_RANGE_0V_TO_25_0V
Definition: ad4858.h:276
#define AD4858_REG_DEVICE_CONFIG
Definition: ad4858.h:51
@ AD4858_OSR_65536
Definition: ad4858.h:244
@ AD4858_CONFIG_INTERFACE_MODE
Definition: ad4858.h:209
#define AD4858_REG_INTERFACE_CONFIG_B
Definition: ad4858.h:50
enum ad4858_ch_sleep_value chn_sleep_value[AD4858_NUM_CHANNELS]
Definition: ad4858.h:393
int ad4858_set_spi_data_mode(struct ad4858_dev *dev, enum ad4858_spi_data_mode mode)
Set the SPI data mode.
Definition: ad4858.c:204
@ AD4858_RANGE_0V_TO_5_0V
Definition: ad4858.h:266
@ AD4858_RANGE_NEG_2_5V_TO_POS_2_5V
Definition: ad4858.h:265
enum ad4858_osr_ratio osr_ratio
Definition: ad4858.h:373
uint32_t no_os_get_unaligned_be24(uint8_t *buf)
bool or_ur_status[AD4858_NUM_CHANNELS]
Definition: ad4858.h:291
uint16_t chn_or[AD4858_NUM_CHANNELS]
Definition: ad4858.h:338
int ad4858_reg_read(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t *reg_val)
Read device register.
Definition: ad4858.c:95
int ad4858_reg_mask(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t reg_val)
Update specific register bits of an input register.
Definition: ad4858.c:151
@ AD4858_NUM_OF_SOFTSPAN
Definition: ad4858.h:280
@ AD4851_PROD_ID_L
Definition: ad4858.h:172
#define AD4858_DEF_CHN_OFFSET
Definition: ad4858.h:154
@ AD4858_RANGE_0V_TO_12_5V
Definition: ad4858.h:272
@ AD4858_PACKET_32_BIT
Definition: ad4858.h:256
int ad4858_set_chn_gain(struct ad4858_dev *dev, uint8_t chn, uint16_t gain)
Set channel gain.
Definition: ad4858.c:520
int ad4858_set_chn_softspan(struct ad4858_dev *dev, uint8_t chn, enum ad4858_chn_softspan chn_softspan)
Set channel softspan.
Definition: ad4858.c:462
@ AD4858_RANGE_0V_TO_10_0V
Definition: ad4858.h:270
#define AD4858_DEF_CHN_SOFTSPAN
Definition: ad4858.h:153
bool osr_enable
Definition: ad4858.h:320
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
@ AD4858_NORMAL_OP_MODE
Definition: ad4858.h:181
int ad4858_set_chn_phase(struct ad4858_dev *dev, uint8_t chn, uint16_t phase)
Set channel phase.
Definition: ad4858.c:543
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
bool no_os_is_big_endian(void)
#define AD4858_SW_RESET_MSK
Definition: ad4858.h:83
@ AD4858_RANGE_NEG_12_5V_TO_POS_12_5V
Definition: ad4858.h:273
@ AD4858_OSR_4
Definition: ad4858.h:230
#define AD4858_DEF_CHN_PHASE
Definition: ad4858.h:156
enum ad4858_osr_ratio osr_ratio
Definition: ad4858.h:322
@ AD4858_RANGE_0V_TO_6_25V
Definition: ad4858.h:268
@ AD4858_SINGLE_INSTRUCTION_MODE
Definition: ad4858.h:220
int ad4858_set_chn_gain(struct ad4858_dev *dev, uint8_t chn, uint16_t gain)
Set channel gain.
Definition: ad4858.c:520
@ AD4858_OSR_8
Definition: ad4858.h:231
#define AD4858_OS_RATIO_MSK
Definition: ad4858.h:120
#define AD4858_TEST_PATTERN_MSK
Definition: ad4858.h:115
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ AD4858_PROD_ID_L
Definition: ad4858.h:165
enum ad4858_packet_format packet_format
Definition: ad4858.h:324
#define AD4858_OPERATING_MODES_MSK
Definition: ad4858.h:91
#define AD4858_CHN_ID_MSK_20_BIT
Definition: ad4858.h:132
@ AD4858_RANGE_NEG_6_25V_TO_POS_6_25V
Definition: ad4858.h:269
uint16_t chn_ur[AD4858_NUM_CHANNELS]
Definition: ad4858.h:340
int ad4858_reg_write(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t reg_val)
Write device register.
Definition: ad4858.c:47
int ad4858_reg_mask(struct ad4858_dev *dev, uint32_t reg_addr, uint32_t mask, uint32_t reg_val)
Update specific register bits of an input register.
Definition: ad4858.c:151
#define AD4858_ADDR_ASCENSION_MSK
Definition: ad4858.h:85
struct no_os_gpio_desc * gpio_pd
Definition: ad4858.h:355
@ AD4858_RANGE_NEG_40_0V_TO_POS_40_0V
Definition: ad4858.h:279
int ad4858_set_chn_offset(struct ad4858_dev *dev, uint8_t chn, uint32_t offset)
Set channel offset.
Definition: ad4858.c:490
enum ad4858_prod_id prod_id
Definition: ad4858.h:363
int ad4858_spi_data_read(struct ad4858_dev *dev, struct ad4858_conv_data *data)
Read ADC conversion data over SPI.
Definition: ad4858.c:672
int ad4858_convst(struct ad4858_dev *dev)
Toggle the CNV pin to start a conversion.
Definition: ad4858.c:614
int ad4858_init(struct ad4858_dev **device, struct ad4858_init_param *init_param)
Initialize an AD4858 device structure.
Definition: ad4858.c:1044
@ AD4856_PROD_ID_L
Definition: ad4858.h:167
@ AD4858_OSR_32
Definition: ad4858.h:233
bool use_default_chn_configs
Definition: ad4858.h:328
bool big_endian
Definition: ad4858.h:391
int ad4858_set_spi_data_mode(struct ad4858_dev *dev, enum ad4858_spi_data_mode mode)
Set the SPI data mode.
Definition: ad4858.c:204
int ad4858_remove(struct ad4858_dev *dev)
Remove an AD4858 device (free memory allocated by ad4858_init function).
Definition: ad4858.c:1136
#define AD4858_REG_CH_OR(chn)
Definition: ad4858.h:78
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
#define AD4858_DEF_CHN_UR
Definition: ad4858.h:158
bool test_pattern
Definition: ad4858.h:326
@ AD4858_STREAMING_MODE
Definition: ad4858.h:219
ad4858_operating_mode
Operating modes.
Definition: ad4858.h:180
enum ad4858_operating_mode operating_mode
Definition: ad4858.h:318
#define AD4858_REG_PACKET
Definition: ad4858.h:70
@ AD4853_PROD_ID_L
Definition: ad4858.h:170
uint16_t chn_gain[AD4858_NUM_CHANNELS]
Definition: ad4858.h:334
int ad4858_set_chn_or_limit(struct ad4858_dev *dev, uint8_t chn, uint32_t or_limit)
Set channel overrange (OR) limit.
Definition: ad4858.c:566
#define AD4858_PACKET_FORMAT_MSK
Definition: ad4858.h:116
int ad4858_set_osr_ratio(struct ad4858_dev *dev, enum ad4858_osr_ratio osr_ratio)
Set OSR ratio.
Definition: ad4858.c:310
struct no_os_spi_desc * spi_desc
Definition: ad4858.h:353
ad4858_chn_softspan
Channel softspan.
Definition: ad4858.h:263
#define AD4858_RAW_DATA_MSK_ODD_20_BIT
Definition: ad4858.h:138
@ AD4858_SLEEP_DISABLE
Definition: ad4858.h:191
#define AD4858_SOFTSPAN_ID_MSK_20_BIT
Definition: ad4858.h:133
#define AD4858_REG_CH_SLEEP
Definition: ad4858.h:73
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
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad4858_osr_ratio
OSR ratio values.
Definition: ad4858.h:228
int ad4858_enable_ch_seamless_hdr(struct ad4858_dev *dev, uint8_t chn, enum ad4858_ch_seamless_hdr seamless_hdr_status)
Enable/Disable seamless hdr.
Definition: ad4858.c:431
int ad4858_set_chn_phase(struct ad4858_dev *dev, uint8_t chn, uint16_t phase)
Set channel phase.
Definition: ad4858.c:543
struct no_os_gpio_desc * gpio_cmos_lvds
Definition: ad4858.h:357
#define AD4858_OR_UR_STATUS_MSK_20_BIT
Definition: ad4858.h:131
@ AD4858_NUM_OF_OSR_RATIO
Definition: ad4858.h:245
int ad4858_read_data(struct ad4858_dev *dev, struct ad4858_conv_data *data)
Read ADC data (for all channels).
Definition: ad4858.c:802
ad4858_ch_sleep_value
Enable/diable sleep.
Definition: ad4858.h:190
@ AD4858_PACKET_16_BIT
Definition: ad4858.h:253
#define AD4858_REG_PRODUCT_ID_H
Definition: ad4858.h:54
@ AD4858_RANGE_0V_TO_40_0V
Definition: ad4858.h:278
#define AD4858_REG_CH_PHASE(chn)
Definition: ad4858.h:77
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
int ad4858_perform_conv(struct ad4858_dev *dev)
Perform ADC conversion.
Definition: ad4858.c:637
#define AD4858_DEF_CHN_GAIN
Definition: ad4858.h:155
Header file of GPIO Interface.
struct no_os_gpio_desc * gpio_cnv
Definition: ad4858.h:359
int ad4858_soft_reset(struct ad4858_dev *dev)
Perform an AD4858 software reset.
Definition: ad4858.c:821
enum ad4858_spi_data_mode spi_data_mode
Definition: ad4858.h:369
#define AD4858_LEN(x)
Definition: ad4858.h:45
@ AD4858_OSR_4096
Definition: ad4858.h:240
int ad4858_init(struct ad4858_dev **device, struct ad4858_init_param *init_param)
Initialize an AD4858 device structure.
Definition: ad4858.c:1044
int ad4858_enable_test_pattern(struct ad4858_dev *dev, bool test_pattern)
Enable/Disable test pattern on ADC data output.
Definition: ad4858.c:375
int ad4858_set_data_interface_mode(struct ad4858_dev *dev)
Set device data interface mode.
Definition: ad4858.c:262
@ AD4858_OSR_128
Definition: ad4858.h:235
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)
int ad4858_set_chn_softspan(struct ad4858_dev *dev, uint8_t chn, enum ad4858_chn_softspan chn_softspan)
Set channel softspan.
Definition: ad4858.c:462
AD4858 init parameters structure used for initializing the ad4858_dev.
Definition: ad4858.h:302
int ad4858_soft_reset(struct ad4858_dev *dev)
Perform an AD4858 software reset.
Definition: ad4858.c:821
#define AD4858_RAW_DATA_MSK_EVEN_20_BIT
Definition: ad4858.h:137
ad4858_spi_data_mode
SPI data modes.
Definition: ad4858.h:218
#define AD4858_REG_CH_OFFSET(chn)
Definition: ad4858.h:75
Header file of utility functions.
#define AD4858_REG_PRODUCT_ID_L
Definition: ad4858.h:53
#define AD4858_CSDO_ON_SDO_MSK
Definition: ad4858.h:112
int ad4858_enable_test_pattern(struct ad4858_dev *dev, bool test_pattern)
Enable/Disable test pattern on ADC data output.
Definition: ad4858.c:375
int ad4858_enable_osr(struct ad4858_dev *dev, bool osr_status)
Enable OSR.
Definition: ad4858.c:285
@ AD4858_RANGE_NEG_10_0V_TO_POS_10_0V
Definition: ad4858.h:271
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
int ad4858_enable_ch_seamless_hdr(struct ad4858_dev *dev, uint8_t chn, enum ad4858_ch_seamless_hdr seamless_hdr_status)
Enable/Disable seamless hdr.
Definition: ad4858.c:431
struct no_os_gpio_init_param * gpio_pd
Definition: ad4858.h:306
uint32_t softspan_id[AD4858_NUM_CHANNELS]
Definition: ad4858.h:295
int ad4858_perform_conv(struct ad4858_dev *dev)
Perform ADC conversion.
Definition: ad4858.c:637
int ad4858_enable_ch_sleep(struct ad4858_dev *dev, uint8_t chn, enum ad4858_ch_sleep_value sleep_status)
Enable/Disable channel sleep.
Definition: ad4858.c:400
int ad4858_enable_osr(struct ad4858_dev *dev, bool osr_status)
Enable OSR.
Definition: ad4858.c:285
@ AD4858_RANGE_NEG_20_0V_TO_POS_20_0V
Definition: ad4858.h:275
bool test_pattern
Definition: ad4858.h:377
enum ad4858_ch_seamless_hdr chn_seamless_hdr[AD4858_NUM_CHANNELS]
Definition: ad4858.h:395
uint16_t chn_or[AD4858_NUM_CHANNELS]
Definition: ad4858.h:387
uint32_t chn_offset[AD4858_NUM_CHANNELS]
Definition: ad4858.h:332
#define AD4858_NUM_CHANNELS
Definition: ad4858.h:152
int ad4858_set_operating_mode(struct ad4858_dev *dev, enum ad4858_operating_mode mode)
Set the device operating mode.
Definition: ad4858.c:178
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
enum ad4858_ch_sleep_value chn_sleep_value[AD4858_NUM_CHANNELS]
Definition: ad4858.h:342
@ AD4858_PACKET_20_BIT
Definition: ad4858.h:254
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