Go to the documentation of this file.
34 #ifndef SRC_PULSAR_ADC_H_
35 #define SRC_PULSAR_ADC_H_
39 #if !defined(USE_STANDARD_SPI)
51 #define PULSAR_ADC_READ_COMMAND 0x54
52 #define PULSAR_ADC_WRITE_COMMAND 0x14
53 #define PULSAR_ADC_RESERVED_MSK 0xE0
55 #define PULSAR_ADC_TURBO_MODE(x) (((x) & 0x1) << 1)
56 #define PULSAR_ADC_HIGH_Z_MODE(x) (((x) & 0x1) << 2)
57 #define PULSAR_ADC_SPAN_COMPRESSION(x) (((x) & 0x1) << 3)
58 #define PULSAR_ADC_EN_STATUS_BITS(x) (((x) & 0x1) << 4)
@ ID_AD4008
Definition: pulsar_adc.h:69
enum pulsar_adc_supported_dev_ids dev_id
Definition: pulsar_adc.h:133
#define PULSAR_ADC_HIGH_Z_MODE(x)
Definition: pulsar_adc.h:56
struct no_os_spi_init_param * spi_init
Definition: pulsar_adc.h:121
@ ID_AD4006
Definition: pulsar_adc.h:67
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
#define PULSAR_ADC_WRITE_COMMAND
Definition: pulsar_adc.h:52
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
@ ID_AD4003
Definition: pulsar_adc.h:64
@ ID_AD7693
Definition: pulsar_adc.h:78
bool turbo_mode
Definition: pulsar_adc.h:143
#define NO_OS_GENMASK(h, l)
Definition: no_os_util.h:82
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
#define CS_LOW
Definition: spi_engine.h:73
@ ID_AD7946
Definition: pulsar_adc.h:81
int32_t pulsar_adc_spi_reg_write(struct pulsar_adc_dev *dev, uint8_t reg_data)
Definition: pulsar_adc.c:134
Header file of SPI Interface.
@ ID_AD4022
Definition: pulsar_adc.h:74
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
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
@ ID_AD4010
Definition: pulsar_adc.h:70
@ ID_AD7983
Definition: pulsar_adc.h:84
struct no_os_pwm_desc * trigger_pwm_desc
Definition: pulsar_adc.h:102
Driver for the Analog Devices AXI CLKGEN.
bool span_compression
Definition: pulsar_adc.h:145
uint32_t * commands_data
Definition: spi_engine.h:167
@ ID_AD7985
Definition: pulsar_adc.h:86
uint32_t period_ns
Definition: no_os_pwm.h:70
bool en_status_bits
Definition: pulsar_adc.h:146
Definition: clk_axi_clkgen.h:50
int32_t axi_clkgen_set_rate(struct axi_clkgen *clkgen, uint32_t rate)
axi_clkgen_set_rate
Definition: clk_axi_clkgen.c:414
pulsar_adc_supported_dev_ids
Definition: pulsar_adc.h:60
@ ID_AD7942
Definition: pulsar_adc.h:79
Definition: pulsar_adc.h:119
Structure representing an offload message.
Definition: spi_engine.h:158
@ ID_AD7691
Definition: pulsar_adc.h:77
Definition: ad9361_util.h:69
bool offload_enable
Definition: pulsar_adc.h:142
uint32_t reg_access_speed
Definition: pulsar_adc.h:131
@ ID_AD7986
Definition: pulsar_adc.h:87
bool offload_enable
Definition: pulsar_adc.h:116
int32_t axi_clkgen_init(struct axi_clkgen **clk, const struct axi_clkgen_init *init)
axi_clkgen_init
Definition: clk_axi_clkgen.c:520
Definition: clk_axi_clkgen.h:44
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
#define PULSAR_ADC_SPAN_COMPRESSION(x)
Definition: pulsar_adc.h:57
Definition: pulsar_adc.h:90
#define PULSAR_ADC_EN_STATUS_BITS(x)
Definition: pulsar_adc.h:58
@ ID_AD7690
Definition: pulsar_adc.h:76
@ ID_AD4004
Definition: pulsar_adc.h:65
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
int32_t pulsar_adc_spi_reg_write(struct pulsar_adc_dev *dev, uint8_t reg_data)
Definition: pulsar_adc.c:134
@ ID_AD7980
Definition: pulsar_adc.h:82
uint32_t reg_access_speed
Definition: ad7616.h:212
struct axi_clkgen * clkgen
Definition: pulsar_adc.h:100
struct spi_engine_offload_init_param * offload_init_param
Definition: pulsar_adc.h:135
int32_t pulsar_adc_remove(struct pulsar_adc_dev *dev)
Free the resources allocated by pulsar_adc_init().
Definition: pulsar_adc.c:386
uint32_t axi_clkgen_rate
Definition: pulsar_adc.h:127
#define CS_HIGH
Definition: spi_engine.h:72
@ ID_AD4021
Definition: pulsar_adc.h:73
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
@ ID_AD4000
Definition: pulsar_adc.h:61
#define NO_OS_DIV_ROUND_UP(x, y)
Definition: no_os_util.h:52
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
struct spi_engine_offload_init_param * offload_init_param
Definition: ad7616.h:205
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: pulsar_adc.h:114
struct no_os_pwm_init_param * trigger_pwm_init
Definition: ad7616.h:207
#define PULSAR_ADC_READ_COMMAND
Definition: pulsar_adc.h:51
char sign
Definition: pulsar_adc.h:92
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: pulsar_adc.h:137
struct no_os_gpio_init_param * gpio_cnv
Definition: pulsar_adc.h:129
@ ID_ADAQ4003
Definition: pulsar_adc.h:75
int32_t pulsar_adc_remove(struct pulsar_adc_dev *dev)
Free the resources allocated by pulsar_adc_init().
Definition: pulsar_adc.c:386
@ ID_AD4002
Definition: pulsar_adc.h:63
uint32_t * buffer
Definition: pulsar_adc.h:139
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
Definition: pulsar_adc.h:96
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ ID_AD4007
Definition: pulsar_adc.h:68
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:72
@ ID_AD4011
Definition: pulsar_adc.h:71
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
void(* dcache_invalidate_range)(uint32_t address, uint32_t bytes_count)
Definition: ad7616.h:230
uint32_t axi_clkgen_rate
Definition: ad7616.h:211
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
const struct pulsar_adc_dev_info pulsar_adc_devices[]
Definition: pulsar_adc.c:49
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
int32_t pulsar_adc_spi_reg_read(struct pulsar_adc_dev *dev, uint8_t *reg_data)
Definition: pulsar_adc.c:89
Header file of PWM Interface.
int32_t pulsar_adc_init(struct pulsar_adc_dev **device, struct pulsar_adc_init_param *init_param)
Definition: pulsar_adc.c:296
@ ID_AD4020
Definition: pulsar_adc.h:72
struct spi_engine_offload_init_param * offload_init_param
Definition: pulsar_adc.h:110
@ ID_AD7944
Definition: pulsar_adc.h:80
uint16_t max_rate
Definition: pulsar_adc.h:93
struct no_os_pwm_init_param * trigger_pwm_init
Definition: pulsar_adc.h:123
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 resolution
Definition: pulsar_adc.h:91
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:197
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
struct axi_clkgen_init * clkgen_init
Definition: ad7616.h:209
int32_t pulsar_adc_read_data(struct pulsar_adc_dev *dev, uint32_t *buf, uint16_t samples)
Definition: pulsar_adc.c:267
struct axi_clkgen_init * clkgen_init
Definition: pulsar_adc.h:125
int32_t pulsar_adc_spi_reg_read(struct pulsar_adc_dev *dev, uint8_t *reg_data)
Definition: pulsar_adc.c:89
uint32_t buffer_size
Definition: pulsar_adc.h:141
const struct pulsar_adc_dev_info * dev_info
Definition: pulsar_adc.h:112
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 PULSAR_ADC_TURBO_MODE(x)
Definition: pulsar_adc.h:55
@ ID_AD7982
Definition: pulsar_adc.h:83
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
Structure containing the init parameters needed by the offload module.
Definition: spi_engine.h:143
Header file of GPIO Interface.
struct no_os_spi_desc * spi_desc
Definition: pulsar_adc.h:98
struct no_os_gpio_desc * gpio_cnv
Definition: pulsar_adc.h:104
uint32_t max_speed_hz
Definition: no_os_spi.h:198
@ ID_AD4005
Definition: pulsar_adc.h:66
@ ID_AD7984
Definition: pulsar_adc.h:85
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
int32_t axi_clkgen_remove(struct axi_clkgen *clkgen)
axi_clkgen_remove
Definition: clk_axi_clkgen.c:541
Header file of utility functions.
enum pulsar_adc_supported_dev_ids dev_id
Definition: pulsar_adc.h:108
int32_t pulsar_adc_init(struct pulsar_adc_dev **device, struct pulsar_adc_init_param *init_param)
Definition: pulsar_adc.c:296
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 PULSAR_ADC_RESERVED_MSK
Definition: pulsar_adc.h:53
@ ID_AD4001
Definition: pulsar_adc.h:62
bool high_z_mode
Definition: pulsar_adc.h:144
Header file for pulsar_adc Driver.
#define READ(no_bytes)
Definition: spi_engine.h:62
uint32_t reg_access_speed
Definition: pulsar_adc.h:106
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t pulsar_adc_read_data(struct pulsar_adc_dev *dev, uint32_t *buf, uint16_t samples)
Definition: pulsar_adc.c:267