no-OS
ad9625.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD9625_H_
40 #define AD9625_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 AD9625_REG_CHIP_PORT_CONF 0x000
53 #define AD9625_REG_CHIP_ID 0x001
54 #define AD9625_REG_POWER_MODE 0x008
55 #define AD9625_REG_PLL_STATUS 0x00A
56 #define AD9625_REG_TEST_CNTRL 0x00D
57 #define AD9625_REG_OUTPUT_MODE 0x014
58 #define AD9625_REG_OUTPUT_ADJUST 0x015
59 #define AD9625_REG_SYSREF_CONTROL 0x03A
60 #define AD9625_REG_JESD204B_LINK_CNTRL_1 0x05F
61 #define AD9625_REG_JESD204B_CONFIGURATION 0x072
62 #define AD9625_REG_JESD204B_LANE_POWER_MODE 0x080
63 #define AD9625_REG_TRANSFER 0x0FF
64 #define AD9625_REG_IRQ_STATUS 0x100
65 #define AD9625_REG_DIVCLK_OUT_CNTRL 0x120
66 #define AD9625_REG_SYSREF_SETUP_TIME_GUARDBAND 0x13C
67 
68 #define AD9625_CHIP_ID 0x041
69 
70 #define AD9625_TEST_OFF 0x000
71 #define AD9625_TEST_MID_SCALE 0x001
72 #define AD9625_TEST_POS_FSCALE 0x002
73 #define AD9625_TEST_NEG_FSCALE 0x003
74 #define AD9625_TEST_CHECKBOARD 0x004
75 #define AD9625_TEST_PNLONG 0x005
76 #define AD9625_TEST_ONE2ZERO 0x007
77 #define AD9625_TEST_PATTERN 0x008
78 #define AD9625_TEST_RAMP 0x00F
79 
80 /******************************************************************************/
81 /*************************** Types Declarations *******************************/
82 /******************************************************************************/
83 
85  /* SPI */
87  /* Device Settings */
88  uint32_t lane_rate_kbps;
89  uint32_t test_samples[4];
90 };
91 
92 struct ad9625_dev {
93  /* SPI */
95 };
96 
97 /******************************************************************************/
98 /************************ Functions Declarations ******************************/
99 /******************************************************************************/
100 int32_t ad9625_spi_read(struct ad9625_dev *dev,
101  uint16_t reg_addr,
102  uint8_t *reg_data);
103 int32_t ad9625_spi_write(struct ad9625_dev *dev,
104  uint16_t reg_addr,
105  uint8_t reg_data);
106 int32_t ad9625_setup(struct ad9625_dev **device,
108 int32_t ad9625_remove(struct ad9625_dev *dev);
109 int32_t ad9625_test(struct ad9625_dev *dev, uint32_t test_mode);
110 
111 #endif
ad9625_spi_read
int32_t ad9625_spi_read(struct ad9625_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9625_spi_read
Definition: ad9625.c:50
ad9625_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9625.h:94
ad9625_spi_read
int32_t ad9625_spi_read(struct ad9625_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9625_spi_read
Definition: ad9625.c:50
AD9625_REG_TRANSFER
#define AD9625_REG_TRANSFER
Definition: ad9625.h:63
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:83
AD9625_REG_CHIP_ID
#define AD9625_REG_CHIP_ID
Definition: ad9625.h:53
no_os_spi.h
Header file of SPI Interface.
ad9625.h
Header file of AD9625 Driver.
ad9625_test
int32_t ad9625_test(struct ad9625_dev *dev, uint32_t test_mode)
ad9625_test
Definition: ad9625.c:162
AD9625_REG_PLL_STATUS
#define AD9625_REG_PLL_STATUS
Definition: ad9625.h:55
ad9625_init_param::test_samples
uint32_t test_samples[4]
Definition: ad9625.h:89
no_os_delay.h
Header file of Delay functions.
AD9625_REG_JESD204B_LANE_POWER_MODE
#define AD9625_REG_JESD204B_LANE_POWER_MODE
Definition: ad9625.h:62
ad9625_setup
int32_t ad9625_setup(struct ad9625_dev **device, struct ad9625_init_param init_param)
ad9625_setup
Definition: ad9625.c:93
device
Definition: ad9361_util.h:75
ad9625_init_param
Definition: ad9625.h:84
AD9625_REG_JESD204B_LINK_CNTRL_1
#define AD9625_REG_JESD204B_LINK_CNTRL_1
Definition: ad9625.h:60
ad9625_init_param::lane_rate_kbps
uint32_t lane_rate_kbps
Definition: ad9625.h:88
AD9625_REG_DIVCLK_OUT_CNTRL
#define AD9625_REG_DIVCLK_OUT_CNTRL
Definition: ad9625.h:65
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:132
ad9625_spi_write
int32_t ad9625_spi_write(struct ad9625_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9625_spi_write
Definition: ad9625.c:72
AD9625_REG_POWER_MODE
#define AD9625_REG_POWER_MODE
Definition: ad9625.h:54
AD9625_REG_TEST_CNTRL
#define AD9625_REG_TEST_CNTRL
Definition: ad9625.h:56
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
ad9625_spi_write
int32_t ad9625_spi_write(struct ad9625_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9625_spi_write
Definition: ad9625.c:72
AD9625_CHIP_ID
#define AD9625_CHIP_ID
Definition: ad9625.h:68
ad9625_test
int32_t ad9625_test(struct ad9625_dev *dev, uint32_t test_mode)
ad9625_test
Definition: ad9625.c:162
ad9625_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9625.h:86
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ad9625_dev
Definition: ad9625.h:92
ad9625_setup
int32_t ad9625_setup(struct ad9625_dev **device, struct ad9625_init_param init_param)
ad9625_setup
Definition: ad9625.c:93
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:71
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
AD9625_REG_CHIP_PORT_CONF
#define AD9625_REG_CHIP_PORT_CONF
Definition: ad9625.h:52
AD9625_REG_OUTPUT_MODE
#define AD9625_REG_OUTPUT_MODE
Definition: ad9625.h:57
ad9625_remove
int32_t ad9625_remove(struct ad9625_dev *dev)
ad9625_remove
Definition: ad9625.c:148
AD9625_REG_OUTPUT_ADJUST
#define AD9625_REG_OUTPUT_ADJUST
Definition: ad9625.h:58
ad9625_remove
int32_t ad9625_remove(struct ad9625_dev *dev)
ad9625_remove
Definition: ad9625.c:148
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:121