no-OS
ad9083.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef __AD9083_H__
34 #define __AD9083_H__
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 #include "no_os_gpio.h"
40 #include "no_os_spi.h"
41 #include "adi_ad9083.h"
42 
43 /******************************************************************************/
44 /*************************** Types Declarations *******************************/
45 /******************************************************************************/
46 
52  /* SPI */
54  /* GPIO reset */
56  /* GPIO power down */
58  /* Settings selection */
59  uint8_t uc;
60  /* jesd receive clock */
62 };
63 
68 struct ad9083_phy {
69  /* SPI */
71  /* GPIO */
73  /* GPIO power down */
75  /* GPIO reference selection */
77  /* adi ad9083 device*/
78  adi_ad9083_device_t adi_ad9083;
79 };
80 
81 /******************************************************************************/
82 /************************ Functions Declarations ******************************/
83 /******************************************************************************/
84 /* Initialize the device. */
85 int32_t ad9083_init(struct ad9083_phy **device,
87 
88 /* Remove the device. */
89 int32_t ad9083_remove(struct ad9083_phy *device);
90 
91 /* Read device register. */
92 int32_t ad9083_reg_get(struct ad9083_phy *device, uint32_t reg,
93  uint8_t *readval);
94 
95 /* Write device register. */
96 int32_t ad9083_reg_set(struct ad9083_phy *device, uint32_t reg,
97  uint8_t writeval);
98 
99 #endif // __AD9083_H__
MAX_REG_ADDR
#define MAX_REG_ADDR
Definition: ad9083.c:68
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ad9083_init_param::jesd_rx_clk
struct no_os_clk * jesd_rx_clk
Definition: ad9083.h:61
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:159
no_os_spi.h
Header file of SPI Interface.
ad9083_phy::gpio_ref_sel
struct no_os_gpio_desc * gpio_ref_sel
Definition: ad9083.h:76
ad9083_reg_get
int32_t ad9083_reg_get(struct ad9083_phy *device, uint32_t reg, uint8_t *readval)
Read register.
Definition: ad9083.c:82
no_os_delay.h
Header file of Delay functions.
uc_settings
Definition: uc_settings.h:41
uc_settings::rterm
uint8_t * rterm
Definition: uc_settings.h:49
no_os_clk_enable
int32_t no_os_clk_enable(struct no_os_clk_desc *desc)
no_os_clk
Definition: no_os_clk.h:64
ad9083_init_param::uc
uint8_t uc
Definition: ad9083.h:59
device
Definition: ad9361_util.h:69
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
no_os_print_log.h
Print messages helpers.
ad9083_init_param::spi_init
struct no_os_spi_init_param * spi_init
Definition: ad9083.h:53
ad9083_reset_pin_ctrl
int32_t ad9083_reset_pin_ctrl(void *user_data, uint8_t enable)
Definition: ad9083.c:217
uc_settings::vmax
uint32_t * vmax
Definition: uc_settings.h:45
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
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:43
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: aducm3029_delay.c:126
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:82
uc_settings.h
Use Case Settings of AD9083 project.
uc_settings::decimation
uint8_t(* decimation)[4]
Definition: uc_settings.h:59
SPI_IN_OUT_BUFF_SZ
#define SPI_IN_OUT_BUFF_SZ
Definition: ad9083.c:67
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:337
ad9083_phy
Structure holding ad9083 descriptor.
Definition: ad9083.h:68
ad9083_init_param
Structure holding the parameters for ad9083 initialization.
Definition: ad9083.h:51
uc_settings::finmax
uint32_t * finmax
Definition: uc_settings.h:55
ad9083_init
int32_t ad9083_init(struct ad9083_phy **device, struct ad9083_init_param *init_param)
Definition: ad9083.c:337
ad9083.h
Header file of ad9083 Driver.
ad9083_init_param::gpio_reset
struct no_os_gpio_init_param * gpio_reset
Definition: ad9083.h:55
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:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
SPI_READ
#define SPI_READ
Definition: ad9083.c:69
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:61
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
ad9083_phy::spi_desc
struct no_os_spi_desc * spi_desc
Definition: ad9083.h:70
uc_settings::en_hp
uint32_t * en_hp
Definition: uc_settings.h:51
CHIPID_MASK
#define CHIPID_MASK
Definition: ad9083.c:66
uc_settings::jtx_param
adi_cms_jesd_param_t * jtx_param
Definition: uc_settings.h:65
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:78
backoff
uint32_t backoff[]
Definition: uc_settings.c:93
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
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
ad9083_init_param::gpio_pd
struct no_os_gpio_init_param * gpio_pd
Definition: ad9083.h:57
ad9083_remove
int32_t ad9083_remove(struct ad9083_phy *dev)
Free the resources allocated by ad9083_init().
Definition: ad9083.c:434
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:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
ad9083_log_write
int32_t ad9083_log_write(void *user_data, int32_t log_type, const char *message, va_list argp)
Definition: ad9083.c:167
ad9083_phy::gpio_reset
struct no_os_gpio_desc * gpio_reset
Definition: ad9083.h:72
uc_settings::nco_freq_hz
uint64_t(* nco_freq_hz)[3]
Definition: uc_settings.h:57
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:107
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:116
uc_settings::backoff
uint32_t * backoff
Definition: uc_settings.h:53
no_os_gpio.h
Header file of GPIO Interface.
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
no_os_util.h
Header file 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:147
decimation
uint8_t decimation[][4]
Definition: uc_settings.c:134
ad9083_phy::gpio_pd
struct no_os_gpio_desc * gpio_pd
Definition: ad9083.h:74
ad9083_reg_set
int32_t ad9083_reg_set(struct ad9083_phy *device, uint32_t reg, uint8_t writeval)
Write register.
Definition: ad9083.c:107
errno.h
Error macro definition for ARM Compiler.
uc_settings::fc
uint32_t * fc
Definition: uc_settings.h:47
CHIPID_AD9083
#define CHIPID_AD9083
Definition: ad9083.c:65
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
SPI_SDIO
@ SPI_SDIO
Definition: api_def.h:187
ad9083_remove
int32_t ad9083_remove(struct ad9083_phy *device)
Free the resources allocated by ad9083_init().
Definition: ad9083.c:434
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