no-OS
ad9625.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef AD9625_H_
34 #define AD9625_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include <stdint.h>
40 #include "no_os_delay.h"
41 #include "no_os_spi.h"
42 
43 /******************************************************************************/
44 /********************** Macros and Constants Definitions **********************/
45 /******************************************************************************/
46 #define AD9625_REG_CHIP_PORT_CONF 0x000
47 #define AD9625_REG_CHIP_ID 0x001
48 #define AD9625_REG_POWER_MODE 0x008
49 #define AD9625_REG_PLL_STATUS 0x00A
50 #define AD9625_REG_TEST_CNTRL 0x00D
51 #define AD9625_REG_OUTPUT_MODE 0x014
52 #define AD9625_REG_OUTPUT_ADJUST 0x015
53 #define AD9625_REG_SYSREF_CONTROL 0x03A
54 #define AD9625_REG_JESD204B_LINK_CNTRL_1 0x05F
55 #define AD9625_REG_JESD204B_CONFIGURATION 0x072
56 #define AD9625_REG_JESD204B_LANE_POWER_MODE 0x080
57 #define AD9625_REG_TRANSFER 0x0FF
58 #define AD9625_REG_IRQ_STATUS 0x100
59 #define AD9625_REG_DIVCLK_OUT_CNTRL 0x120
60 #define AD9625_REG_SYSREF_SETUP_TIME_GUARDBAND 0x13C
61 
62 #define AD9625_CHIP_ID 0x041
63 
64 #define AD9625_TEST_OFF 0x000
65 #define AD9625_TEST_MID_SCALE 0x001
66 #define AD9625_TEST_POS_FSCALE 0x002
67 #define AD9625_TEST_NEG_FSCALE 0x003
68 #define AD9625_TEST_CHECKBOARD 0x004
69 #define AD9625_TEST_PNLONG 0x005
70 #define AD9625_TEST_ONE2ZERO 0x007
71 #define AD9625_TEST_PATTERN 0x008
72 #define AD9625_TEST_RAMP 0x00F
73 
74 /******************************************************************************/
75 /*************************** Types Declarations *******************************/
76 /******************************************************************************/
77 
79  /* SPI */
81  /* Device Settings */
82  uint32_t lane_rate_kbps;
83  uint32_t test_samples[4];
84 };
85 
86 struct ad9625_dev {
87  /* SPI */
89 };
90 
91 /******************************************************************************/
92 /************************ Functions Declarations ******************************/
93 /******************************************************************************/
94 int32_t ad9625_spi_read(struct ad9625_dev *dev,
95  uint16_t reg_addr,
96  uint8_t *reg_data);
97 int32_t ad9625_spi_write(struct ad9625_dev *dev,
98  uint16_t reg_addr,
99  uint8_t reg_data);
100 int32_t ad9625_setup(struct ad9625_dev **device,
102 int32_t ad9625_remove(struct ad9625_dev *dev);
103 int32_t ad9625_test(struct ad9625_dev *dev, uint32_t test_mode);
104 
105 #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:45
no_os_alloc.h
ad9625_dev::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9625.h:88
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:45
AD9625_REG_TRANSFER
#define AD9625_REG_TRANSFER
Definition: ad9625.h:57
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
AD9625_REG_CHIP_ID
#define AD9625_REG_CHIP_ID
Definition: ad9625.h:47
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:157
AD9625_REG_PLL_STATUS
#define AD9625_REG_PLL_STATUS
Definition: ad9625.h:49
ad9625_init_param::test_samples
uint32_t test_samples[4]
Definition: ad9625.h:83
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:56
ad9625_setup
int32_t ad9625_setup(struct ad9625_dev **device, struct ad9625_init_param init_param)
ad9625_setup
Definition: ad9625.c:88
device
Definition: ad9361_util.h:69
ad9625_init_param
Definition: ad9625.h:78
AD9625_REG_JESD204B_LINK_CNTRL_1
#define AD9625_REG_JESD204B_LINK_CNTRL_1
Definition: ad9625.h:54
ad9625_init_param::lane_rate_kbps
uint32_t lane_rate_kbps
Definition: ad9625.h:82
AD9625_REG_DIVCLK_OUT_CNTRL
#define AD9625_REG_DIVCLK_OUT_CNTRL
Definition: ad9625.h:59
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
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:67
AD9625_REG_POWER_MODE
#define AD9625_REG_POWER_MODE
Definition: ad9625.h:48
AD9625_REG_TEST_CNTRL
#define AD9625_REG_TEST_CNTRL
Definition: ad9625.h:50
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
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:67
AD9625_CHIP_ID
#define AD9625_CHIP_ID
Definition: ad9625.h:62
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
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
ad9625_test
int32_t ad9625_test(struct ad9625_dev *dev, uint32_t test_mode)
ad9625_test
Definition: ad9625.c:157
ad9625_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ad9625.h:80
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad9625_dev
Definition: ad9625.h:86
ad9625_setup
int32_t ad9625_setup(struct ad9625_dev **device, struct ad9625_init_param init_param)
ad9625_setup
Definition: ad9625.c:88
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
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
AD9625_REG_CHIP_PORT_CONF
#define AD9625_REG_CHIP_PORT_CONF
Definition: ad9625.h:46
AD9625_REG_OUTPUT_MODE
#define AD9625_REG_OUTPUT_MODE
Definition: ad9625.h:51
ad9625_remove
int32_t ad9625_remove(struct ad9625_dev *dev)
ad9625_remove
Definition: ad9625.c:143
AD9625_REG_OUTPUT_ADJUST
#define AD9625_REG_OUTPUT_ADJUST
Definition: ad9625.h:52
ad9625_remove
int32_t ad9625_remove(struct ad9625_dev *dev)
ad9625_remove
Definition: ad9625.c:143
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