no-OS
ad9680.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef AD9680_H_
40 #define AD9680_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 AD9680_REG_INTERFACE_CONF_A 0x000
53 #define AD9680_REG_INTERFACE_CONF_B 0x001
54 #define AD9680_REG_CHIP_ID_LOW 0x004
55 #define AD9680_REG_CHIP_ID_HIGH 0x005
56 #define AD9680_REG_DEVICE_INDEX 0x008
57 #define AD9680_REG_CHIP_DEC_RATIO 0x201
58 #define AD9680_REG_ADC_TEST_MODE 0x550
59 #define AD9680_REG_OUTPUT_MODE 0x561
60 #define AD9680_REG_LINK_CONTROL 0x571
61 #define AD9680_REG_JESD204B_LANE_RATE_CTRL 0x56e
62 #define AD9680_REG_JESD204B_PLL_LOCK_STATUS 0x56f
63 #define AD9680_REG_JESD204B_QUICK_CONFIG 0x570
64 #define AD9680_REG_JESD204B_MF_CTRL 0x58d
65 #define AD9680_REG_JESD204B_CSN_CONFIG 0x58f
66 #define AD9680_REG_JESD204B_SUBCLASS_CONFIG 0x590
67 #define AD9680_REG_JESD204B_LANE_SERD_OUT0_ASSIGN 0x5b2
68 #define AD9680_REG_JESD204B_LANE_SERD_OUT1_ASSIGN 0x5b3
69 #define AD9680_REG_JESD204B_LANE_SERD_OUT2_ASSIGN 0x5b5
70 #define AD9680_REG_JESD204B_LANE_SERD_OUT3_ASSIGN 0x5b6
71 
72 #define AD9680_CHIP_ID 0x0C5
73 #define AD9680_TEST_OFF 0x000
74 #define AD9680_TEST_PN9 0x006
75 #define AD9680_TEST_PN23 0x005
76 #define AD9680_TEST_RAMP 0x00f
77 #define AD9680_FORMAT_2S_COMPLEMENT 0x001
78 #define AD9680_FORMAT_OFFSET_BINARY 0x000
79 
80 /******************************************************************************/
81 /*************************** Types Declarations *******************************/
82 /******************************************************************************/
83 struct ad9680_dev {
84  /* SPI */
86 };
87 
89  /* SPI */
91  /* Device Settings */
92  uint32_t lane_rate_kbps;
93 };
94 
95 /******************************************************************************/
96 /************************ Functions Declarations ******************************/
97 /******************************************************************************/
98 
99 int32_t ad9680_spi_read(struct ad9680_dev *dev,
100  uint16_t reg_addr,
101  uint8_t *reg_data);
102 
103 int32_t ad9680_spi_write(struct ad9680_dev *dev,
104  uint16_t reg_addr,
105  uint8_t reg_data);
106 
107 int32_t ad9680_setup(struct ad9680_dev **device,
108  const struct ad9680_init_param *init_param);
109 
110 int32_t ad9680_remove(struct ad9680_dev *dev);
111 
112 int32_t ad9680_test(struct ad9680_dev *dev,
113  uint32_t test_mode);
114 
115 #endif
AD9680_REG_JESD204B_QUICK_CONFIG
#define AD9680_REG_JESD204B_QUICK_CONFIG
Definition: ad9680.h:63
ad9680_init_param::lane_rate_kbps
uint32_t lane_rate_kbps
Definition: ad9680.h:92
ad9680_spi_read
int32_t ad9680_spi_read(struct ad9680_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9680_spi_read
Definition: ad9680.c:50
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
AD9680_CHIP_ID
#define AD9680_CHIP_ID
Definition: ad9680.h:72
no_os_spi.h
Header file of SPI Interface.
AD9680_REG_JESD204B_PLL_LOCK_STATUS
#define AD9680_REG_JESD204B_PLL_LOCK_STATUS
Definition: ad9680.h:62
ad9680_dev
Definition: ad9680.h:83
ad9680.h
Header file of AD9680 Driver.
AD9680_REG_JESD204B_CSN_CONFIG
#define AD9680_REG_JESD204B_CSN_CONFIG
Definition: ad9680.h:65
no_os_delay.h
Header file of Delay functions.
device
Definition: ad9361_util.h:75
AD9680_REG_LINK_CONTROL
#define AD9680_REG_LINK_CONTROL
Definition: ad9680.h:60
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
AD9680_REG_JESD204B_SUBCLASS_CONFIG
#define AD9680_REG_JESD204B_SUBCLASS_CONFIG
Definition: ad9680.h:66
AD9680_REG_INTERFACE_CONF_A
#define AD9680_REG_INTERFACE_CONF_A
Definition: ad9680.h:52
AD9680_FORMAT_OFFSET_BINARY
#define AD9680_FORMAT_OFFSET_BINARY
Definition: ad9680.h:78
ad9680_spi_write
int32_t ad9680_spi_write(struct ad9680_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9680_spi_write
Definition: ad9680.c:73
ad9680_init_param::spi_init
no_os_spi_init_param spi_init
Definition: ad9680.h:90
ad9680_spi_write
int32_t ad9680_spi_write(struct ad9680_dev *dev, uint16_t reg_addr, uint8_t reg_data)
ad9680_spi_write
Definition: ad9680.c:73
ad9680_remove
int32_t ad9680_remove(struct ad9680_dev *dev)
Free the resources allocated by ad9680_setup().
Definition: ad9680.c:193
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
AD9680_REG_JESD204B_MF_CTRL
#define AD9680_REG_JESD204B_MF_CTRL
Definition: ad9680.h:64
AD9680_TEST_OFF
#define AD9680_TEST_OFF
Definition: ad9680.h:73
AD9680_REG_JESD204B_LANE_RATE_CTRL
#define AD9680_REG_JESD204B_LANE_RATE_CTRL
Definition: ad9680.h:61
AD9680_FORMAT_2S_COMPLEMENT
#define AD9680_FORMAT_2S_COMPLEMENT
Definition: ad9680.h:77
AD9680_REG_OUTPUT_MODE
#define AD9680_REG_OUTPUT_MODE
Definition: ad9680.h:59
ad9680_spi_read
int32_t ad9680_spi_read(struct ad9680_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
ad9680_spi_read
Definition: ad9680.c:50
ad9680_dev::spi_desc
no_os_spi_desc * spi_desc
Definition: ad9680.h:85
ad9680_remove
int32_t ad9680_remove(struct ad9680_dev *dev)
Free the resources allocated by ad9680_setup().
Definition: ad9680.c:193
ad9680_init_param
Definition: ad9680.h:88
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ad9680_setup
int32_t ad9680_setup(struct ad9680_dev **device, const struct ad9680_init_param *init_param)
ad9680_setup
Definition: ad9680.c:115
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
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
ad9680_test
int32_t ad9680_test(struct ad9680_dev *dev, uint32_t test_mode)
ad9680_setup
Definition: ad9680.c:95
ad9680_test
int32_t ad9680_test(struct ad9680_dev *dev, uint32_t test_mode)
ad9680_setup
Definition: ad9680.c:95
AD9680_REG_ADC_TEST_MODE
#define AD9680_REG_ADC_TEST_MODE
Definition: ad9680.h:58
ad9680_setup
int32_t ad9680_setup(struct ad9680_dev **device, const struct ad9680_init_param *init_param)
ad9680_setup
Definition: ad9680.c:115
AD9680_REG_CHIP_ID_LOW
#define AD9680_REG_CHIP_ID_LOW
Definition: ad9680.h:54
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