no-OS
ad9508.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD9508_H_
40 #define AD9508_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include "no_os_spi.h"
46 
47 /******************************************************************************/
48 /********************** Macros and Constants Definitions **********************/
49 /******************************************************************************/
50 
51 #define AD9508_SPI_CONFIG 0x000
52 #define AD9508_PART_ID_LOW 0x00C
53 #define AD9508_PART_ID_HIGH 0x00D
54 #define AD9508_OUT1_DIV_RATIO_LOW 0x01B
55 #define AD9508_OUT1_DIV_RATIO_HIGH 0x01C
56 #define AD9508_OUT1_PHASE_LOW 0x01D
57 #define AD9508_OUT1_PHASE_HIGH 0x01E
58 #define AD9508_PART_ID_VALUE 0x005
59 #define AD9508_DIVIDE_RATIO_ONE 0x000
60 
61 /******************************************************************************/
62 /*************************** Types Declarations *******************************/
63 /******************************************************************************/
64 
66  /* SPI */
68 };
69 
70 struct ad9508_dev {
71  /* SPI */
73 };
74 
75 /******************************************************************************/
76 /************************ Functions Declarations ******************************/
77 /******************************************************************************/
78 
79 int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr,
80  uint8_t *reg_data);
81 
82 int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr,
83  uint8_t reg_data);
84 
85 int32_t ad9508_setup(struct ad9508_dev **device,
86  const struct ad9508_init_param *init_param);
87 
88 int32_t ad9508_remove(struct ad9508_dev *dev);
89 
90 #endif
axi_adc_core.h
Driver for the Analog Devices AXI-ADC-CORE module.
ad9517_dev
Definition: ad9517.h:394
ADC_DDR_BASEADDR
#define ADC_DDR_BASEADDR
Definition: parameters.h:64
IIO_APP_DEVICE
#define IIO_APP_DEVICE(_name, _dev, _dev_descriptor, _read_buff, _write_buff)
Definition: iio_app.h:46
TWOS_COMPLEMENT
@ TWOS_COMPLEMENT
Definition: ad9467_fmc.c:81
CF_DATA_MONITOR_PN_ERR
#define CF_DATA_MONITOR_PN_ERR
Definition: ad9467_fmc.c:75
type_test_modes
type_test_modes
Definition: ad9467_fmc.c:85
ad9508_init_param
Definition: ad9508.h:65
ad9467_test_mode
int32_t ad9467_test_mode(struct ad9467_dev *dev, int32_t mode, int32_t *ret_mode)
Sets the ADC's test mode.
Definition: ad9467.c:246
ad9467_write
int32_t ad9467_write(struct ad9467_dev *dev, uint16_t reg_addr, uint8_t reg_val)
Writes data into a register.
Definition: ad9467.c:113
no_os_spi_write_and_read
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:82
iio_data_buffer::size
uint32_t size
Definition: iio_app.h:61
axi_dmac_init
Definition: axi_dmac.h:129
axi_dmac_init::name
const char * name
Definition: axi_dmac.h:130
ad9517_remove
int32_t ad9517_remove(struct ad9517_dev *dev)
Free the resources allocated by ad9517_setup().
Definition: ad9517.c:212
ad9517_init_param
Definition: ad9517.h:402
no_os_spi.h
Header file of SPI Interface.
AD9467_REG_TEST_IO
#define AD9467_REG_TEST_IO
Definition: ad9467.h:66
ad9467_reset_pn9
int32_t ad9467_reset_pn9(struct ad9467_dev *dev, int32_t rst, int32_t *ret_stat)
Sets (1) or clears (0) the reset short PN sequence bit(PN9).
Definition: ad9467.c:285
TEST_DISABLE
@ TEST_DISABLE
Definition: ad9467_fmc.c:86
ad9517.h
Header file of AD9517 Driver.
axi_adc_init
AXI ADC Initialization Parameters structure.
Definition: axi_adc_core.h:142
iio_app.h
Header file of iio_app.
axi_adc_write
int32_t axi_adc_write(struct axi_adc *adc, uint32_t reg_addr, uint32_t reg_data)
AXI ADC Data Write.
Definition: axi_adc_core.c:75
ad9467_remove
int32_t ad9467_remove(struct ad9467_dev *dev)
Free the resources allocated by ad9467_setup().
Definition: ad9467.c:93
ad9467_init_param
Definition: ad9467.h:136
axi_dmac_transfer_wait_completion
int32_t axi_dmac_transfer_wait_completion(struct axi_dmac *dmac, uint32_t timeout_ms)
Definition: axi_dmac.c:506
iio_data_buffer::buff
void * buff
Definition: iio_app.h:62
ad9434_outputmode_set
int32_t ad9434_outputmode_set(struct ad9434_dev *dev, uint8_t mode)
ad9434_setup
Definition: ad9434.c:93
NO_OS_IS_ERR_VALUE
#define NO_OS_IS_ERR_VALUE(x)
Definition: no_os_error.h:56
no_os_delay.h
Header file of Delay functions.
ad9508_reg_write
int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9508 that is conected to the SPI.
Definition: ad9508.c:89
axi_adc
AXI ADC Device Descriptor.
Definition: axi_adc_core.h:125
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:99
AD9508_PART_ID_HIGH
#define AD9508_PART_ID_HIGH
Definition: ad9508.h:53
ad9508_reg_read
int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9508 that is contected to the SPI.
Definition: ad9508.c:57
device
Definition: ad9361_util.h:75
POS_FULLSCALE
@ POS_FULLSCALE
Definition: ad9467_fmc.c:88
no_os_print_log.h
Print messages helpers.
axi_adc::name
const char * name
Definition: axi_adc_core.h:127
adc_test
void adc_test(struct axi_adc *adc, struct axi_dmac *dma, struct ad9467_dev *dev, uint32_t mode, uint32_t format)
Definition: ad9467_fmc.c:325
ad9508_setup
int32_t ad9508_setup(struct ad9508_dev **device, const struct ad9508_init_param *init_param)
Setup the working parameters of the ad9508 chip.
Definition: ad9508.c:114
iio_axi_adc_init_param
iio configuration.
Definition: iio_axi_adc.h:81
no_os_axi_io.h
Header file of AXI IO.
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:187
PN_23_SEQUENCE
@ PN_23_SEQUENCE
Definition: ad9467_fmc.c:91
AD9508_SPI_CONFIG
#define AD9508_SPI_CONFIG
Definition: ad9508.h:51
CHECKERBOARD
@ CHECKERBOARD
Definition: ad9467_fmc.c:90
MIDSCALE
@ MIDSCALE
Definition: ad9467_fmc.c:87
ad9467_transfer
int32_t ad9467_transfer(struct ad9467_dev *dev)
Initiates a transfer and waits for the operation to end.
Definition: ad9467.c:945
OUTPUT_MODE_TWOS_COMPLEMENT
#define OUTPUT_MODE_TWOS_COMPLEMENT
Definition: ad9265.h:83
iio_axi_adc_desc
iio_axi_adc_descriptor
Definition: iio_axi_adc.h:59
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:114
RX_DMA_BASEADDR
#define RX_DMA_BASEADDR
Definition: parameters.h:69
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
ad9517_power_mode
int32_t ad9517_power_mode(struct ad9517_dev *dev, int32_t channel, int32_t mode)
Sets the power mode of the specified channel.
Definition: ad9517.c:816
iio_app_device::read_buff
struct iio_data_buffer * read_buff
Definition: iio_app.h:69
axi_dma_transfer
Definition: axi_dmac.h:106
axi_adc::num_channels
uint8_t num_channels
Definition: axi_adc_core.h:131
iio_axi_adc_init
int32_t iio_axi_adc_init(struct iio_axi_adc_desc **desc, struct iio_axi_adc_init_param *init)
Registers a iio_axi_adc_desc for reading/writing and parameterization of axi_adc device.
Definition: iio_axi_adc.c:484
no_os_error.h
Error codes definition.
CF_REG_DATA_MONITOR
#define CF_REG_DATA_MONITOR
Definition: ad9467_fmc.c:72
NEG_FULLSCALE
@ NEG_FULLSCALE
Definition: ad9467_fmc.c:89
iio_app_device
Definition: iio_app.h:65
ad9434_setup
int32_t ad9434_setup(struct ad9434_dev **device, struct ad9434_init_param init_param)
ad9434_setup
Definition: ad9434.c:142
ad9467_dev
Definition: ad9467.h:131
axi_adc_read
int32_t axi_adc_read(struct axi_adc *adc, uint32_t reg_addr, uint32_t *reg_data)
AXI ADC Data read.
Definition: axi_adc_core.c:59
IRQ_DISABLED
@ IRQ_DISABLED
Definition: axi_dmac.h:83
TESTMODE_OFF
#define TESTMODE_OFF
Definition: ad9265.h:72
ad9508_reg_write
int32_t ad9508_reg_write(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9508 that is conected to the SPI.
Definition: ad9508.c:89
AD9467_REG_OUT_PHASE
#define AD9467_REG_OUT_PHASE
Definition: ad9467.h:71
ad9517_frequency
int64_t ad9517_frequency(struct ad9517_dev *dev, int32_t channel, int64_t frequency)
Sets the frequency on the specified channel.
Definition: ad9517.c:467
OFFSET_BINARY
@ OFFSET_BINARY
Definition: ad9467_fmc.c:80
AD9508_OUT1_PHASE_LOW
#define AD9508_OUT1_PHASE_LOW
Definition: ad9508.h:56
ad9517_read
int32_t ad9517_read(struct ad9517_dev *dev, uint32_t reg_addr, uint32_t *reg_value)
Reads data from a register.
Definition: ad9517.c:269
ad9517_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad9517.h:404
ad9508_setup
int32_t ad9508_setup(struct ad9508_dev **device, const struct ad9508_init_param *init_param)
Setup the working parameters of the ad9508 chip.
Definition: ad9508.c:114
AD9508_OUT1_DIV_RATIO_HIGH
#define AD9508_OUT1_DIV_RATIO_HIGH
Definition: ad9508.h:55
axi_dmac.h
Driver for the Analog Devices AXI-DMAC core.
iio_data_buffer
Definition: iio_app.h:60
ad9467_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad9467.h:138
AD9467_REG_DEVICE_UPDATE
#define AD9467_REG_DEVICE_UPDATE
Definition: ad9467.h:62
ad9508_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9508.h:72
iio_axi_adc.h
Header file of iio_axi_adc.
AXI_ADC_REG_CHAN_CNTRL
#define AXI_ADC_REG_CHAN_CNTRL(c)
Definition: axi_adc_core.h:82
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
no_os_axi_io_read
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: axi_io.c:59
PN_9_SEQUENCE
@ PN_9_SEQUENCE
Definition: ad9467_fmc.c:92
AD9508_PART_ID_VALUE
#define AD9508_PART_ID_VALUE
Definition: ad9508.h:58
ad9467_read
int32_t ad9467_read(struct ad9467_dev *dev, uint16_t reg_addr, uint8_t *reg_val)
Reads data from a register.
Definition: ad9467.c:140
xil_spi_init_param::type
enum xil_spi_type type
Definition: spi_extra.h:80
AD9467_REG_CHIP_GRADE
#define AD9467_REG_CHIP_GRADE
Definition: ad9467.h:59
ad9508_reg_read
int32_t ad9508_reg_read(struct ad9508_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9508 that is contected to the SPI.
Definition: ad9508.c:57
axi_adc_delay_calibrate
int32_t axi_adc_delay_calibrate(struct axi_adc *adc, uint32_t no_of_lanes, enum axi_adc_pn_sel sel)
Calibrate Delay using specific PN sequence.
Definition: axi_adc_core.c:218
xil_spi_init_param
Structure holding the initialization parameters for Xilinx platform specific SPI parameters when usin...
Definition: spi_extra.h:78
type_output_modes
type_output_modes
Definition: ad9467_fmc.c:79
ad9517_update
int32_t ad9517_update(struct ad9517_dev *dev)
Transfers the contents of the buffer registers into the active registers.
Definition: ad9517.c:304
ad9434_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad9434.h:105
ad9467_output_invert
int32_t ad9467_output_invert(struct ad9467_dev *dev, int32_t invert, int32_t *ret_stat)
Activates the inverted (1) or normal (0) output mode.
Definition: ad9467.c:508
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:116
ad9434_dev
Definition: ad9434.h:98
SPI_DEVICE_ID
#define SPI_DEVICE_ID
Definition: parameters.h:76
axi_adc_set_pnsel
int32_t axi_adc_set_pnsel(struct axi_adc *adc, uint32_t chan, enum axi_adc_pn_sel sel)
Set AXI ADC PN sequence.
Definition: axi_adc_core.c:91
ad9508_remove
int32_t ad9508_remove(struct ad9508_dev *dev)
Free the resources allocated by ad9508_setup().
Definition: ad9508.c:187
ad9434_init_param
Definition: ad9434.h:103
main
int main(void)
main
Definition: ad9434_fmc_500ebz.c:64
ad9517_setup
int32_t ad9517_setup(struct ad9517_dev **device, struct ad9517_init_param init_param)
Initializes the AD9517.
Definition: ad9517.c:55
NO
@ NO
Definition: axi_dmac.h:102
ad9508_dev
Definition: ad9508.h:70
AXI_ADC_PN23A
@ AXI_ADC_PN23A
Definition: axi_adc_core.h:153
display_test_mode
void display_test_mode(uint32_t mode, uint32_t format)
Definition: ad9467_fmc.c:420
iio_axi_adc_init_param::rx_adc
struct axi_adc * rx_adc
Definition: iio_axi_adc.h:83
axi_adc_init
int32_t axi_adc_init(struct axi_adc **adc_core, const struct axi_adc_init *init)
AXI ADC Main Initialization.
Definition: axi_adc_core.c:596
axi_dmac_init
int32_t axi_dmac_init(struct axi_dmac **dmac_core, const struct axi_dmac_init *init)
Definition: axi_dmac.c:331
RX_CORE_BASEADDR
#define RX_CORE_BASEADDR
Definition: parameters.h:68
NULL
#define NULL
Definition: wrapper.h:64
iio_app_device::dev
void * dev
Definition: iio_app.h:67
ad9467_output_format
int32_t ad9467_output_format(struct ad9467_dev *dev, int32_t format, int32_t *ret_stat)
Specifies the output format.
Definition: ad9467.c:548
SPI_PS
@ SPI_PS
Definition: spi_extra.h:68
xil_spi_ops
const struct no_os_spi_platform_ops xil_spi_ops
Spi engine platform specific SPI platform ops structure.
Definition: xilinx_spi.c:456
TESTMODE_PN9_SEQ
#define TESTMODE_PN9_SEQ
Definition: ad9265.h:78
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
parameters.h
Platform dependent parameters.
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:242
ad9467.h
Header file of AD9467 Driver.
ad9508.h
Header file of AD9508 Driver.
no_os_spi_remove
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:70
CF_DATA_MONITOR_PN_OVER_RNG
#define CF_DATA_MONITOR_PN_OVER_RNG
Definition: ad9467_fmc.c:77
iio_app_run
int32_t iio_app_run(struct iio_app_device *devices, uint32_t len)
Register devices and start an iio application.
GRAY_CODE
@ GRAY_CODE
Definition: ad9467_fmc.c:82
AD9508_OUT1_PHASE_HIGH
#define AD9508_OUT1_PHASE_HIGH
Definition: ad9508.h:57
no_os_spi_init
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:51
axi_dmac_transfer_start
int32_t axi_dmac_transfer_start(struct axi_dmac *dmac, struct axi_dma_transfer *dma_transfer)
Definition: axi_dmac.c:378
AD9467_REG_CHIP_ID
#define AD9467_REG_CHIP_ID
Definition: ad9467.h:58
ad9508_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9508.h:67
ad9467_reset_pn23
int32_t ad9467_reset_pn23(struct ad9467_dev *dev, int32_t rst, int32_t *ret_stat)
Sets (1) or clears (0) the reset long PN sequence bit(PN23).
Definition: ad9467.c:324
CF_DATA_MONITOR_PN_SYNC
#define CF_DATA_MONITOR_PN_SYNC
Definition: ad9467_fmc.c:76
AD9508_PART_ID_LOW
#define AD9508_PART_ID_LOW
Definition: ad9508.h:52
main
int main()
Main function.
Definition: ad9467_fmc.c:112
AXI_ADC_REG_DELAY_CNTRL
#define AXI_ADC_REG_DELAY_CNTRL
Definition: axi_adc_core.h:74
ad9467_setup
int32_t ad9467_setup(struct ad9467_dev **device, struct ad9467_init_param init_param)
Configures the test mode and the output mode to a default state.
Definition: ad9467.c:55
AD9508_OUT1_DIV_RATIO_LOW
#define AD9508_OUT1_DIV_RATIO_LOW
Definition: ad9508.h:54
ad9434.h
Header file of AD9434 Driver.
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:125
NO_OS_SPI_MODE_0
@ NO_OS_SPI_MODE_0
Definition: no_os_spi.h:66
iio_axi_adc_get_dev_descriptor
void iio_axi_adc_get_dev_descriptor(struct iio_axi_adc_desc *desc, struct iio_device **dev_descriptor)
Get device descriptor.
Definition: iio_axi_adc.c:471
axi_dma_transfer::size
uint32_t size
Definition: axi_dmac.h:107
axi_adc_init::name
const char * name
Definition: axi_adc_core.h:144
AXI_ADC_PN9
@ AXI_ADC_PN9
Definition: axi_adc_core.h:152
ad9434_testmode_set
int32_t ad9434_testmode_set(struct ad9434_dev *dev, uint8_t mode)
ad9434_testmode_set
Definition: ad9434.c:111
axi_dmac::name
const char * name
Definition: axi_dmac.h:115
axi_dmac
Definition: axi_dmac.h:114
ONE_ZERO_TOGGLE
@ ONE_ZERO_TOGGLE
Definition: ad9467_fmc.c:93
SPI_PL
@ SPI_PL
Definition: spi_extra.h:66
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112
AD9508_DIVIDE_RATIO_ONE
#define AD9508_DIVIDE_RATIO_ONE
Definition: ad9508.h:59
AD9517_REG_PART_ID
#define AD9517_REG_PART_ID
Definition: ad9517.h:65
AXI_ADC_REG_CNTRL
#define AXI_ADC_REG_CNTRL
Definition: axi_adc_core.h:55