no-OS
Classes | Enumerations | Functions
API

Classes

struct  ad917x_jesd_link_stat_t
 
struct  ad917x_handle_t
 

Enumerations

enum  ad917x_dds_select_t {
  AD917X_DDSM = 0,
  AD917X_DDSC = 1
}
 
enum  ad917x_dac_select_t {
  AD917X_DAC_NONE = 0,
  AD917X_DAC0 = 1,
  AD917X_DAC1 = 2
}
 
enum  ad917x_channel_select_t {
  AD917X_CH_NONE = 0,
  AD917X_CH_0 = NO_OS_BIT(0),
  AD917X_CH_1 = NO_OS_BIT(1),
  AD917X_CH_2 = NO_OS_BIT(2),
  AD917X_CH_3 = NO_OS_BIT(3),
  AD917X_CH_4 = NO_OS_BIT(4),
  AD917X_CH_5 = NO_OS_BIT(5)
}
 
enum  ad917x_jesd_serdes_pll_flg_t {
  AD917X_PLL_LOCK_STAT = 0x1,
  AD917X_PLL_REG_RDY = 0x2,
  AD917X_PLL_CAL_STAT = 0x4,
  AD917X_PLL_LOSSLOCK = 0x8
}
 

Functions

int32_t ad917x_init (ad917x_handle_t *h)
 Initialize AD917X Device This API must be called first before any other API calls. It performs internal API initialization of the memory and API states. If AD917X handle member hw_open is not NULL it shall call the function to which it points. This feature may be used to get and initialize the hardware resources required by the API and the AD917X devices. For example GPIO, SPI etc. More...
 
int32_t ad917x_deinit (ad917x_handle_t *h)
 De-initialize the AD917X Device. More...
 
int32_t ad917x_reset (ad917x_handle_t *h, uint8_t hw_reset)
 Reset the AD917X. More...
 
int32_t ad917x_get_chip_id (ad917x_handle_t *h, adi_chip_id_t *chip_id)
 Get Chip Identification Data. More...
 
int32_t ad917x_register_write (ad917x_handle_t *h, const uint16_t address, const uint8_t data)
 Perform SPI register write access to AD917X Device. More...
 
int32_t ad917x_register_read (ad917x_handle_t *h, const uint16_t address, uint8_t *data)
 Perform SPI register read access to AD917X Device. More...
 
int32_t ad917x_get_revision (ad917x_handle_t *h, uint8_t *rev_major, uint8_t *rev_minor, uint8_t *rev_rc)
 Get API Revision Data. More...
 
int32_t ad917x_set_dac_pll_config (ad917x_handle_t *h, uint8_t dac_pll_en, uint8_t m_div, uint8_t n_div, uint8_t vco_div)
 Configure the On Chip DAC PLL. More...
 
int32_t ad917x_set_dac_clk_freq (ad917x_handle_t *h, uint64_t dac_clk_freq_hz)
 Set the DAC CLK Frequency. More...
 
int32_t ad917x_get_dac_clk_freq (ad917x_handle_t *h, uint64_t *dac_clk_freq_hz)
 Get the DAC CLK Frequency. More...
 
int32_t ad917x_get_dac_clk_status (ad917x_handle_t *h, uint8_t *pll_lock_stat, uint8_t *dll_lock_stat)
 Get DAC CLK Status. More...
 
int32_t ad917x_set_clkout_config (ad917x_handle_t *h, uint8_t l_div)
 Set CLKOUT configuration. More...
 
int32_t ad917x_set_dac_clk (ad917x_handle_t *h, uint64_t dac_clk_freq_hz, uint8_t dac_pll_en, uint64_t ref_clk_freq_hz)
 Configure the DAC Clock Input path based on a the desired dac clock frequency, the applied reference clock and the onchip PLL. More...
 
int32_t ad917x_jesd_config_datapath (ad917x_handle_t *h, uint8_t dual_en, uint8_t jesd_mode, uint8_t ch_intpl, uint8_t dp_intpl)
 Configure the JESD Datapath for AD917X. More...
 
int32_t ad917x_jesd_get_cfg_status (ad917x_handle_t *h, uint8_t *cfg_valid)
 Get JESD Configuration Status. More...
 
int32_t ad917x_jesd_get_cfg_param (ad917x_handle_t *h, jesd_param_t *jesd_param)
 Read back all current JESD parameter settings. More...
 
int32_t ad917x_jesd_set_sysref_enable (ad917x_handle_t *h, uint8_t en)
 Enable SysRef Input. More...
 
int32_t ad917x_jesd_get_sysref_enable (ad917x_handle_t *h, uint8_t *en)
 Get the current SYSREF Input. More...
 
int32_t ad917x_jesd_set_lmfc_delay (ad917x_handle_t *h, jesd_link_t link, uint8_t delay, uint8_t var)
 Set the LMFC Delay and Variance for the JESD Links. More...
 
