no-OS
ad9265.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD9265_H_
40 #define AD9265_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include <stdint.h>
46 #include "no_os_delay.h"
47 #include "no_os_spi.h"
48 
49 /******************************************************************************/
50 /********************** Macros and Constants Definitions **********************/
51 /******************************************************************************/
52 #define AD9265_REG_CHIP_PORT_CONF 0x00
53 #define AD9265_REG_CHIP_ID 0x01
54 #define AD9265_REG_CHIP_GRADE 0x02
55 #define AD9265_REG_CHAN_INDEX 0x05
56 #define AD9265_REG_TRANSFER 0xFF
57 #define AD9265_REG_MODES 0x08
58 #define AD9265_REG_TEST_IO 0x0D
59 #define AD9265_REG_ADC_INPUT 0x0F
60 #define AD9265_REG_OFFSET 0x10
61 #define AD9265_REG_OUTPUT_MODE 0x14
62 #define AD9265_REG_OUTPUT_ADJUST 0x15
63 #define AD9265_REG_OUTPUT_PHASE 0x16
64 #define AD9265_REG_OUTPUT_DELAY 0x17
65 #define AD9265_REG_VREF 0x18
66 #define AD9265_REG_ANALOG_INPUT 0x2C
67 
68 /* ADC_REG_TRANSFER */
69 #define TRANSFER_SYNC 0x1
70 
71 /* AD9265_REG_TEST_IO */
72 #define TESTMODE_OFF 0x0
73 #define TESTMODE_MIDSCALE_SHORT 0x1
74 #define TESTMODE_POS_FULLSCALE 0x2
75 #define TESTMODE_NEG_FULLSCALE 0x3
76 #define TESTMODE_ALT_CHECKERBOARD 0x4
77 #define TESTMODE_PN23_SEQ 0x5
78 #define TESTMODE_PN9_SEQ 0x6
79 #define TESTMODE_ONE_ZERO_TOGGLE 0x7
80 
81 /* ADC_REG_OUTPUT_MODE */
82 #define OUTPUT_MODE_OFFSET_BINARY 0x0
83 #define OUTPUT_MODE_TWOS_COMPLEMENT 0x1
84 #define OUTPUT_MODE_GRAY_CODE 0x2
85 
86 /* ADC_REG_OUTPUT_PHASE */
87 #define OUTPUT_EVEN_ODD_MODE_EN 0x20
88 #define INVERT_DCO_CLK 0x80
89 
90 #define AD9265_CHIP_ID 0x64
91 #define AD9265_DEF_OUTPUT_MODE 0x40
92 
93 /******************************************************************************/
94 /*************************** Types Declarations *******************************/
95 /******************************************************************************/
97  /* SPI */
99  /* Device Settings */
100  uint8_t output_mode;
101  uint8_t dco; // data clock output
102  uint8_t dco_en; // dco enable
103  uint8_t nb_lanes; // number of lanes
104 };
105 
106 struct ad9265_dev {
107  /* SPI */
109 };
110 
111 /******************************************************************************/
112 /************************ Functions Declarations ******************************/
113 /******************************************************************************/
114 int32_t ad9265_testmode_set(struct ad9265_dev *dev,
115  uint8_t mode);
116 int32_t ad9265_setup(struct ad9265_dev **device,
118  struct axi_adc core);
119 int32_t ad9265_remove(struct ad9265_dev *dev);
120 int32_t ad9265_calibrate(struct ad9265_dev *dev,
122  struct axi_adc core);
123 int32_t ad9265_outputmode_set(struct ad9265_dev *dev,
124  uint8_t mode);
125 int32_t ad9265_spi_write(struct ad9265_dev *dev,
126  uint16_t reg_addr,
127  uint8_t reg_data);
128 int32_t ad9265_spi_read(struct ad9265_dev *dev,
129  uint16_t reg_addr,
130  uint8_t *reg_data);
131 #endif
axi_adc_core.h
Driver for the Analog Devices AXI-ADC-CORE module.
ad9265_calibrate
int32_t ad9265_calibrate(struct ad9265_dev *dev, struct ad9265_init_param init_param, struct axi_adc core)
ad9265_calibrate
Definition: ad9265.c:124
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
ad9265_remove
int32_t ad9265_remove(struct ad9265_dev *dev)
ad9265_remove
Definition: ad9265.c:326
ad9265_init_param::dco_en
uint8_t dco_en
Definition: ad9265.h:102
no_os_spi.h
Header file of SPI Interface.
AD9265_REG_TEST_IO
#define AD9265_REG_TEST_IO
Definition: ad9265.h:58
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
no_os_delay.h
Header file of Delay functions.
ad9265_calibrate
int32_t ad9265_calibrate(struct ad9265_dev *dev, struct ad9265_init_param init_param, struct axi_adc core)
ad9265_calibrate
Definition: ad9265.c:124
axi_adc
AXI ADC Device Descriptor.
Definition: axi_adc_core.h:125
AD9265_CHIP_ID
#define AD9265_CHIP_ID
Definition: ad9265.h:90
device
Definition: ad9361_util.h:75
AXI_ADC_ENABLE
#define AXI_ADC_ENABLE
Definition: axi_adc_core.h:90
OUTPUT_EVEN_ODD_MODE_EN
#define OUTPUT_EVEN_ODD_MODE_EN
Definition: ad9265.h:87
ad9265_init_param::dco
uint8_t dco
Definition: ad9265.h:101
AD9265_REG_OUTPUT_PHASE
#define AD9265_REG_OUTPUT_PHASE
Definition: ad9265.h:63
OUTPUT_MODE_TWOS_COMPLEMENT
#define OUTPUT_MODE_TWOS_COMPLEMENT
Definition: ad9265.h:83
ad9265_remove
int32_t ad9265_remove(struct ad9265_dev *dev)
ad9265_remove
Definition: ad9265.c:326
ad9265_testmode_set
int32_t ad9265_testmode_set(struct ad9265_dev *dev, uint8_t mode)
ad9265_setup
Definition: ad9265.c:112
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
AXI_ADC_PN_OOS
#define AXI_ADC_PN_OOS
Definition: axi_adc_core.h:94
ad9265_spi_read
int32_t ad9265_spi_read(struct ad9265_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9265_spi_read
Definition: ad9265.c:53
AD9265_REG_CHIP_ID
#define AD9265_REG_CHIP_ID
Definition: ad9265.h:53
ad9265_init_param
Definition: ad9265.h:96
axi_adc_idelay_set
void axi_adc_idelay_set(struct axi_adc *adc, uint32_t lane, uint32_t val)
Set input/output delay primitive for specific interface line.
Definition: axi_adc_core.c:168
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
TESTMODE_OFF
#define TESTMODE_OFF
Definition: ad9265.h:72
ad9265_outputmode_set
int32_t ad9265_outputmode_set(struct ad9265_dev *dev, uint8_t mode)
ad9265_setup
Definition: ad9265.c:94
AD9265_DEF_OUTPUT_MODE
#define AD9265_DEF_OUTPUT_MODE
Definition: ad9265.h:91
AXI_ADC_REG_CHAN_STATUS
#define AXI_ADC_REG_CHAN_STATUS(c)
Definition: axi_adc_core.h:92
ad9265_outputmode_set
int32_t ad9265_outputmode_set(struct ad9265_dev *dev, uint8_t mode)
ad9265_setup
Definition: ad9265.c:94
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
ad9265_dev::spi_desc
no_os_spi_desc * spi_desc
Definition: ad9265.h:108
ad9265_setup
int32_t ad9265_setup(struct ad9265_dev **device, struct ad9265_init_param init_param, struct axi_adc core)
ad9265_setup
Definition: ad9265.c:286
ad9265_spi_write
int32_t ad9265_spi_write(struct ad9265_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9265_spi_write
Definition: ad9265.c:74
ad9265_spi_read
int32_t ad9265_spi_read(struct ad9265_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9265_spi_read
Definition: ad9265.c:53
ad9265_dev
Definition: ad9265.h:106
ad9265_setup
int32_t ad9265_setup(struct ad9265_dev **device, struct ad9265_init_param init_param, struct axi_adc core)
ad9265_setup
Definition: ad9265.c:286
ad9265_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad9265.h:98
ad9265.h
Header file of AD9265 Driver.
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
AD9265_REG_OUTPUT_DELAY
#define AD9265_REG_OUTPUT_DELAY
Definition: ad9265.h:64
TRANSFER_SYNC
#define TRANSFER_SYNC
Definition: ad9265.h:69
ad9265_init_param::output_mode
uint8_t output_mode
Definition: ad9265.h:100
TESTMODE_PN9_SEQ
#define TESTMODE_PN9_SEQ
Definition: ad9265.h:78
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
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
ad9265_spi_write
int32_t ad9265_spi_write(struct ad9265_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9265_spi_write
Definition: ad9265.c:74
AD9265_REG_TRANSFER
#define AD9265_REG_TRANSFER
Definition: ad9265.h:56
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_ADC_PN_ERR
#define AXI_ADC_PN_ERR
Definition: axi_adc_core.h:93
AXI_ADC_DDR_EDGESEL
#define AXI_ADC_DDR_EDGESEL
Definition: axi_adc_core.h:57
AD9265_REG_OUTPUT_MODE
#define AD9265_REG_OUTPUT_MODE
Definition: ad9265.h:61
ad9265_testmode_set
int32_t ad9265_testmode_set(struct ad9265_dev *dev, uint8_t mode)
ad9265_setup
Definition: ad9265.c:112
AXI_ADC_PN9
@ AXI_ADC_PN9
Definition: axi_adc_core.h:152
ad9265_init_param::nb_lanes
uint8_t nb_lanes
Definition: ad9265.h:103
chip_id
chip_id
Definition: ad9172.h:57
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112
AXI_ADC_REG_CNTRL
#define AXI_ADC_REG_CNTRL
Definition: axi_adc_core.h:55