no-OS
ad9083.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef __AD9083_H__
40 #define __AD9083_H__
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 #include "no_os_gpio.h"
46 #include "no_os_spi.h"
47 #include "adi_ad9083.h"
48 
49 /******************************************************************************/
50 /*************************** Types Declarations *******************************/
51 /******************************************************************************/
52 
58  /* SPI */
60  /* GPIO reset */
62  /* GPIO power down */
64  /* Settings selection */
65  uint8_t uc;
66  /* jesd receive clock */
68 };
69 
74 struct ad9083_phy {
75  /* SPI */
77  /* GPIO */
79  /* GPIO power down */
81  /* GPIO reference selection */
83  /* adi ad9083 device*/
84  adi_ad9083_device_t adi_ad9083;
85 };
86 
87 /******************************************************************************/
88 /************************ Functions Declarations ******************************/
89 /******************************************************************************/
90 /* Initialize the device. */
91 int32_t ad9083_init(struct ad9083_phy **device,
93 
94 /* Remove the device. */
95 int32_t ad9083_remove(struct ad9083_phy *device);
96 
97 /* Read device register. */
98 int32_t ad9083_reg_get(struct ad9083_phy *device, uint32_t reg,
99  uint8_t *readval);
100 
101 /* Write device register. */
102 int32_t ad9083_reg_set(struct ad9083_phy *device, uint32_t reg,
103  uint8_t writeval);
104 
105 #endif // __AD9083_H__
MAX_REG_ADDR
#define MAX_REG_ADDR
Definition: ad9083.c:73
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
ad9083_init_param::jesd_rx_clk
struct no_os_clk * jesd_rx_clk
Definition: ad9083.h:67
rterm
uint8_t rterm[]
Definition: uc_settings.c:65
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
no_os_spi.h
Header file of SPI Interface.
ad9083_reg_get
int32_t ad9083_reg_get(struct ad9083_phy *device, uint32_t reg, uint8_t *readval)
Read register.
Definition: ad9083.c:87
no_os_delay.h
Header file of Delay functions.
uc_settings
Definition: uc_settings.h:47
uc_settings::rterm
uint8_t * rterm
Definition: uc_settings.h:55
no_os_clk
Definition: no_os_clk.h:59
ad9083_init_param::uc
uint8_t uc
Definition: ad9083.h:65
device
Definition: ad9361_util.h:75
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
no_os_print_log.h
Print messages helpers.
ad9083_reset_pin_ctrl
int32_t ad9083_reset_pin_ctrl(void *user_data, uint8_t enable)
Definition: ad9083.c:222
uc_settings::vmax
uint32_t * vmax
Definition: uc_settings.h:51
adi_ad9083_jtx_startup
int32_t adi_ad9083_jtx_startup(adi_ad9083_device_t *device, adi_cms_jesd_param_t *jtx_param)
uc_settings::clk_hz
uint64_t(* clk_hz)[3]
Definition: uc_settings.h:49
en_hp
uint32_t en_hp[]
Definition: uc_settings.c:79
no_os_clk.h
Header file of Clock Driver.
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: delay.c:130
no_os_clk_enable
int32_t no_os_clk_enable(struct no_os_clk *clk)
get_uc_settings
struct uc_settings * get_uc_settings()
Get use case settings.
Definition: uc_settings.c:196
no_os_error.h
Error codes definition.
ad9083_reg_get
int32_t ad9083_reg_get(struct ad9083_phy *device, uint32_t reg, uint8_t *readval)
Read register.
Definition: ad9083.c:87
uc_settings.h
Use Case Settings of AD9083 project.
uc_settings::decimation
uint8_t(* decimation)[4]
Definition: uc_settings.h:65
SPI_IN_OUT_BUFF_SZ
#define SPI_IN_OUT_BUFF_SZ
Definition: ad9083.c:72
clk_hz
uint64_t clk_hz[][3]
Definition: uc_settings.c:22
ad9083_init
int32_t ad9083_init(struct ad9083_phy **device, struct ad9083_init_param *init_param)
Definition: ad9083.c:342
ad9083_init_param::spi_init
no_os_spi_init_param * spi_init
Definition: ad9083.h:59
ad9083_phy
Structure holding ad9083 descriptor.
Definition: ad9083.h:74
ad9083_init_param
Structure holding the parameters for ad9083 initialization.
Definition: ad9083.h:57
uc_settings::finmax
uint32_t * finmax
Definition: uc_settings.h:61
ad9083_init
int32_t ad9083_init(struct ad9083_phy **device, struct ad9083_init_param *init_param)
Definition: ad9083.c:342
ad9083.h
Header file of ad9083 Driver.
ad9083_phy::gpio_reset
no_os_gpio_desc * gpio_reset
Definition: ad9083.h:78
fc
uint32_t fc[]
Definition: uc_settings.c:51
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:95
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
SPI_READ
#define SPI_READ
Definition: ad9083.c:74
adi_ad9083_jesd_tx_link_digital_reset
int32_t adi_ad9083_jesd_tx_link_digital_reset(adi_ad9083_device_t *device, uint8_t reset)
finmax
uint32_t finmax[]
Definition: uc_settings.c:107
jtx_param
adi_cms_jesd_param_t jtx_param[]
Definition: uc_settings.c:163
uc_settings::nco0_datapath_mode
uint8_t * nco0_datapath_mode
Definition: uc_settings.h:67
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
uc_settings::en_hp
uint32_t * en_hp
Definition: uc_settings.h:57
CHIPID_MASK
#define CHIPID_MASK
Definition: ad9083.c:71
ad9083_phy::gpio_pd
no_os_gpio_desc * gpio_pd
Definition: ad9083.h:80
uc_settings::jtx_param
adi_cms_jesd_param_t * jtx_param
Definition: uc_settings.h:71
nco0_datapath_mode
uint8_t nco0_datapath_mode[]
Definition: uc_settings.c:148
ad9083_phy::adi_ad9083
adi_ad9083_device_t adi_ad9083
Definition: ad9083.h:84
backoff
uint32_t backoff[]
Definition: uc_settings.c:93
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: delay.c:118
ad9083_init_param::gpio_reset
no_os_gpio_init_param * gpio_reset
Definition: ad9083.h:61
ad9083_remove
int32_t ad9083_remove(struct ad9083_phy *dev)
Free the resources allocated by ad9083_init().
Definition: ad9083.c:439
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:160
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:96
ad9083_phy::spi_desc
no_os_spi_desc * spi_desc
Definition: ad9083.h:76
ad9083_log_write
int32_t ad9083_log_write(void *user_data, int32_t log_type, const char *message, va_list argp)
Definition: ad9083.c:172
uc_settings::nco_freq_hz
uint64_t(* nco_freq_hz)[3]
Definition: uc_settings.h:63
vmax
uint32_t vmax[]
Definition: uc_settings.c:37
ad9083_reg_set
int32_t ad9083_reg_set(struct ad9083_phy *device, uint32_t reg, uint8_t writeval)
Write register.
Definition: ad9083.c:112
nco_freq_hz
uint64_t nco_freq_hz[][3]
Definition: uc_settings.c:120
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
uc_settings::backoff
uint32_t * backoff
Definition: uc_settings.h:59
no_os_gpio.h
Header file of GPIO Interface.
ad9083_init_param::gpio_pd
no_os_gpio_init_param * gpio_pd
Definition: ad9083.h:63
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
no_os_util.h
Implementation of utility functions.
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:124
decimation
uint8_t decimation[][4]
Definition: uc_settings.c:134
ad9083_phy::gpio_ref_sel
no_os_gpio_desc * gpio_ref_sel
Definition: ad9083.h:82
ad9083_reg_set
int32_t ad9083_reg_set(struct ad9083_phy *device, uint32_t reg, uint8_t writeval)
Write register.
Definition: ad9083.c:112
errno.h
Error macro definition for ARM Compiler.
uc_settings::fc
uint32_t * fc
Definition: uc_settings.h:53
CHIPID_AD9083
#define CHIPID_AD9083
Definition: ad9083.c:70
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
SPI_SDIO
@ SPI_SDIO
Definition: api_def.h:188
ad9083_remove
int32_t ad9083_remove(struct ad9083_phy *device)
Free the resources allocated by ad9083_init().
Definition: ad9083.c:439
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75