int32_t ad917x_jesd_set_syncoutb_enable (ad917x_handle_t *h, jesd_syncoutb_t syncoutb, uint8_t en)
 Enable the SYNCOUTB Output Signal. More...
 
int32_t ad917x_jesd_set_scrambler_enable (ad917x_handle_t *h, uint8_t en)
 Enable the de-scrambler for the JESD Interface. More...
 
int32_t ad917x_jesd_set_lane_xbar (ad917x_handle_t *h, uint8_t logical_lane, uint8_t physical_lane)
 Configure the Lane Cross Bar in the JESD datalink layer. More...
 
int32_t ad917x_jesd_get_lane_xbar (ad917x_handle_t *h, uint8_t *phy_log_map)
 Get current Lane Cross Bar configuration for the JESD datalink layer. More...
 
int32_t ad917x_jesd_invert_lane (ad917x_handle_t *h, uint8_t logical_lane, uint8_t invert)
 Invert or un-invert logical lanes. More...
 
int32_t ad917x_jesd_enable_datapath (ad917x_handle_t *h, uint8_t lanes_msk, uint8_t run_cal, uint8_t en)
 Enable the JESD Interface. More...
 
int32_t ad917x_jesd_get_pll_status (ad917x_handle_t *h, uint8_t *pll_status)
 Get SERDES PLL Status. More...
 
int32_t ad917x_jesd_enable_link (ad917x_handle_t *h, jesd_link_t link, uint8_t en)
 Enable JESD Link. More...
 
int32_t ad917x_jesd_get_link_status (ad917x_handle_t *h, jesd_link_t link, ad917x_jesd_link_stat_t *link_status)
 Get JESD Link Status. More...
 
int32_t ad917x_set_page_idx (ad917x_handle_t *h, const uint32_t dac, const uint32_t channel)
 Select Page. More...
 
int32_t ad917x_get_page_idx (ad917x_handle_t *h, int32_t *dac, int32_t *channel)
 Get select page index. More...
 
int32_t ad917x_set_channel_gain (ad917x_handle_t *h, const uint16_t gain)
 Set Channel gain. More...
 
int32_t ad917x_get_channel_gain (ad917x_handle_t *h, uint16_t *gain)
 Get Channel gain. More...
 
int32_t ad917x_set_dc_cal_tone_amp (ad917x_handle_t *h, const uint16_t amp)
 Set DC Calibration tone. More...
 
int32_t ad917x_nco_get_phase_offset (ad917x_handle_t *h, const ad917x_dac_select_t dacs, uint16_t *dacs_po, const ad917x_channel_select_t channels, uint16_t *ch_po)
 Get NCO phase offset. More...
 
int32_t ad917x_nco_set_phase_offset (ad917x_handle_t *h, const ad917x_dac_select_t dacs, const uint16_t dacs_po, const ad917x_channel_select_t channels, const uint16_t ch_po)
 Set NCO phase offset. More...
 
int32_t ad917x_nco_set_ftw (ad917x_handle_t *h, const ad917x_dds_select_t nco, const uint64_t ftw, const uint64_t acc_modulus, const uint64_t acc_delta)
 Set FTW, ACC and MOD values. More...
 
int32_t ad917x_nco_get_ftw (ad917x_handle_t *h, const ad917x_dds_select_t nco, uint64_t *ftw, uint64_t *acc_modulus, uint64_t *acc_delta)
 Get FTW, ACC and MOD values. More...
 
int32_t ad917x_nco_set (ad917x_handle_t *h, const ad917x_dac_select_t dacs, const ad917x_channel_select_t channels, const int64_t carrier_freq_hz, const uint16_t amplitude, int32_t dc_test_tone_en, int32_t ddsm_cal_dc_input_en)
 Set NCO. More...
 
int32_t ad917x_nco_enable (ad917x_handle_t *h, const ad917x_dac_select_t dacs, const ad917x_channel_select_t channels)
 NCO Enable. More...
 
int32_t ad917x_ddsm_cal_dc_input_set (ad917x_handle_t *h, int32_t ddsm_cal_dc_input_en)
 Set Main DAC Cal DC Input. More...
 
int32_t ad917x_ddsm_cal_dc_input_get (ad917x_handle_t *h, int32_t *ddsm_cal_dc_input_en)
 Get Main DAC Cal DC Input. More...
 
int32_t ad917x_dc_test_tone_set (ad917x_handle_t *h, int32_t dc_test_tone_en)
 Set DC Test Tone enable status. More...
 
int32_t ad917x_dc_test_tone_get (ad917x_handle_t *h, int32_t *dc_test_tone_en)
 Get DC Test Tone enable status. More...
 
int32_t ad917x_nco_channel_freq_get (ad917x_handle_t *h, ad917x_channel_select_t channel, int64_t *carrier_freq_hz)
 Get Channel NCO frequency. More...
 
