no-OS
ad9656.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef AD9656_H_
34 #define AD9656_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "no_os_spi.h"
40 
41 /******************************************************************************/
42 /********************** Macros and Constants Definitions **********************/
43 /******************************************************************************/
44 #define AD9656_SPI_CONFIG 0x000
45 #define AD9656_REG_CHIP_ID 0x001
46 #define AD9656_REG_DEVICE_INDEX 0x005
47 #define AD9656_REG_ADC_TEST_MODE 0x00D
48 #define AD9656_REG_OUTPUT_MODE 0x014
49 #define AD9656_REG_USER_TEST_PATTERN_1_LSB 0x19
50 #define AD9656_REG_USER_TEST_PATTERN_1_MSB 0x1A
51 #define AD9656_REG_USER_TEST_PATTERN_2_LSB 0x1B
52 #define AD9656_REG_USER_TEST_PATTERN_2_MSB 0x1C
53 #define AD9656_REG_LINK_CONTROL 0x05F
54 #define AD9656_REG_JESD204B_LANE_RATE_CTRL 0x021
55 #define AD9656_REG_JESD204B_PLL_LOCK_STATUS 0x00A
56 #define AD9656_REG_JESD204B_QUICK_CONFIG 0x05E
57 #define AD9656_REG_JESD204B_SCR_L 0x06E
58 #define AD9656_REG_JESD204B_MF_CTRL 0x070
59 #define AD9656_REG_JESD204B_M_CTRL 0x071
60 #define AD9656_REG_JESD204B_CSN_CONFIG 0x072
61 #define AD9656_REG_JESD204B_SUBCLASS_CONFIG 0x073
62 #define AD9656_REG_JESD204B_LANE_SERD_OUT1_OUT0_ASSIGN 0x082
63 #define AD9656_REG_JESD204B_LANE_SERD_OUT3_OUT2_ASSIGN 0x083
64 
65 #define AD9656_CHIP_ID 0x0C0
66 #define AD9656_TEST_OFF 0x000
67 #define AD9656_TEST_PN9 0x006
68 #define AD9656_TEST_PN23 0x005
69 #define AD9656_TEST_USER_INPUT 0x048
70 #define AD9656_FORMAT_2S_COMPLEMENT 0x001
71 #define AD9656_FORMAT_OFFSET_BINARY 0x000
72 
73 /******************************************************************************/
74 /*************************** Types Declarations *******************************/
75 /******************************************************************************/
76 struct ad9656_dev {
77  /* SPI */
79 };
80 
82  /* SPI */
84  /* Device Settings */
85  uint32_t lane_rate_kbps;
86 };
87 
89  /* User input test pattern 1 */
91  /* User input test pattern 2 */
93 };
94 
95 /******************************************************************************/
96 /************************ Functions Declarations ******************************/
97 /******************************************************************************/
98 
99 int32_t ad9656_reg_read(struct ad9656_dev *dev,
100  uint16_t reg_addr,
101  uint8_t *reg_data);
102 
103 int32_t ad9656_reg_write(struct ad9656_dev *dev,
104  uint16_t reg_addr,
105  uint8_t reg_data);
106 
107 int32_t ad9656_setup(struct ad9656_dev **device,
108  const struct ad9656_init_param *init_param);
109 
110 int32_t ad9656_remove(struct ad9656_dev *dev);
111 
112 int32_t ad9656_JESD204_test(struct ad9656_dev *dev,
113  uint32_t test_mode);
114 
115 int32_t ad9656_user_input_test(struct ad9656_dev *dev, uint32_t test_mode,
116  struct ad9656_user_input_test_pattern user_input_test_pattern);
117 
118 #endif
AD9656_REG_JESD204B_SCR_L
#define AD9656_REG_JESD204B_SCR_L
Definition: ad9656.h:57
no_os_alloc.h
ad9656_remove
int32_t ad9656_remove(struct ad9656_dev *dev)
Free the resources allocated by ad9656_setup().
Definition: ad9656.c:281
AD9656_REG_JESD204B_CSN_CONFIG
#define AD9656_REG_JESD204B_CSN_CONFIG
Definition: ad9656.h:60
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:159
no_os_spi.h
Header file of SPI Interface.
AD9656_REG_JESD204B_MF_CTRL
#define AD9656_REG_JESD204B_MF_CTRL
Definition: ad9656.h:58
ad9656_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9656.h:78
no_os_delay.h
Header file of Delay functions.
device
Definition: ad9361_util.h:69
AD9656_FORMAT_2S_COMPLEMENT
#define AD9656_FORMAT_2S_COMPLEMENT
Definition: ad9656.h:70
ad9656_user_input_test_pattern::user_test_pattern1
uint16_t user_test_pattern1
Definition: ad9656.h:90
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
AD9656_REG_USER_TEST_PATTERN_2_LSB
#define AD9656_REG_USER_TEST_PATTERN_2_LSB
Definition: ad9656.h:51
AD9656_CHIP_ID
#define AD9656_CHIP_ID
Definition: ad9656.h:65
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
AD9656_FORMAT_OFFSET_BINARY
#define AD9656_FORMAT_OFFSET_BINARY
Definition: ad9656.h:71
no_os_error.h
Error codes definition.
ad9656_reg_read
int32_t ad9656_reg_read(struct ad9656_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9656 that is contected to the SPI.
Definition: ad9656.c:52
AD9656_REG_JESD204B_PLL_LOCK_STATUS
#define AD9656_REG_JESD204B_PLL_LOCK_STATUS
Definition: ad9656.h:55
AD9656_REG_ADC_TEST_MODE
#define AD9656_REG_ADC_TEST_MODE
Definition: ad9656.h:47
AD9656_REG_OUTPUT_MODE
#define AD9656_REG_OUTPUT_MODE
Definition: ad9656.h:48
AD9656_REG_JESD204B_SUBCLASS_CONFIG
#define AD9656_REG_JESD204B_SUBCLASS_CONFIG
Definition: ad9656.h:61
ad9656_init_param::lane_rate_kbps
uint32_t lane_rate_kbps
Definition: ad9656.h:85
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
AD9656_SPI_CONFIG
#define AD9656_SPI_CONFIG
Definition: ad9656.h:44
AD9656_REG_USER_TEST_PATTERN_1_MSB
#define AD9656_REG_USER_TEST_PATTERN_1_MSB
Definition: ad9656.h:50
ad9656_user_input_test_pattern
Definition: ad9656.h:88
ad9656_user_input_test_pattern::user_test_pattern2
uint16_t user_test_pattern2
Definition: ad9656.h:92
ad9656_user_input_test
int32_t ad9656_user_input_test(struct ad9656_dev *dev, uint32_t test_mode, struct ad9656_user_input_test_pattern user_input_test_pattern)
Launch the user input test functionality for the receive path for the ad9656 chip....
Definition: ad9656.c:141
ad9656_dev
Definition: ad9656.h:76
ad9656_init_param
Definition: ad9656.h:81
ad9656_setup
int32_t ad9656_setup(struct ad9656_dev **device, const struct ad9656_init_param *init_param)
Setup the working parameters of the ad9656 chip.
Definition: ad9656.c:177
ad9656_reg_write
int32_t ad9656_reg_write(struct ad9656_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9656 that is conected to the SPI.
Definition: ad9656.c:85
no_os_free
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
ad9656.h
Header file of AD9656 Driver.
ad9656_JESD204_test
int32_t ad9656_JESD204_test(struct ad9656_dev *dev, uint32_t test_mode)
Launch the JESD204 test functionality for the receive path for the ad9656 chip.
Definition: ad9656.c:112
AD9656_REG_USER_TEST_PATTERN_1_LSB
#define AD9656_REG_USER_TEST_PATTERN_1_LSB
Definition: ad9656.h:49
AD9656_TEST_OFF
#define AD9656_TEST_OFF
Definition: ad9656.h:66
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
AD9656_REG_JESD204B_QUICK_CONFIG
#define AD9656_REG_JESD204B_QUICK_CONFIG
Definition: ad9656.h:56
AD9656_REG_CHIP_ID
#define AD9656_REG_CHIP_ID
Definition: ad9656.h:45
ad9656_reg_read
int32_t ad9656_reg_read(struct ad9656_dev *dev, uint16_t reg_addr, uint8_t *reg_data)
Reads from the ad9656 that is contected to the SPI.
Definition: ad9656.c:52
AD9656_REG_JESD204B_LANE_RATE_CTRL
#define AD9656_REG_JESD204B_LANE_RATE_CTRL
Definition: ad9656.h:54
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:116
ad9656_user_input_test
int32_t ad9656_user_input_test(struct ad9656_dev *dev, uint32_t test_mode, struct ad9656_user_input_test_pattern user_input_test_pattern)
Launch the user input test functionality for the receive path for the ad9656 chip....
Definition: ad9656.c:141
ad9656_JESD204_test
int32_t ad9656_JESD204_test(struct ad9656_dev *dev, uint32_t test_mode)
Launch the JESD204 test functionality for the receive path for the ad9656 chip.
Definition: ad9656.c:112
ad9656_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9656.h:83
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:52
AD9656_REG_JESD204B_M_CTRL
#define AD9656_REG_JESD204B_M_CTRL
Definition: ad9656.h:59
ad9656_setup
int32_t ad9656_setup(struct ad9656_dev **device, const struct ad9656_init_param *init_param)
Setup the working parameters of the ad9656 chip.
Definition: ad9656.c:177
ad9656_remove
int32_t ad9656_remove(struct ad9656_dev *dev)
Free the resources allocated by ad9656_setup().
Definition: ad9656.c:281
ad9656_reg_write
int32_t ad9656_reg_write(struct ad9656_dev *dev, uint16_t reg_addr, uint8_t reg_data)
Write to the ad9656 that is conected to the SPI.
Definition: ad9656.c:85
AD9656_REG_LINK_CONTROL
#define AD9656_REG_LINK_CONTROL
Definition: ad9656.h:53
AD9656_REG_USER_TEST_PATTERN_2_MSB
#define AD9656_REG_USER_TEST_PATTERN_2_MSB
Definition: ad9656.h:52
chip_id
chip_id
Definition: ad9172.h:51
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140