Go to the documentation of this file.
45 #if !defined(USE_STANDARD_SPI)
57 #define AD400X_READ_COMMAND 0x54
58 #define AD400X_WRITE_COMMAND 0x14
59 #define AD400X_RESERVED_MSK 0xE0
61 #define AD400X_TURBO_MODE(x) (((x) & 0x1) << 1)
62 #define AD400X_HIGH_Z_MODE(x) (((x) & 0x1) << 2)
63 #define AD400X_SPAN_COMPRESSION(x) (((x) & 0x1) << 3)
64 #define AD400X_EN_STATUS_BITS(x) (((x) & 0x1) << 4)
int32_t ad400x_spi_reg_write(struct ad400x_dev *dev, uint8_t reg_data)
Definition: ad400x.c:125
int32_t ad400x_spi_reg_read(struct ad400x_dev *dev, uint8_t *reg_data)
Definition: ad400x.c:80
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:72
struct no_os_spi_desc * spi_desc
Definition: ad400x.h:87
@ ID_ADAQ4003
Definition: ad400x.h:77
char sign
Definition: ad400x.h:82
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:86
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:165
#define CS_LOW
Definition: spi_engine.h:79
Header file of SPI Interface.
const struct ad400x_dev_info * dev_info
Definition: ad400x.h:101
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:759
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:85
@ ID_AD4002
Definition: ad400x.h:69
struct axi_clkgen_init * clkgen_init
Definition: ad400x.h:114
Driver for the Analog Devices AXI CLKGEN.
ad400x_supported_dev_ids
Definition: ad400x.h:66
@ ID_AD4000
Definition: ad400x.h:67
uint32_t * commands_data
Definition: spi_engine.h:169
uint32_t axi_clkgen_rate
Definition: ad400x.h:116
#define AD400X_READ_COMMAND
Definition: ad400x.h:57
Definition: clk_axi_clkgen.h:56
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad400x.h:126
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:419
uint16_t resolution
Definition: ad400x.h:81
Structure representing an offload message.
Definition: spi_engine.h:160
Definition: ad9361_util.h:75
int32_t ad400x_spi_reg_read(struct ad400x_dev *dev, uint8_t *reg_data)
Definition: ad400x.c:80
uint32_t * buffer
Definition: ad400x.h:128
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:525
Definition: clk_axi_clkgen.h:50
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
#define AD400X_EN_STATUS_BITS(x)
Definition: ad400x.h:64
const struct ad400x_dev_info ad400x_devices[]
Definition: ad400x.c:56
#define AD400X_RESERVED_MSK
Definition: ad400x.h:59
int32_t ad400x_spi_reg_write(struct ad400x_dev *dev, uint8_t reg_data)
Definition: ad400x.c:125
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:121
uint32_t reg_access_speed
Definition: ad7616.h:218
int32_t ad400x_remove(struct ad400x_dev *dev)
Free the resources allocated by ad400x_init().
Definition: ad400x.c:370
#define CS_HIGH
Definition: spi_engine.h:78
#define AD400X_TURBO_MODE(x)
Definition: ad400x.h:61
void spi_engine_set_speed(struct no_os_spi_desc *desc, uint32_t speed_hz)
Set SPI engine clock frequency.
Definition: spi_engine.c:152
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:56
enum ad400x_supported_dev_ids dev_id
Definition: ad400x.h:97
uint32_t reg_access_speed
Definition: ad400x.h:95
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:131
bool high_z_mode
Definition: ad400x.h:133
#define AD400X_SPAN_COMPRESSION(x)
Definition: ad400x.h:63
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad400x.h:112
struct spi_engine_offload_init_param * offload_init_param
Definition: ad7616.h:211
struct axi_clkgen * clkgen
Definition: ad400x.h:89
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad7616.h:213
struct no_os_pwm_desc * trigger_pwm_desc
Definition: ad400x.h:91
@ ID_AD4003
Definition: ad400x.h:70
bool turbo_mode
Definition: ad400x.h:132
bool offload_enable
Definition: ad400x.h:131
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:110
Structure holding SPI descriptor.
Definition: no_os_spi.h:177
@ ID_AD4004
Definition: ad400x.h:71
struct no_os_spi_init_param * spi_init
Definition: ad400x.h:110
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad400x.h:103
@ ID_AD4001
Definition: ad400x.h:68
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
bool offload_enable
Definition: ad400x.h:105
struct spi_engine_offload_init_param * offload_init_param
Definition: ad400x.h:99
Structure representing an PWM generator device.
Definition: no_os_pwm.h:99
@ ID_AD4020
Definition: ad400x.h:76
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:57
bool en_status_bits
Definition: ad400x.h:135
int32_t ad400x_init(struct ad400x_dev **device, struct ad400x_init_param *init_param)
Definition: ad400x.c:287
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad7616.h:236
uint32_t axi_clkgen_rate
Definition: ad7616.h:217
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:55
Header file for ad400x Driver.
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:49
struct spi_engine_offload_init_param * offload_init_param
Definition: ad400x.h:124
int32_t ad400x_read_data(struct ad400x_dev *dev, uint32_t *buf, uint16_t samples)
Definition: ad400x.c:258
Header file of PWM Interface.
int32_t ad400x_remove(struct ad400x_dev *dev)
Free the resources allocated by ad400x_init().
Definition: ad400x.c:370
@ ID_AD4007
Definition: ad400x.h:74
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:75
struct no_os_gpio_init_param * gpio_cnv
Definition: ad400x.h:118
#define AD400X_HIGH_Z_MODE(x)
Definition: ad400x.h:62
uint32_t buffer_size
Definition: ad400x.h:130
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
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:203
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:119
struct axi_clkgen_init * clkgen_init
Definition: ad7616.h:215
uint32_t reg_access_speed
Definition: ad400x.h:120
struct no_os_gpio_desc * gpio_cnv
Definition: ad400x.h:93
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:805
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:122
Structure containing the init parameters needed by the offload module.
Definition: spi_engine.h:145
Header file of GPIO Interface.
uint32_t max_speed_hz
Definition: no_os_spi.h:183
@ ID_AD4006
Definition: ad400x.h:73
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:58
int32_t ad400x_init(struct ad400x_dev **device, struct ad400x_init_param *init_param)
Definition: ad400x.c:287
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:546
Header file of utility functions.
#define AD400X_WRITE_COMMAND
Definition: ad400x.h:58
bool span_compression
Definition: ad400x.h:134
int32_t ad400x_read_data(struct ad400x_dev *dev, uint32_t *buf, uint16_t samples)
Definition: ad400x.c:258
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:153
@ ID_AD4011
Definition: ad400x.h:75
#define READ(no_bytes)
Definition: spi_engine.h:68
enum ad400x_supported_dev_ids dev_id
Definition: ad400x.h:122
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:131
@ ID_AD4005
Definition: ad400x.h:72