int32_t ad917x_nco_main_freq_get (ad917x_handle_t *h, ad917x_dac_select_t dac, int64_t *carrier_freq_hz)
 Get Main DAC NCO frequency. More...
 

Detailed Description

Enumeration Type Documentation

◆ ad917x_channel_select_t

Channel select

Enumerator
AD917X_CH_NONE 

No Channel

AD917X_CH_0 

Channel 0

AD917X_CH_1 

Channel 1

AD917X_CH_2 

Channel 2

AD917X_CH_3 

Channel 3

AD917X_CH_4 

Channel 4

AD917X_CH_5 

Channel 5

◆ ad917x_dac_select_t

DAC Select

Enumerator
AD917X_DAC_NONE 

No DAC

AD917X_DAC0 

DAC0

AD917X_DAC1 

DAC1

◆ ad917x_dds_select_t

DDS Select

Enumerator
AD917X_DDSM 

Main DDS

AD917X_DDSC 

Channel DDS

◆ ad917x_jesd_serdes_pll_flg_t

Enumerates SERDES PLL Status Flags

Enumerator
AD917X_PLL_LOCK_STAT 

Serdes PLL lock Status Flag

AD917X_PLL_REG_RDY 

Serdes PLL Regulator RDY Status Flag

AD917X_PLL_CAL_STAT 

Serdes PLL VCO Calibration Status Flag

AD917X_PLL_LOSSLOCK 

Serdes PLL Upper Calibration Threshold flag

Function Documentation

◆ ad917x_dc_test_tone_get()

int32_t ad917x_dc_test_tone_get ( ad917x_handle_t h,
int32_t *  dc_test_tone_en 
)

Get DC Test Tone enable status.

Get DC Test Tone enable status.

Parameters
hPointer to the AD917x device reference handle.
dc_test_tone_enPointer to integer, where the result will be storred 0 - Disabled 1 - Enabled
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_dc_test_tone_set()

int32_t ad917x_dc_test_tone_set ( ad917x_handle_t h,
int32_t  dc_test_tone_en 
)

Set DC Test Tone enable status.

Set DC Test Tone enable status.

Parameters
hPointer to the AD917x device reference handle.
dc_test_tone_enEnable flag: 0 - Disabled 1 - Enabled
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
Here is the caller graph for this function:

◆ ad917x_ddsm_cal_dc_input_get()

int32_t ad917x_ddsm_cal_dc_input_get ( ad917x_handle_t h,
int32_t *  ddsm_cal_dc_input_en 
)

Get Main DAC Cal DC Input.

Get Main DAC Cal DC Input

Parameters
hPointer to the AD917x device reference handle.
ddsm_cal_dc_input_enPointer to integer, where the result will be storred 0 - Disabled 1 - Enabled
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_ddsm_cal_dc_input_set()

int32_t ad917x_ddsm_cal_dc_input_set ( ad917x_handle_t h,
int32_t  ddsm_cal_dc_input_en 
)

Set Main DAC Cal DC Input.

Set Main DAC Cal DC Input

Parameters
hPointer to the AD917x device reference handle.
ddsm_cal_dc_input_enEnable flag: 0 - Disabled 1 - Enabled
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
Here is the caller graph for this function:

◆ ad917x_deinit()

int32_t ad917x_deinit ( ad917x_handle_t h)

De-initialize the AD917X Device.

This API must be called last. No other API should be called after this call. It performs internal API de-initialization of the memory and API states. If AD917X handle member hw_close, is not NULL it shall call the function to which it points. This feature may be used to de-initialize and release any hardware resources required by the API and the AD917X Device. For example GPIO, SPI etc

Parameters
hPointer to the AD917X device reference handle.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle

◆ ad917x_get_channel_gain()

int32_t ad917x_get_channel_gain ( ad917x_handle_t h,
uint16_t *  gain 
)

Get Channel gain.

Gets the scalar channel gain value. It is paged by CHANNEL_PAGE in Reg08

Parameters
hPointer to the AD917x device reference handle.
gainPointer to the gain value
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_get_chip_id()

int32_t ad917x_get_chip_id ( ad917x_handle_t h,
adi_chip_id_t chip_id 
)

Get Chip Identification Data.

read-back Product type, identification and revision data

Parameters
hPointer to the AD917X device reference handle.
chip_idPointer to a variable of type ad917x_chip_id_t to which the product data read-back from chip shall be stored.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_get_dac_clk_freq()

int32_t ad917x_get_dac_clk_freq ( ad917x_handle_t h,
uint64_t *  dac_clk_freq_hz 
)

Get the DAC CLK Frequency.

The AD917X may be configured to use a clock directly applied to the device as the DAC clock or may generate a DAC Clock using the clock applied by the system as a reference. This API get the desired DAC Clock Frequency, irrespective of how the DAC CLK is generated. DAC Clock Frequency range is 2.9 GHz to 12GHz for AD9172 and AD9173. DAC CLK Frequency range is 2.9 GHz to 6GHz for AD9171.

