Go to the documentation of this file.
53 #define AD7606_REG_STATUS 0x01
54 #define AD7606_REG_CONFIG 0x02
55 #define AD7606_REG_RANGE_CH_ADDR(ch) (0x03 + ((ch) >> 1))
56 #define AD7606_REG_BANDWIDTH 0x07
57 #define AD7606_REG_OVERSAMPLING 0x08
58 #define AD7606_REG_GAIN_CH(ch) (0x09 + (ch))
59 #define AD7606_REG_OFFSET_CH(ch) (0x11 + (ch))
60 #define AD7606_REG_PHASE_CH(ch) (0x19 + (ch))
61 #define AD7606_REG_DIGITAL_DIAG_ENABLE 0x21
62 #define AD7606_REG_DIGITAL_DIAG_ERR 0x22
63 #define AD7606_REG_OPEN_DETECT_ENABLE 0x23
64 #define AD7606_REG_OPEN_DETECTED 0x24
65 #define AD7606_REG_AIN_OV_UV_DIAG_ENABLE 0x25
66 #define AD7606_REG_AIN_OV_DIAG_ERROR 0x26
67 #define AD7606_REG_AIN_UV_DIAG_ERROR 0x27
68 #define AD7606_REG_DIAGNOSTIC_MUX_CH(ch) (0x28 + ((ch) >> 1))
69 #define AD7606_REG_OPEN_DETECT_QUEUE 0x2C
70 #define AD7606_REG_CLK_FS_COUNTER 0x2D
71 #define AD7606_REG_CLK_OS_COUNTER 0x2E
72 #define AD7606_REG_ID 0x2F
75 #define AD7606_STATUS_CHANNEL_MSK NO_OS_GENMASK(2,0)
76 #define AD7606_AIN_UV_ERR_MSK NO_OS_BIT(3)
77 #define AD7606_AIN_OV_ERR_MSK NO_OS_BIT(4)
78 #define AD7606_OPEN_DETECTED_MSK NO_OS_BIT(5)
79 #define AD7606_DIGITAL_ERROR_MSK NO_OS_BIT(6)
80 #define AD7606_RESET_DETECT_MSK NO_OS_BIT(7)
83 #define AD7606_CONFIG_OPERATION_MODE_MSK NO_OS_GENMASK(1,0)
84 #define AD7606_CONFIG_DOUT_FORMAT_MSK NO_OS_GENMASK(4,3)
85 #define AD7606_CONFIG_EXT_OS_CLOCK_MSK NO_OS_BIT(5)
86 #define AD7606_CONFIG_STATUS_HEADER_MSK NO_OS_BIT(6)
89 #define AD7606_RANGE_CH_MSK(ch) (NO_OS_GENMASK(3, 0) << (4 * ((ch) % 2)))
90 #define AD7606_RANGE_CH_MODE(ch, mode) \
91 ((NO_OS_GENMASK(3, 0) & mode) << (4 * ((ch) % 2)))
94 #define AD7606_OS_PAD_MSK NO_OS_GENMASK(7,4)
95 #define AD7606_OS_RATIO_MSK NO_OS_GENMASK(3,0)
98 #define AD7606_ID_DEVICE_ID_MSK NO_OS_GENMASK(7,4)
99 #define AD7606_ID_SILICON_REVISION_MSK NO_OS_GENMASK(3,0)
102 #define AD7606_GAIN_MSK NO_OS_GENMASK(5,0)
105 #define AD7606_ROM_CRC_ERR_EN_MSK NO_OS_BIT(0)
106 #define AD7606_MM_CRC_ERR_EN_MSK NO_OS_BIT(1)
107 #define AD7606_INT_CRC_ERR_EN_MSK NO_OS_BIT(2)
108 #define AD7606_SPI_WRITE_ERR_EN_MSK NO_OS_BIT(3)
109 #define AD7606_SPI_READ_ERR_EN_MSK NO_OS_BIT(4)
110 #define AD7606_BUSY_STUCK_HIGH_ERR_EN_MSK NO_OS_BIT(5)
111 #define AD7606_CLK_FS_OS_COUNTER_EN_MSK NO_OS_BIT(6)
112 #define AD7606_INTERFACE_CHECK_EN_MSK NO_OS_BIT(7)
115 #define AD7606_DIAGN_MUX_CH_MSK(ch) (NO_OS_GENMASK(2, 0) << (3 * (ch & 0x1)))
117 #define AD7606_SERIAL_RD_FLAG_MSK(x) (NO_OS_BIT(6) | ((x) & 0x3F))
118 #define AD7606_SERIAL_WR_FLAG_MSK(x) ((x) & 0x3F)
120 #define AD7606_PARALLEL_RD_FLAG_MSK(x) (NO_OS_BIT(7) | ((x) & 0x7F))
121 #define AD7606_PARALLEL_WR_FLAG_MSK(x) ((x) & 0x7F)
123 #define AD7606_MAX_CHANNELS 8
356 uint32_t *num_ranges);
404 uint32_t *buf, int32_t *data, uint8_t *status);
bool spi_read_err_en
Definition: ad7606.h:269
@ AD7606_4_DOUT
Definition: ad7606.h:200
struct no_os_gpio_init_param * gpio_os0
Definition: ad7606.h:325
struct no_os_gpio_init_param * gpio_par_ser
Definition: ad7606.h:331
#define AD7606_REG_PHASE_CH(ch)
Definition: ad7606.h:60
int32_t ad7606_set_ch_range(struct ad7606_dev *dev, uint8_t ch, struct ad7606_range range)
Set the channel operation range.
Definition: ad7606.c:1456
int32_t ad7606_get_ch_scale(struct ad7606_dev *dev, uint8_t ch, double *scale)
Get the value of scale for the channel.
Definition: ad7606.c:1502
int32_t ad7606_get_resolution_bits(struct ad7606_dev *dev)
Get the resolution bits of this device.
Definition: ad7606.c:1524
@ ID_AD7606C_18
Definition: ad7606.h:143
uint32_t timeout
Definition: ad413x.c:49
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
uint32_t no_commands
Definition: spi_engine.h:165
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
@ AD7606_8_DOUT
Definition: ad7606.h:202
int8_t offset_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.h:345
int32_t ad7606_reset(struct ad7606_dev *dev)
Reset the device by toggling the reset GPIO.
Definition: ad7606.c:1145
NO_OS_DECLARE_CRC8_TABLE(ad7606_crc8)
#define AD7606_REG_GAIN_CH(ch)
Definition: ad7606.h:58
AD7606_REG_CONFIG configuration parameters.
Definition: ad7606.h:220
bool int_crc_err_en
Definition: ad7606.h:265
@ AD7606_SW_RANGE_SINGLE_ENDED_BIPOLAR
Definition: ad7606.h:212
@ AD7606_2_DOUT
Definition: ad7606.h:198
bool parallel_interface
Definition: ad7606.h:339
NO_OS_DECLARE_CRC16_TABLE(ad7606_crc16)
struct no_os_spi_init_param spi_init
Definition: ad7606.h:311
#define AD7606_MM_CRC_ERR_EN_MSK
Definition: ad7606.h:106
int32_t ad7606_convst(struct ad7606_dev *dev)
Toggle the CONVST pin to start a conversion.
Definition: ad7606.c:677
enum ad7606_device_id device_id
Definition: ad7606.h:333
struct no_os_gpio_desc * gpio_par_ser
Definition: ad7606.c:290
enum ad7606_op_mode op_mode
Definition: ad7606.h:222
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
@ ID_AD7606C_16
Definition: ad7606.h:141
@ AD7606_STANDBY
Definition: ad7606.h:183
Definition: axi_dmac.h:127
Header file for the ad7606 Driver.
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad7606.c:261
const char * name
Definition: axi_dmac.h:128
struct no_os_gpio_init_param * gpio_reset
Definition: ad7606.h:315
Structure for AXI FPGA cores.
Definition: ad7606.c:245
int32_t min
Definition: ad7606.h:237
#define CS_LOW
Definition: spi_engine.h:73
int32_t ad7606_init(struct ad7606_dev **device, struct ad7606_init_param *init_param)
Initialize the ad7606 device structure.
Definition: ad7606.c:1833
Header file of SPI Interface.
bool ad7606_sw_mode_enabled(struct ad7606_dev *dev)
Returns true if SW mode is enabled.
Definition: ad7606.c:1435
int32_t ad7606_set_ch_gain(struct ad7606_dev *dev, uint8_t ch, uint8_t gain)
Set the channel gain.
Definition: ad7606.c:1623
#define AD7606_CONFIG_CTRL
Definition: ad7606.c:60
#define AD7606_REG_OVERSAMPLING
Definition: ad7606.h:57
int32_t ad7606_get_channels_number(struct ad7606_dev *dev)
Returns the number of channels this ADC has.
Definition: ad7606.c:330
int32_t spi_engine_offload_init(struct no_os_spi_desc *desc, const struct spi_engine_offload_init_param *param)
Initialize the SPI engine's offload module.
Definition: spi_engine.c:763
struct spi_engine_offload_init_param offload_init_param
Definition: ad7606.c:253
int32_t ad7606_data_correction_serial(struct ad7606_dev *dev, uint32_t *buf, int32_t *data, uint8_t *status)
Definition: ad7606.c:2000
int32_t no_os_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by no_os_pwm_init().
Definition: no_os_pwm.c:79
#define AD7606_SPI_WRITE_ERR_EN_MSK
Definition: ad7606.h:108
@ ID_AD7606_4
Definition: ad7606.h:133
#define AD7606_CHAN_CTRL_ENABLE
Definition: ad7606.c:66
Driver for the Analog Devices AXI CLKGEN.
@ AD7606_SW_RANGE_SINGLE_ENDED_UNIPOLAR
Definition: ad7606.h:211
enum ad7606_range_type type
Definition: ad7606.h:241
int32_t axi_dmac_transfer_wait_completion(struct axi_dmac *dmac, uint32_t timeout_ms)
Definition: axi_dmac.c:525
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
uint8_t num_channels
Definition: ad7606.c:308
bool ad7606_sw_mode_enabled(struct ad7606_dev *dev)
Returns true if SW mode is enabled.
Definition: ad7606.c:1435
#define AD7606_SERIAL_WR_FLAG_MSK(x)
Definition: ad7606.h:118
uint32_t reg_access_speed
Definition: ad7606.c:260
enum ad7606_osr os_ratio
Definition: ad7606.h:252
uint32_t * commands_data
Definition: spi_engine.h:167
const struct ad7606_range * hw_range_table
Definition: ad7606.c:87
int32_t ad7606_get_channels_number(struct ad7606_dev *dev)
Returns the number of channels this ADC has.
Definition: ad7606.c:330
Header file of Delay functions.
#define AD7606_SERIAL_CORE_ENABLE
Definition: ad7606.c:73
struct no_os_gpio_desc * gpio_os1
Definition: ad7606.c:286
int32_t ad7606_set_digital_diag(struct ad7606_dev *dev, struct ad7606_digital_diag diag)
Set the device digital diagnostics configuration.
Definition: ad7606.c:1724
uint32_t axi_clkgen_rate
Definition: ad7606.h:292
Definition: clk_axi_clkgen.h:50
enum ad7606_device_id device_id
Definition: ad7606.c:292
enum ad7606_dout_format dout_format
Definition: ad7606.h:224
struct no_os_gpio_init_param * gpio_stby_n
Definition: ad7606.h:321
@ AD7606_OSR_8
Definition: ad7606.h:162
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
struct no_os_gpio_init_param * gpio_range
Definition: ad7606.h:323
int32_t ad7606_set_ch_offset(struct ad7606_dev *dev, uint8_t ch, int8_t offset)
Set the channel offset.
Definition: ad7606.c:1554
Structure representing an offload message.
Definition: spi_engine.h:158
bool sw_mode
Definition: ad7606.c:296
@ NO_OS_SPI_MODE_2
Definition: no_os_spi.h:65
void ad7606_axi_remove(struct ad7606_dev *dev)
Free any resource used by the driver.
Definition: ad7606.c:2046
Definition: ad9361_util.h:69
uint8_t num_channels
Definition: ad7606.c:81
ad7606_osr
Oversampling ratio.
Definition: ad7606.h:154
int32_t ad7606_write_mask(struct ad7606_dev *dev, uint32_t addr, uint32_t mask, uint32_t val)
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
@ AD7606_HW_RANGE
Definition: ad7606.h:210
#define AD7606_PARALLEL_CORE_ENABLE
Definition: ad7606.c:76
@ ID_AD7609
Definition: ad7606.h:147
bool reg_mode
Definition: ad7606.c:300
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:520
int32_t ad7606_reg_write(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:568
int32_t ad7606_set_ch_offset(struct ad7606_dev *dev, uint8_t ch, int8_t offset)
Set the channel offset.
Definition: ad7606.c:1554
Definition: clk_axi_clkgen.h:44
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define AD7606_BUSY_STUCK_HIGH_ERR_EN_MSK
Definition: ad7606.h:110
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
@ AD7606_SW_RANGE_DIFFERENTIAL_BIPOLAR
Definition: ad7606.h:213
bool has_oversampling
Definition: ad7606.c:84
struct no_os_gpio_desc * gpio_reset
Definition: ad7606.c:274
void ad7606_capture_post_disable(struct ad7606_dev *dev)
Disables buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1036
struct no_os_gpio_desc * gpio_busy
Definition: ad7606.c:278
Oversampling settings.
Definition: ad7606.h:259
bool parallel_interface
Definition: ad7606.c:298
uint8_t phase_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.c:316
@ AD7606_AUTOSTANDBY
Definition: ad7606.h:185
#define AD7606_INTERFACE_CHECK_EN_MSK
Definition: ad7606.h:112
#define AD7606_REG_DIGITAL_DIAG_ENABLE
Definition: ad7606.h:61
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
int32_t ad7606_read_samples(struct ad7606_dev *dev, uint32_t *data, uint32_t samples)
Read muliple raw samples from device.
Definition: ad7606.c:1065
uint8_t gain_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.c:318
int32_t axi_dmac_remove(struct axi_dmac *dmac)
Definition: axi_dmac.c:367
int32_t ad7606_set_ch_phase(struct ad7606_dev *dev, uint8_t ch, uint8_t phase)
Set the channel phase.
Definition: ad7606.c:1589
const struct ad7606_range * ad7606_get_ch_ranges(struct ad7606_dev *dev, uint8_t ch, uint32_t *num_ranges)
Get the available channel ranges for the given channel.
Definition: ad7606.c:1366
Definition: axi_dmac.h:102
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
#define AD7606_CONFIG_OPERATION_MODE_MSK
Definition: ad7606.h:83
bool busy_stuck_high_err_en
Definition: ad7606.h:271
#define AD7606_CONFIG_DOUT_FORMAT_MSK
Definition: ad7606.h:84
uint32_t hw_range_table_sz
Definition: ad7606.c:88
#define AD7606_OS_PAD_MSK
Definition: ad7606.h:94
int32_t ad7606_get_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling *oversampling)
Get the oversampling ratio.
Definition: ad7606.c:1345
int32_t max
Definition: ad7606.h:239
#define CS_HIGH
Definition: spi_engine.h:72
bool rom_crc_err_en
Definition: ad7606.h:261
void spi_engine_set_speed(struct no_os_spi_desc *desc, uint32_t speed_hz)
Set SPI engine clock frequency.
Definition: spi_engine.c:148
int32_t ad7606_read_samples(struct ad7606_dev *dev, uint32_t *data, uint32_t samples)
Read muliple raw samples from device.
Definition: ad7606.c:1065
struct no_os_gpio_desc * gpio_range
Definition: ad7606.c:282
int32_t no_os_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM signal generation.
Definition: no_os_pwm.c:98
@ AD7606_SHUTDOWN
Definition: ad7606.h:187
#define AD7606_MAX_CHANNELS
Definition: ad7606.h:123
int32_t ad7606_convst(struct ad7606_dev *dev)
Toggle the CONVST pin to start a conversion.
Definition: ad7606.c:677
int32_t ad7606_spi_data_read(struct ad7606_dev *dev, uint32_t *data)
Read conversion data.
Definition: ad7606.c:720
struct ad7606_config config
Definition: ad7606.h:341
int32_t spi_engine_set_transfer_width(struct no_os_spi_desc *desc, uint8_t data_wdith)
Set width of the transfered word over SPI.
Definition: spi_engine.c:127
#define AD7606_INT_CRC_ERR_EN_MSK
Definition: ad7606.h:107
int32_t ad7606_set_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling oversampling)
Set the oversampling ratio.
Definition: ad7606.c:1295
bool mm_crc_err_en
Definition: ad7606.h:263
@ IRQ_DISABLED
Definition: axi_dmac.h:79
AXI driver(s) initialization parameters.
Definition: ad7606.h:288
void no_os_crc8_populate_msb(uint8_t *table, const uint8_t polynomial)
int8_t offset_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.c:314
struct no_os_gpio_desc * gpio_stby_n
Definition: ad7606.c:280
bool has_registers
Definition: ad7606.c:85
bool ext_os_clock
Definition: ad7606.h:226
int32_t no_os_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM signal generation.
Definition: no_os_pwm.c:115
uint8_t data[28]
Definition: ad7606.c:320
#define AD7606_CLK_FS_OS_COUNTER_EN_MSK
Definition: ad7606.h:111
Device driver initialization parameters.
Definition: ad7606.h:309
#define AD7606_ID_DEVICE_ID_MSK
Definition: ad7606.h:98
struct ad7606_axi_dev axi_dev
Definition: ad7606.c:270
uint8_t gain_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.h:349
int32_t ad7606_reg_read(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:542
@ AD7606_OSR_16
Definition: ad7606.h:164
int32_t ad7606_reg_write_mask(struct ad7606_dev *dev, uint32_t addr, uint32_t mask, uint32_t val)
Write a device register via SPI with masking.
Definition: ad7606.c:592
struct no_os_gpio_desc * gpio_os0
Definition: ad7606.c:284
#define AD7606_CHAN_CTRL_DISABLE
Definition: ad7606.c:67
#define AD7606_RANGE_CH_MSK(ch)
Definition: ad7606.h:89
uint32_t rx_dma_baseaddr
Definition: ad7606.h:300
uint8_t phase_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.h:347
int32_t ad7606_remove(struct ad7606_dev *dev)
Free any resource used by the driver.
Definition: ad7606.c:2073
int32_t ad7606_get_ch_scale(struct ad7606_dev *dev, uint8_t ch, double *scale)
Get the value of scale for the channel.
Definition: ad7606.c:1502
ad7606_op_mode
Operation mode.
Definition: ad7606.h:179
struct ad7606_range range_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.h:351
#define AD7606_CONFIG_CTRL_DEFAULT
Definition: ad7606.c:61
int32_t ad7606_spi_data_read(struct ad7606_dev *dev, uint32_t *data)
Read conversion data.
Definition: ad7606.c:720
enum ad7606_range_type range_ch_type[AD7606_MAX_CHANNELS]
Definition: ad7606.c:312
uint32_t dest_addr
Definition: axi_dmac.h:107
ad7606_device_id
Device ID definitions.
Definition: ad7606.h:129
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
struct no_os_gpio_desc * gpio_os2
Definition: ad7606.c:288
uint32_t sw_range_table_sz
Definition: ad7606.c:90
Generic header file for all CRC computation algorithms.
struct ad7606_oversampling oversampling
Definition: ad7606.h:335
struct no_os_gpio_init_param * gpio_os2
Definition: ad7606.h:329
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: altera_axi_io.c:53
#define AD7606_CONFIG_EXT_OS_CLOCK_MSK
Definition: ad7606.h:85
#define AD7606_PARALLEL_CORE_DISABLE
Definition: ad7606.c:77
@ ID_AD7608
Definition: ad7606.h:145
#define AD7606_CORE_RESET
Definition: ad7606.c:71
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
#define AD7606_GAIN_MSK
Definition: ad7606.h:102
uint32_t * commands
Definition: spi_engine.h:163
#define AD7606_REG_OFFSET_CH(ch)
Definition: ad7606.h:59
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
#define AD7606_RANGE_CH_MODE(ch, mode)
Definition: ad7606.h:90
uint8_t os_pad
Definition: ad7606.h:250
#define AD7606_CONFIG_CTRL_WRITE_OP
Definition: ad7606.c:63
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:51
int32_t ad7606_remove(struct ad7606_dev *dev)
Free any resource used by the driver.
Definition: ad7606.c:2073
int32_t ad7606_data_correction_serial(struct ad7606_dev *dev, uint32_t *buf, int32_t *data, uint8_t *status)
Definition: ad7606.c:2000
uint32_t rx_dma_baseaddr
Definition: ad7606.c:259
#define AD7606_REG_RANGE_CH_ADDR(ch)
Definition: ad7606.h:55
Header file of PWM Interface.
int32_t ad7606_set_config(struct ad7606_dev *dev, struct ad7606_config config)
Set the device config register.
Definition: ad7606.c:1659
#define AD7606_REG_ID
Definition: ad7606.h:72
uint32_t no_os_field_get(uint32_t mask, uint32_t word)
struct ad7606_digital_diag digital_diag_enable
Definition: ad7606.c:306
struct ad7606_digital_diag digital_diag_enable
Definition: ad7606.h:343
struct ad7606_oversampling oversampling
Definition: ad7606.c:294
@ AD7606_OSR_2
Definition: ad7606.h:158
int32_t ad7606_get_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling *oversampling)
Get the oversampling ratio.
Definition: ad7606.c:1345
int32_t ad7606_set_digital_diag(struct ad7606_dev *dev, struct ad7606_digital_diag diag)
Set the device digital diagnostics configuration.
Definition: ad7606.c:1724
uint8_t no_os_crc8(const uint8_t *table, const uint8_t *pdata, size_t nbytes, uint8_t crc)
@ NO
Definition: axi_dmac.h:98
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
uint16_t no_os_crc16(const uint16_t *table, const uint8_t *pdata, size_t nbytes, uint16_t crc)
const struct ad7606_range * sw_range_table
Definition: ad7606.c:89
int32_t ad7606_set_ch_range(struct ad7606_dev *dev, uint8_t ch, struct ad7606_range range)
Set the channel operation range.
Definition: ad7606.c:1456
struct no_os_gpio_desc * gpio_convst
Definition: ad7606.c:276
@ AD7606_OSR_32
Definition: ad7606.h:166
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad7606.h:302
@ AD7606_1_DOUT
Definition: ad7606.h:196
#define AD7606_CHAN_CTRL(c)
Definition: ad7606.c:65
int32_t axi_dmac_init(struct axi_dmac **dmac_core, const struct axi_dmac_init *init)
Definition: axi_dmac.c:334
struct no_os_pwm_desc * trigger_pwm_desc
Definition: ad7606.c:251
int32_t ad7606_set_oversampling(struct ad7606_dev *dev, struct ad7606_oversampling oversampling)
Set the oversampling ratio.
Definition: ad7606.c:1295
#define AD7606_OS_RATIO_MSK
Definition: ad7606.h:95
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define NULL
Definition: wrapper.h:64
struct no_os_gpio_init_param * gpio_busy
Definition: ad7606.h:319
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
@ AD7606_OSR_4
Definition: ad7606.h:160
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
#define AD7606_REG_CONFIG
Definition: ad7606.h:54
int32_t ad7606_reg_write(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:568
@ ID_AD7606_8
Definition: ad7606.h:137
@ AD7606_NORMAL
Definition: ad7606.h:181
bool interface_check_en
Definition: ad7606.h:275
struct no_os_gpio_init_param * gpio_convst
Definition: ad7606.h:317
uint8_t bits
Definition: ad7606.c:82
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad7606.h:294
@ AD7606_OSR_256
Definition: ad7606.h:172
uint32_t reg_access_speed
Definition: ad7606.h:301
int32_t ad7606_init(struct ad7606_dev **device, struct ad7606_init_param *init_param)
Initialize the ad7606 device structure.
Definition: ad7606.c:1833
bool clk_fs_os_counter_en
Definition: ad7606.h:273
int32_t spi_engine_offload_transfer(struct no_os_spi_desc *desc, struct spi_engine_offload_message msg, uint32_t no_samples)
Initiate a SPI transfer in offload mode.
Definition: spi_engine.c:809
#define AD7606_CONFIG_CTRL_READ_OP
Definition: ad7606.c:62
void ad7606_capture_post_disable(struct ad7606_dev *dev)
Disables buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1036
struct axi_dmac * dmac
Definition: ad7606.c:255
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: altera_axi_io.c:67
struct ad7606_config config
Definition: ad7606.c:304
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
bool status_header
Definition: ad7606.h:228
Structure containing the init parameters needed by the offload module.
Definition: spi_engine.h:143
Header file of GPIO Interface.
uint8_t max_dout_lines
Definition: ad7606.c:83
Operation range as specified in datasheet (in uV)
Definition: ad7606.h:235
int32_t ad7606_set_ch_phase(struct ad7606_dev *dev, uint8_t ch, uint8_t phase)
Set the channel phase.
Definition: ad7606.c:1589
const struct ad7606_range * ad7606_get_ch_ranges(struct ad7606_dev *dev, uint8_t ch, uint32_t *num_ranges)
Get the available channel ranges for the given channel.
Definition: ad7606.c:1366
uint32_t max_speed_hz
Definition: no_os_spi.h:198
#define AD7606_SERIAL_CORE_DISABLE
Definition: ad7606.c:74
bool spi_write_err_en
Definition: ad7606.h:267
struct axi_clkgen * clkgen
Definition: ad7606.c:249
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
#define AD7606_SERIAL_RD_FLAG_MSK(x)
Definition: ad7606.h:117
struct axi_clkgen_init * clkgen_init
Definition: ad7606.h:290
void no_os_crc16_populate_msb(uint16_t *table, const uint16_t polynomial)
int32_t axi_dmac_transfer_start(struct axi_dmac *dmac, struct axi_dma_transfer *dma_transfer)
Definition: axi_dmac.c:385
int32_t ad7606_capture_pre_enable(struct ad7606_dev *dev)
Prepares buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1018
#define AD7606_SPI_READ_ERR_EN_MSK
Definition: ad7606.h:109
#define AD7606_CONFIG_STATUS_HEADER_MSK
Definition: ad7606.h:86
enum ad7606_dout_format max_dout_lines
Definition: ad7606.c:302
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:541
Header file of utility functions.
struct no_os_spi_desc * spi_desc
Definition: ad7606.c:272
@ ID_AD7606_6
Definition: ad7606.h:135
#define AD7606_CONFIG_RD
Definition: ad7606.c:58
#define AD7606_ROM_CRC_ERR_EN_MSK
Definition: ad7606.h:105
@ AD7606_OSR_128
Definition: ad7606.h:170
int32_t no_os_sign_extend32(uint32_t value, int index)
uint32_t rx_addr
Definition: spi_engine.h:171
int32_t ad7606_capture_pre_enable(struct ad7606_dev *dev)
Prepares buffer capture for an AXI SPI Engine or AXI Parallel interface.
Definition: ad7606.c:1018
uint8_t device_id
Definition: ad7606.c:86
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
@ AD7606_OSR_64
Definition: ad7606.h:168
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
#define AD7606_PARALLEL_WR_FLAG_MSK(x)
Definition: ad7606.h:121
uint32_t size
Definition: axi_dmac.h:103
uint32_t core_baseaddr
Definition: ad7606.c:257
@ ID_AD7605_4
Definition: ad7606.h:131
bool sw_mode
Definition: ad7606.h:337
#define AD7606_PARALLEL_RD_FLAG_MSK(x)
Definition: ad7606.h:120
#define READ(no_bytes)
Definition: spi_engine.h:62
const char * name
Definition: ad7606.c:80
struct ad7606_axi_init_param * axi_init
Definition: ad7606.h:313
ad7606_dout_format
Number of DOUT lines.
Definition: ad7606.h:194
struct spi_engine_offload_init_param * offload_init_param
Definition: ad7606.h:296
ad7606_range_type
Type of range for this channel.
Definition: ad7606.h:209
double scale_ch[AD7606_MAX_CHANNELS]
Definition: ad7606.c:310
Error macro definition for ARM Compiler.
struct no_os_gpio_init_param * gpio_os1
Definition: ad7606.h:327
@ ID_AD7606B
Definition: ad7606.h:139
Definition: axi_dmac.h:110
@ AD7606_OSR_1
Definition: ad7606.h:156
int32_t ad7606_reg_read(struct ad7606_dev *dev, uint8_t reg_addr, uint8_t *reg_data)
Write a device register via SPI or AXI Parallel core.
Definition: ad7606.c:542
int32_t ad7606_get_resolution_bits(struct ad7606_dev *dev)
Get the resolution bits of this device.
Definition: ad7606.c:1524
#define AD7606_CONFIG_WR
Definition: ad7606.c:57
bool initialized
Definition: ad7606.c:247
int32_t ad7606_set_config(struct ad7606_dev *dev, struct ad7606_config config)
Set the device config register.
Definition: ad7606.c:1659
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t ad7606_reset(struct ad7606_dev *dev)
Reset the device by toggling the reset GPIO.
Definition: ad7606.c:1145
Device driver structure.
Definition: ad7606.c:268
int32_t ad7606_set_ch_gain(struct ad7606_dev *dev, uint8_t ch, uint8_t gain)
Set the channel gain.
Definition: ad7606.c:1623
uint32_t core_baseaddr
Definition: ad7606.h:298
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