Parameters
hPointer to the AD917X device reference handle.
dac_clk_freq_hzPointer to the uint64_t variable in which the dac clk frequency value in Hz shall be stored. See description for valid range
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_get_dac_clk_status()

int32_t ad917x_get_dac_clk_status ( ad917x_handle_t h,
uint8_t *  pll_lock_stat,
uint8_t *  dll_lock_stat 
)

Get DAC CLK Status.

Parameters
hPointer to the AD917X device reference handle.
pll_lock_statPointer to which DAC PLL Lock Status shall be stored. Set to NULL if status data not required. 0 - DAC PLL Not Locked. 1- DAC PLL Locked.
dll_lock_statPointer to which DAC DLL Lock Status Shall be stored. Set to NULL if status data not required. 0 - DAC PLL Not Locked. 1- DAC PLL Locked.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_get_page_idx()

int32_t ad917x_get_page_idx ( ad917x_handle_t h,
int32_t *  dac,
int32_t *  channel 
)

Get select page index.

Parameters
hPointer to the AD917x device reference handle.
*dacPointer to the selected DAC number.
*channelPointer to the selected Channel number.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_get_revision()

int32_t ad917x_get_revision ( ad917x_handle_t h,
uint8_t *  rev_major,
uint8_t *  rev_minor,
uint8_t *  rev_rc 
)

Get API Revision Data.

Parameters
hPointer to the AD917X device reference handle.
rev_majorPointer to variable to store the Major Revision Number
rev_minorPointer to variable to store the Minor Revision Number
rev_rcPointer to variable to store the RC Revision Number
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_init()

int32_t ad917x_init ( ad917x_handle_t h)

Initialize AD917X Device This API must be called first before any other API calls. It performs internal API initialization of the memory and API states. If AD917X handle member hw_open is not NULL it shall call the function to which it points. This feature may be used to get and initialize the hardware resources required by the API and the AD917X devices. For example GPIO, SPI etc.

Its is recommended to call the Reset API after this API to ensure all spi registers are reset to ADI recommended defaults.

Parameters
hPointer to the AD917X device reference handle.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle
API_ERROR_INIT_SEQ_FAILInit sequence failed
API_ERROR_SPI_SDOInvalid SPI configuration

◆ ad917x_jesd_config_datapath()

int32_t ad917x_jesd_config_datapath ( ad917x_handle_t h,
uint8_t  dual_en,
uint8_t  jesd_mode,
uint8_t  ch_intpl,
uint8_t  dp_intpl 
)

Configure the JESD Datapath for AD917X.

Configure JESD interface parameters and digital datapath interpolation mode. An error shall be returned if the input parameters define an unsupported configuration. Refer to AD917x Device Datasheet for full details.

Parameters
hPointer to the AD917X device reference handle.
dual_enDual Link enable setting 0 - Single Link Mode 1 - Dual Link Mode
jesd_modeThe desired value of the pre-definded JESD link modes supported by the AD917X. Valid range 0 to 21. Based on this value the AD917X JESD interface shall be configured as per one of the supported JESD parameter configurations. Refer to the user guide for full details on the modes and the corresponding JESD settings.
ch_intplThe desired channel interpolation. Valid range 1 to 12
dp_intplThe desired main dac datapath interpolation. Valid range 1 to 10
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_enable_datapath()

int32_t ad917x_jesd_enable_datapath ( ad917x_handle_t h,
uint8_t  lanes_msk,
uint8_t  run_cal,
uint8_t  en 
)

Enable the JESD Interface.

Configure power up and enable the ad917x the JESD Interface

Parameters
hPointer to the AD917X device reference handle.
lanes_mskLanes to be enabled on JESD Interface. 8-bit mask where bit 0 represents lane 0, bit 1 represents lane 1 etc. Set to 1 to enable JESD lane, set to 0 to disable JESD Lane.
run_calRun JESD interface equalisation routine
enEnable control for the JESD Interface
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_enable_link()

int32_t ad917x_jesd_enable_link ( ad917x_handle_t h,
jesd_link_t  link,
uint8_t  en 
)

Enable JESD Link.

Enable SERDES Link to start the bring up JESD Link procedure

JESD Transmitter Link shall be enabled and ready to begin link bring prior to calling this function. SERDES PLL shall be locked.

Parameters
hPointer to the AD917X device reference handle.
linkTarget Link on which to start JESD Link Bring up Procedure
enEnable control for the JESD Link 0 - Enable Link 1 - Disable Link
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_cfg_param()

int32_t ad917x_jesd_get_cfg_param ( ad917x_handle_t h,
jesd_param_t jesd_param 
)

Read back all current JESD parameter settings.

Read-back all the currently configured JESD Interface parameters.

Parameters
hPointer to the AD917X device reference handle.
jesd_paramPointer to a variable that will be set will the current values of the JESD interface parameters.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_cfg_status()

int32_t ad917x_jesd_get_cfg_status ( ad917x_handle_t h,
uint8_t *  cfg_valid 
)

Get JESD Configuration Status.

Returns JESD Configuration Valid Mode Status

Parameters
hPointer to the AD917X device reference handle.
cfg_validPointer to a variable in which the Valid JESD Configuration status shall be stored 0 - Invalid JESD and Interpolation Mode Configured 1 - Valid JESD and Interpolation Mode Configured.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_lane_xbar()

int32_t ad917x_jesd_get_lane_xbar ( ad917x_handle_t h,
uint8_t *  phy_log_map 
)

Get current Lane Cross Bar configuration for the JESD datalink layer.

Return the physical to logical lane mapping set by the configured by the current Lane Cross Bar configuration.

Parameters
hPointer to the AD917X device reference handle.
phy_log_mapPointer a 8 deep uint8_t array.Each element of the array represents the physical lane 0 - 7 and the value represents the logical lane assigned to that physical lane.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_link_status()

int32_t ad917x_jesd_get_link_status ( ad917x_handle_t h,
jesd_link_t  link,
ad917x_jesd_link_stat_t link_status 
)

Get JESD Link Status.

Read-back JESD Status for all lanes. JESD status include Code Group Sync Status, Frame Sync Status, Checksum Status Initial Lane Sync Status for the active JESD link.

Parameters
hPointer to the AD917x device reference handle.
linkDesired link of which to retrieve status.
*link_statusPointer to the variable of type jesd_link_status that will be set with current jesd link read-back data.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_pll_status()

int32_t ad917x_jesd_get_pll_status ( ad917x_handle_t h,
uint8_t *  pll_status 
)

Get SERDES PLL Status.

Read Serdes PLL status and return the status via the pll_status parameter.

Parameters
hPointer to the AD917X device reference handle.
*pll_statusPointer to the variable that will be set with the PLL status. bit[0] => SERDES PLL Lock Status bit[1] => Regulator Status bit[2] => Calibration Status bit[3] => LOSS_LOCK Status
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_get_sysref_enable()

int32_t ad917x_jesd_get_sysref_enable ( ad917x_handle_t h,
uint8_t *  en 
)

Get the current SYSREF Input.

Configure AD917X SYSREF +- Pin Input Interface for the target system SYSREF signal

Parameters
hPointer to the AD917X device reference handle.
*enPointer to variable to which SYSREF Input Interface Enable status shall be stored 1 - Power Up SYSREF Input 0 - Power Down SYSREF Input
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_invert_lane()

int32_t ad917x_jesd_invert_lane ( ad917x_handle_t h,
uint8_t  logical_lane,
uint8_t  invert 
)

Invert or un-invert logical lanes.

Each logical lane can be inverted which can be used to ease routing of SERDIN signals.

Parameters
hPointer to the AD917X device reference handle.
logical_laneLogical lane ID to be inverted. 0 to 7
invertDesired invert status for the logical lane represented in logical_lane parameter. Set to 1 to invert. Set to 0 to de-invert.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_set_lane_xbar()

int32_t ad917x_jesd_set_lane_xbar ( ad917x_handle_t h,
uint8_t  logical_lane,
uint8_t  physical_lane 
)

Configure the Lane Cross Bar in the JESD datalink layer.

Configure AD917X Lane Cross Bar to route the physical JESD lanes to the desired logical lanes.

Parameters
hPointer to the AD917X device reference handle.
logical_laneuint8_t value indicating the corresponding logical lane for the physical lane listed in parameter physical_lane.
physical_laneuint8_t value indicating the Physical Lane to be routed to the serdes logical indicated by the logical_lane parameter
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_set_lmfc_delay()

int32_t ad917x_jesd_set_lmfc_delay ( ad917x_handle_t h,
jesd_link_t  link,
uint8_t  delay,
uint8_t  var 
)

Set the LMFC Delay and Variance for the JESD Links.

API to configure the LMFC Delay and Variance for JESD Link Setup.

Parameters
hPointer to the AD917X device reference handle.
linkTarget JESD Link on which to configure LMFC Parameters
delayDynamic Link Latency for LMFC Rx in PCLK cycles. Range 0 to 63
varVariable Delay Buffer in PCLK cycles. Range 0 to 12
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_set_scrambler_enable()

int32_t ad917x_jesd_set_scrambler_enable ( ad917x_handle_t h,
uint8_t  en 
)

Enable the de-scrambler for the JESD Interface.

Enable or Disable the descrambler for the JESD Interface

Parameters
hPointer to the ad917x device reference handle.
enEnable control for JESD Scrambler.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_set_syncoutb_enable()

int32_t ad917x_jesd_set_syncoutb_enable ( ad917x_handle_t h,
jesd_syncoutb_t  syncoutb,
uint8_t  en 
)

Enable the SYNCOUTB Output Signal.

Configure and enable/disable the SYNCOUT_B Output Signal

Parameters
hPointer to the AD917X device reference handle.
syncoutbTarget SYNCOUTB Signal. Valid values defined by ad917x_syncoutb_t SYNCOUTB_0 SYNCOUTB_1 SYCNOUTB_ALL
enEnable/Disable SYNCOUTB for target SYNCOUTB signal. Range 0 to 1 0 - Disable 1 - Enable
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_jesd_set_sysref_enable()

int32_t ad917x_jesd_set_sysref_enable ( ad917x_handle_t h,
uint8_t  en 
)

Enable SysRef Input.

Enable AD917X SYSREF +- Pin Input Interface for the target system SYSREF signal

Parameters
hPointer to the AD917X device reference handle.
enEnable SYSREF Input Interface 1 - Power Up SYSREF Input 0 - Power Down SYSREF Input
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_channel_freq_get()

int32_t ad917x_nco_channel_freq_get ( ad917x_handle_t h,
ad917x_channel_select_t  channel,
int64_t *  carrier_freq_hz 
)

Get Channel NCO frequency.

Get a Channel NCO frequency in Hz.

Parameters
hPointer to the AD917x device reference handle.
channelChannel number. Can be only one of: AD917X_CH_0 - Channel 0 NCO AD917X_CH_1 - Channel 1 NCO AD917X_CH_2 - Channel 2 NCO AD917X_CH_3 - Channel 3 NCO AD917X_CH_4 - Channel 4 NCO AD917X_CH_5 - Channel 5 NCO
carrier_freq_hz- pointer to 64 bit integer, where the result frequency will be storred
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_enable()

int32_t ad917x_nco_enable ( ad917x_handle_t h,
const ad917x_dac_select_t  dacs,
const ad917x_channel_select_t  channels 
)

NCO Enable.

Enable/Disable NCOs. Enables only the DACs and Channel NCOs provided as parameters. All other DACs and Channel NCOs are disabled.

Parameters
hPointer to the AD917x device reference handle.
dacsMain data path DAC NCO select AD917X_DAC0 - DAC0 NCO select AD917X_DAC1 - DAC1 NCO select
channelsChannel number AD917X_CH_0 - Channel 0 NCO AD917X_CH_1 - Channel 1 NCO AD917X_CH_2 - Channel 2 NCO AD917X_CH_3 - Channel 3 NCO AD917X_CH_4 - Channel 4 NCO AD917X_CH_5 - Channel 5 NCO
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_get_ftw()

int32_t ad917x_nco_get_ftw ( ad917x_handle_t h,
const ad917x_dds_select_t  nco,
uint64_t *  ftw,
uint64_t *  acc_modulus,
uint64_t *  acc_delta 
)

Get FTW, ACC and MOD values.

Get FTW, ACC and MOD values for the paged NCO. The page has to be selected in advance.

Parameters
hPointer to the AD917x device reference handle.
ncoChannel or Main data path select AD917X_DDSM - Main data path select AD917X_DDSC - Channel data path select
ftwPointer to the FTW value, Set to NULL if data not required
acc_modulusPointer to the Modulus value, Set to NULL if data not required
acc_deltaPointer to the Delta value, Set to NULL if data not required
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_get_phase_offset()

int32_t ad917x_nco_get_phase_offset ( ad917x_handle_t h,
const ad917x_dac_select_t  dacs,
uint16_t *  dacs_po,
const ad917x_channel_select_t  channels,
uint16_t *  ch_po 
)

Get NCO phase offset.

Gets main datapath and/or channel datapath NCO phase offset.

Parameters
hPointer to the AD917x device reference handle.
dacsDAC number AD917X_DAC0 - DAC0 NCO AD917X_DAC1 - DAC1 NCO AD917X_DAC0 | AD917X_DAC1 - DAC0 NCO and DAC1 NCO
channelsChannel number AD917X_CH_0 - Channel 0 NCO AD917X_CH_1 - Channel 1 NCO AD917X_CH_2 - Channel 2 NCO AD917X_CH_3 - Channel 3 NCO AD917X_CH_4 - Channel 4 NCO AD917X_CH_5 - Channel 5 NCO
dacs_poPhase offset for the selected DAC NCO(s)
ch_poPhase offset for the selected channel NCO(s)
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_main_freq_get()

int32_t ad917x_nco_main_freq_get ( ad917x_handle_t h,
ad917x_dac_select_t  dac,
int64_t *  carrier_freq_hz 
)

Get Main DAC NCO frequency.

Get a Main DAC NCO frequency in Hz.

Parameters
hPointer to the AD917x device reference handle.
dacMain data path DAC NCO select. Can be only one of: AD917X_DAC0 - DAC0 NCO select AD917X_DAC1 - DAC1 NCO select
carrier_freq_hzpointer to 64 bit integer, where the result frequency will be storred
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_nco_set()

int32_t ad917x_nco_set ( ad917x_handle_t h,
const ad917x_dac_select_t  dacs,
const ad917x_channel_select_t  channels,
const int64_t  carrier_freq_hz,
const uint16_t  amplitude,
int32_t  dc_test_tone_en,
int32_t  ddsm_cal_dc_input_en 
)

Set NCO.

Set NCO to produce a desired frequency with a desired amplitude

Parameters
hPointer to the AD917x device reference handle.
dacsMain data path DAC NCO select AD917X_DAC0 - DAC0 NCO select AD917X_DAC1 - DAC1 NCO select
channelsChannel number AD917X_CH_0 - Channel 0 NCO AD917X_CH_1 - Channel 1 NCO AD917X_CH_2 - Channel 2 NCO AD917X_CH_3 - Channel 3 NCO AD917X_CH_4 - Channel 4 NCO AD917X_CH_5 - Channel 5 NCO
carrier_freq_hzDesired carrier frequency in Hz
amplitudeDesired amplitude value
dc_test_tone_en- enable test tone
ddsm_cal_dc_input_en- enable main datapath test tone
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

amplitude - amplitude full scale. 0xFFFF = full scale.

◆ ad917x_nco_set_ftw()

int32_t ad917x_nco_set_ftw ( ad917x_handle_t h,
const ad917x_dds_select_t  nco,
const uint64_t  ftw,
const uint64_t  acc_modulus,
const uint64_t  acc_delta 
)

Set FTW, ACC and MOD values.

Set FTW, ACC and MOD values for the paged NCO. The page has to be selected in advance.

Parameters
hPointer to the AD917x device reference handle.
ncoChannel or Main data path select AD917X_DDSM - Main data path select AD917X_DDSC - Channel data path select
ftwFTW value
acc_modulusModulus value
acc_deltaDelta value
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
Here is the caller graph for this function:

◆ ad917x_nco_set_phase_offset()

int32_t ad917x_nco_set_phase_offset ( ad917x_handle_t h,
const ad917x_dac_select_t  dacs,
const uint16_t  dacs_po,
const ad917x_channel_select_t  channels,
const uint16_t  ch_po 
)

Set NCO phase offset.

Sets main datapath and/or channel datapath NCO phase offset.

Parameters
hPointer to the AD917x device reference handle.
dacsDAC number AD917X_DAC0 - DAC0 NCO AD917X_DAC1 - DAC1 NCO
channelsChannel number AD917X_CH_0 - Channel 0 NCO AD917X_CH_1 - Channel 1 NCO AD917X_CH_2 - Channel 2 NCO AD917X_CH_3 - Channel 3 NCO AD917X_CH_4 - Channel 4 NCO AD917X_CH_5 - Channel 5 NCO
dacs_poPointer to the phase offset for the selected DAC NCO(s)
ch_poPointer to the phase offset for the selected channel NCO(s)
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_register_read()

int32_t ad917x_register_read ( ad917x_handle_t h,
const uint16_t  address,
uint8_t *  data 
)

Perform SPI register read access to AD917X Device.

Parameters
hPointer to the AD917X device reference handle.
addressAD917X Device SPI address from which the value of data parameter shall be read,
dataPointer to an 8-bit variable to which the value of the SPI register at the address defined by address parameter shall be stored.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
Here is the caller graph for this function:

◆ ad917x_register_write()

int32_t ad917x_register_write ( ad917x_handle_t h,
const uint16_t  address,
const uint8_t  data 
)

Perform SPI register write access to AD917X Device.

Parameters
hPointer to the AD917X device reference handle.
addressAD917X Device SPI address to which the value of data parameter shall be written
data8-bit value to be written to SPI register defined by the address parameter.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
Here is the caller graph for this function:

◆ ad917x_reset()

int32_t ad917x_reset ( ad917x_handle_t h,
uint8_t  hw_reset 
)

Reset the AD917X.

Issues a hard reset or soft reset of the device. Performs a full reset of AD917X via the hardware pin (hard) or via the spi register (soft). Resetting all SPI registers to default and triggering the required initialization sequence.

Parameters
hPointer to the AD917X device reference handle.
hw_resetA parameter to indicate if the reset issues is to be via the hardware pin or SPI register. A value of 1 indicates a hardware reset is required. A value of 0 indicates a software reset is required.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter
API_ERROR_INIT_SEQ_FAILInit sequence failed
API_ERROR_SPI_SDOInvalid SPI configuration

◆ ad917x_set_channel_gain()

int32_t ad917x_set_channel_gain ( ad917x_handle_t h,
const uint16_t  gain 
)

Set Channel gain.

Sets the scalar channel gain value. It is paged by CHANNEL_PAGE in Reg08

Parameters
hPointer to the AD917x device reference handle.
gainGain value
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_clkout_config()

int32_t ad917x_set_clkout_config ( ad917x_handle_t h,
uint8_t  l_div 
)

Set CLKOUT configuration.

Parameters
hPointer to the AD917X device reference handle.
l_divOutput CLK divider setting. Valid range 1 to 4
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_dac_clk()

int32_t ad917x_set_dac_clk ( ad917x_handle_t h,
uint64_t  dac_clk_freq_hz,
uint8_t  dac_pll_en,
uint64_t  ref_clk_freq_hz 
)

Configure the DAC Clock Input path based on a the desired dac clock frequency, the applied reference clock and the onchip PLL.

The AD917X may be configured to use a clock directly applied to the device as the DAC clock or may generate a DAC Clock using the clock applied by the system as a reference. This function shall calculate and apply the required onchip PLL configuration based on the desired dac clock frequency and the applied referenc clock frequency.

This function may be used instead of the following two APIs ad917x_set_dac_pll_cfg DAC Clock Frequency range is 2.9 GHz to 12GHz for AD9172 and AD9173. DAC CLK Frequency range is 2.9 GHz to 6GHz for AD9171.

Parameters
hPointer to the AD917X device reference handle.
dac_clk_freq_hzDesired DAC Clk Frequency in Hz. See description for range.
dac_pll_enEnable for internal DAC Clock generation. If set, ref_clk_freq_khz must be set with value of reference clock applied by the system. 0 - Do not generate DAC CLK internally. Clock applied to DAC is the dac clock. 1 - Generate DAC CLK internally from a reference clock applied to the DAC
ref_clk_freq_hzValue of reference clk frequency applied to AD917X Set to 0 if DAC CLK is applied to the pin.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_dac_clk_freq()

int32_t ad917x_set_dac_clk_freq ( ad917x_handle_t h,
uint64_t  dac_clk_freq_hz 
)

Set the DAC CLK Frequency.

The AD917X may be configured to use a clock directly applied to the device as the DAC clock or may generate a DAC Clock using the clock applied by the system as a reference. This API set the desired DAC Clock Frequency, irrespective of how the DAC CLK is generated. DAC Clock Frequency range is 2.9 GHz to 12GHz for AD9172 and AD9173. DAC CLK Frequency range is 2.9 GHz to 6GHz for AD9171.

This function shall be used in conjunction with the following API ad917x_set_dac_pll_cfg

Parameters
hPointer to the AD917X device reference handle.
dac_clk_freq_hzDesired DAC CLK Frequency value in Hz
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_dac_pll_config()

int32_t ad917x_set_dac_pll_config ( ad917x_handle_t h,
uint8_t  dac_pll_en,
uint8_t  m_div,
uint8_t  n_div,
uint8_t  vco_div 
)

Configure the On Chip DAC PLL.

The AD917X may be configured to use a clock directly applied to the device as the DAC clock or may generate a DAC Clock using the clock applied by the system as a reference. This API allows direct configuration of the On Chip PLL parameters.

Parameters
hPointer to the AD917X device reference handle.
dac_pll_enEnable for internal DAC Clock generation. If set, ref_clk_freq_khz must be set with value of reference clock applied by the system. 0 - Do not generate DAC CLK internally. 1 - Generate DAC CLK internally
m_divReference Clock Pre-divider. Where M_DIVIDER = Ceiling (Fref_clk_mhz/500 MHz) Valid Range 1 to 4
n_divVCO Feedback Divider Ratio. Where N_DIVIDER = Fvco * M_DIVIDER/(8 * Fref_clk) Valid Range 2 -50
vco_divRequired VCO Divider for the Desired DAC CLK, where Fdac = Fvco/VCO_DIVIDER Valid range 1-3
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_dc_cal_tone_amp()

int32_t ad917x_set_dc_cal_tone_amp ( ad917x_handle_t h,
const uint16_t  amp 
)

Set DC Calibration tone.

Sets the DC tone amplitude. This amplitude goes to both I and Q paths. It is paged by CHANNEL_PAGE in Reg08

Parameters
hPointer to the AD917x device reference handle.
ampCalibration tone amplitude
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter

◆ ad917x_set_page_idx()

int32_t ad917x_set_page_idx ( ad917x_handle_t h,
const uint32_t  dac,
const uint32_t  channel 
)

Select Page.

Parameters
hPointer to the AD916x device reference handle.
dacDAC number. Valid values are: AD9172_DAC_NONE - No DAC selected AD9172_DAC0 - DAC0 selected AD9172_DAC1 - DAC1 selected AD9172_DAC0 | AD9172_DAC1 - Both DACs selected
channelChannel number.Valid values are: AD9172_CH_NONE - No channel selected AD9172_CH_0 - Channel 0 selected ... AD9172_CH_5 - Channel 5 selected More than one channel can be selected at once by ORing them.
Return values
API_ERROR_OKAPI Completed Successfully
API_ERROR_INVALID_HANDLE_PTRInvalid reference handle.
API_ERROR_INVALID_XFER_PTRSPI Access Failed
API_ERROR_INVALID_PARAMInvalid Parameter