no-OS
Loading...
Searching...
No Matches
ad9088.h File Reference

Header file of the AD9088/AD9084 (Apollo) MxFE driver. More...

#include "no_os_error.h"
#include "no_os_gpio.h"
#include "no_os_print_log.h"
#include "no_os_spi.h"
#include "jesd204.h"
#include "adi_apollo_bf_serdes_txdig_phy_core1p2.h"
#include "adi_apollo_bf_serdes_rxdig_phy_core1p3.h"
#include "adi_apollo.h"
#include "adi_apollo_bf_custom.h"
#include "adi_apollo_adc.h"
#include "adi_apollo_cfg.h"
#include "adi_apollo_sysclk_cond.h"
#include "adi_apollo_hal.h"
#include "adi_apollo_mailbox.h"
#include "adi_apollo_loopback.h"
#include "adi_apollo_utils.h"
#include "adi_apollo_bf_mcs_sync.h"
#include "adi_apollo_bf_txrx_prefsrc_reconf.h"
#include "adi_apollo_bf_master_bias_ctrl.h"
#include "adi_apollo_sniffer.h"
#include "adi_apollo_cnco.h"
#include "adi_apollo_fnco.h"
#include "adi_apollo_cddc.h"
#include "adi_apollo_cduc.h"
#include "adi_utils.h"
Include dependency graph for ad9088.h:

Classes

struct  ad9088_jesd204_priv
 
struct  ad9088_bsync_ops
 Accessors for the board's BSYNC (SYSREF) provider, used by MCS calibration. More...
 
struct  ad9088_clk_ops
 Accessors for the board's device-clock PLL, used by MCS tracking calibration to correct clock drift. More...
 
struct  ad9088_init_param
 
struct  ad9088_phy
 

Macros

#define DEFRAMER_LINK_A0_TX   0
 
#define DEFRAMER_LINK_A1_TX   1
 
#define DEFRAMER_LINK_B0_TX   2
 
#define DEFRAMER_LINK_B1_TX   3
 
#define FRAMER_LINK_A0_RX   4
 
#define FRAMER_LINK_A1_RX   5
 
#define FRAMER_LINK_B0_RX   6
 
#define FRAMER_LINK_B1_RX   7
 
#define MAX_NUM_MAIN_DATAPATHS   ADI_APOLLO_CNCO_NUM
 
#define MAX_NUM_CHANNELIZER   ADI_APOLLO_FNCO_NUM
 
#define NUM_RXTX   2
 
#define AD9088_MCS_TRACK_DECIMATION_DEFAULT   1023
 
#define AD9088_MCS_CLK_PHASE_FS   125
 
#define AD9088_FW_SYM(sym)
 
#define AD9088_FW_DECL(sym)
 
#define AD9088_FW_ENTRY(sym)
 

Enumerations

enum  {
  ADI_APOLLO_LOOPBACK_NONE ,
  ADI_APOLLO_LOOPBACK_0 ,
  ADI_APOLLO_LOOPBACK_1 ,
  ADI_APOLLO_LOOPBACK_2 ,
  ADI_APOLLO_LOOPBACK_3
}
 

Functions

 AD9088_FW_DECL (usecase_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_B_flash_image_0x01030000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_B_flash_image_0x20000000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_B_flash_image_0x02000000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_B_flash_image_0x21000000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_prod_B_flash_image_0x01030000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_prod_B_flash_image_0x20000000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_prod_B_flash_image_0x02000000_bin)
 
 AD9088_FW_DECL (app_signed_encrypted_prod_B_flash_image_0x21000000_bin)
 
int ad9088_check_apollo_error (int ret, const char *api_name)
 Translate a vendor API return code into an errno value.
 
uint8_t ad9088_to_link (uint8_t linkid)
 Map a state-machine link identifier onto a device link identifier.
 
int ad9088_inspect_jrx_link_all (struct ad9088_phy *phy)
 Print the negotiated link parameters of every deframer link.
 
int ad9088_inspect_jtx_link_all (struct ad9088_phy *phy)
 Print the negotiated link parameters of every framer link.
 
void ad9088_print_link_phase (struct ad9088_phy *phy, struct jesd204_link *lnk)
 Print the deframer phase difference for one link.
 
void ad9088_print_sysref_phase (struct ad9088_phy *phy)
 Print the captured SYSREF phase several times over.
 
int ad9088_jesd_tx_link_status_print (struct ad9088_phy *phy, struct jesd204_link *lnk, int retry)
 Poll a framer link until it reports good, then print its status.
 
int ad9088_jesd_rx_link_status_print (struct ad9088_phy *phy, struct jesd204_link *lnk, int retry)
 Poll a deframer link until it reports good, then print its status.
 
int ad9088_mcs_init_cal_setup (struct ad9088_phy *phy)
 Zero the desired internal-to-external SYSREF offsets before init cal.
 
int ad9088_delta_t_measurement_set (struct ad9088_phy *phy, uint32_t mode)
 Start a BSYNC delta-t measurement.
 
int ad9088_delta_t_measurement_get (struct ad9088_phy *phy, uint32_t mode, int64_t *apollo_delta_t)
 Read back the result of a BSYNC delta-t measurement.
 
int ad9088_mcs_init_cal_validate (struct ad9088_phy *phy, adi_apollo_mcs_cal_init_status_t *cal_status)
 Check that MCS init cal aligned the internal SYSREF and locked.
 
void ad9088_mcs_init_cal_status_print (struct ad9088_phy *phy, adi_apollo_mcs_cal_init_status_t *cal_status)
 Print the MCS init cal status and measurements.
 
int ad9088_mcs_tracking_cal_setup (struct ad9088_phy *phy, uint32_t mcs_track_decimation, uint16_t initialize_track_cal)
 Arm MCS tracking calibration.
 
int adi_ad9088_calc_nco_ftw (struct ad9088_phy *phy, uint64_t freq, int64_t nco_shift, uint32_t div, uint32_t bits, uint64_t *ftw, uint64_t *frac_a, uint64_t *frac_b)
 Convert an NCO frequency shift into a frequency tuning word.
 
int adi_ad9088_calc_nco_freq (struct ad9088_phy *phy, uint64_t freq, uint64_t ftw, uint32_t a, uint32_t b, uint32_t bits, int64_t *nco_shift)
 Convert a frequency tuning word back into a frequency shift.
 
int ad9088_set_cnco_freq (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t cddc_num, int64_t freq_hz)
 Set the coarse NCO frequency shift.
 
int ad9088_get_cnco_freq (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t cddc_num, int64_t *freq_hz)
 Read back the coarse NCO frequency shift.
 
int ad9088_set_fnco_freq (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t fddc_num, int64_t freq_hz)
 Set the fine NCO frequency shift.
 
int ad9088_get_fnco_freq (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t fddc_num, int64_t *freq_hz)
 Read back the fine NCO frequency shift.
 
int ad9088_set_cnco_test_tone (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t cddc_num, bool enable, uint16_t offset)
 Enable or disable the coarse NCO DC test tone.
 
int ad9088_set_fnco_test_tone (struct ad9088_phy *phy, adi_apollo_terminal_e terminal, uint8_t side, uint8_t fddc_num, bool enable, uint16_t offset)
 Enable or disable the fine NCO DC test tone.
 
int ad9088_set_loopback_mode (struct ad9088_phy *phy, uint8_t side, uint8_t mode)
 Select the datapath loopback mode for one side.
 
int ad9088_parse_struct (struct ad9088_phy **device, const struct ad9088_init_param *init_param)
 Allocate the device structure and apply the initialisation parameters.
 
int ad9088_init (struct ad9088_phy **device, const struct ad9088_init_param *init_param)
 Initialize the device.
 
int ad9088_remove (struct ad9088_phy *phy)
 Free the resources allocated by ad9088_init().
 

Variables

const struct jesd204_dev_data jesd204_ad9088_init
 
const char *const ad9088_fsm_links_to_str []
 

Detailed Description

Header file of the AD9088/AD9084 (Apollo) MxFE driver.

Author
CHegbeli (cipri.nosp@m.an.h.nosp@m.egbel.nosp@m.i@an.nosp@m.alog..nosp@m.com)

Copyright 2022-2026(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Macro Definition Documentation

◆ AD9088_FW_DECL

#define AD9088_FW_DECL ( sym)
Value:
extern const uint8_t AD9088_FW_SYM(sym##_start)[]; \
extern const uint8_t AD9088_FW_SYM(sym##_end)[]
#define AD9088_FW_SYM(sym)
Definition ad9088.h:237

◆ AD9088_FW_ENTRY

#define AD9088_FW_ENTRY ( sym)
Value:
{ \
.start = AD9088_FW_SYM(sym##_start), \
.end = AD9088_FW_SYM(sym##_end), \
}

◆ AD9088_FW_SYM

#define AD9088_FW_SYM ( sym)
Value:
_binary_drivers_rf_transceiver_ad9088_firmware_##sym

◆ AD9088_MCS_CLK_PHASE_FS

#define AD9088_MCS_CLK_PHASE_FS   125

◆ AD9088_MCS_TRACK_DECIMATION_DEFAULT

#define AD9088_MCS_TRACK_DECIMATION_DEFAULT   1023

◆ DEFRAMER_LINK_A0_TX

#define DEFRAMER_LINK_A0_TX   0

◆ DEFRAMER_LINK_A1_TX

#define DEFRAMER_LINK_A1_TX   1

◆ DEFRAMER_LINK_B0_TX

#define DEFRAMER_LINK_B0_TX   2

◆ DEFRAMER_LINK_B1_TX

#define DEFRAMER_LINK_B1_TX   3

◆ FRAMER_LINK_A0_RX

#define FRAMER_LINK_A0_RX   4

◆ FRAMER_LINK_A1_RX

#define FRAMER_LINK_A1_RX   5

◆ FRAMER_LINK_B0_RX

#define FRAMER_LINK_B0_RX   6

◆ FRAMER_LINK_B1_RX

#define FRAMER_LINK_B1_RX   7

◆ MAX_NUM_CHANNELIZER

#define MAX_NUM_CHANNELIZER   ADI_APOLLO_FNCO_NUM

◆ MAX_NUM_MAIN_DATAPATHS

#define MAX_NUM_MAIN_DATAPATHS   ADI_APOLLO_CNCO_NUM

◆ NUM_RXTX

#define NUM_RXTX   2

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ADI_APOLLO_LOOPBACK_NONE 
ADI_APOLLO_LOOPBACK_0 
ADI_APOLLO_LOOPBACK_1 
ADI_APOLLO_LOOPBACK_2 
ADI_APOLLO_LOOPBACK_3 

Function Documentation

◆ ad9088_check_apollo_error()

int ad9088_check_apollo_error ( int ret,
const char * api_name )

Translate a vendor API return code into an errno value.

The vendor API has its own error space and does not log, so every call site funnels through here to get the failure reported once, with the name of the call that produced it.

Parameters
ret- Value returned by the vendor API call.
api_name- Name of that call, used in the error message.
Returns
- 0 when the call succeeded, -EIO otherwise.

◆ ad9088_delta_t_measurement_get()

int ad9088_delta_t_measurement_get ( struct ad9088_phy * phy,
uint32_t mode,
int64_t * apollo_delta_t )

Read back the result of a BSYNC delta-t measurement.

Parameters
phy- The device structure.
mode- 0 for the post-alignment difference, 1 for the delay that needs compensating.
apollo_delta_t- Read value, in femtoseconds.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_delta_t_measurement_set()

int ad9088_delta_t_measurement_set ( struct ad9088_phy * phy,
uint32_t mode )

Start a BSYNC delta-t measurement.

Mode 0 aligns against the incoming BSYNC. Mode 1 makes the device drive BSYNC back out so the provider can measure the return path; mode 2 stops it driving. Running 0 then 1 yields the two halves of the round-trip delay.

Parameters
phy- The device structure.
mode- 0 align, 1 output enable and loopback measure, 2 output disable.
Returns
- 0 in case of success, negative error code otherwise.

◆ AD9088_FW_DECL() [1/9]

AD9088_FW_DECL ( app_signed_encrypted_B_flash_image_0x01030000_bin )

◆ AD9088_FW_DECL() [2/9]

AD9088_FW_DECL ( app_signed_encrypted_B_flash_image_0x02000000_bin )

◆ AD9088_FW_DECL() [3/9]

AD9088_FW_DECL ( app_signed_encrypted_B_flash_image_0x20000000_bin )

◆ AD9088_FW_DECL() [4/9]

AD9088_FW_DECL ( app_signed_encrypted_B_flash_image_0x21000000_bin )

◆ AD9088_FW_DECL() [5/9]

AD9088_FW_DECL ( app_signed_encrypted_prod_B_flash_image_0x01030000_bin )

◆ AD9088_FW_DECL() [6/9]

AD9088_FW_DECL ( app_signed_encrypted_prod_B_flash_image_0x02000000_bin )

◆ AD9088_FW_DECL() [7/9]

AD9088_FW_DECL ( app_signed_encrypted_prod_B_flash_image_0x20000000_bin )

◆ AD9088_FW_DECL() [8/9]

AD9088_FW_DECL ( app_signed_encrypted_prod_B_flash_image_0x21000000_bin )

◆ AD9088_FW_DECL() [9/9]

AD9088_FW_DECL ( usecase_bin )

◆ ad9088_get_cnco_freq()

int ad9088_get_cnco_freq ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t cddc_num,
int64_t * freq_hz )

Read back the coarse NCO frequency shift.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
cddc_num- Coarse datapath index within the side.
freq_hz- Signed frequency shift, in Hz.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_get_fnco_freq()

int ad9088_get_fnco_freq ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t fddc_num,
int64_t * freq_hz )

Read back the fine NCO frequency shift.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
fddc_num- Fine datapath index within the side.
freq_hz- Signed frequency shift, in Hz.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_init()

int ad9088_init ( struct ad9088_phy ** device,
const struct ad9088_init_param * init_param )

Initialize the device.

Allocates the device structure, wires up the vendor API to the SPI and GPIO descriptors, verifies the buses, loads the firmware and device profile, and registers the device with the JESD204 state machine. The links themselves are brought up by that state machine, not here.

Parameters
device- The device structure.
init_param- The structure that contains the device initialisation parameters.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_inspect_jrx_link_all()

int ad9088_inspect_jrx_link_all ( struct ad9088_phy * phy)

Print the negotiated link parameters of every deframer link.

Reports what the device ended up with rather than what was requested, so it can be compared against the peer side.

Parameters
phy- The device structure.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_inspect_jtx_link_all()

int ad9088_inspect_jtx_link_all ( struct ad9088_phy * phy)

Print the negotiated link parameters of every framer link.

Reports what the device ended up with rather than what was requested, so it can be compared against the peer side.

Parameters
phy- The device structure.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_jesd_rx_link_status_print()

int ad9088_jesd_rx_link_status_print ( struct ad9088_phy * phy,
struct jesd204_link * lnk,
int retry )

Poll a deframer link until it reports good, then print its status.

Which status bits have to be set depends on the JESD204 version and, for subclass 1, additionally on the SYSREF phase having locked. Per-lane state is printed alongside the link state so a single bad lane is visible.

Parameters
phy- The device structure.
lnk- The JESD204 link.
retry- Number of extra attempts before giving up.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_jesd_tx_link_status_print()

int ad9088_jesd_tx_link_status_print ( struct ad9088_phy * phy,
struct jesd204_link * lnk,
int retry )

Poll a framer link until it reports good, then print its status.

Which status bits have to be set depends on the JESD204 version in use. The status is only printed once settled, or on the final attempt, so a link that comes up normally logs a single line.

Parameters
phy- The device structure.
lnk- The JESD204 link.
retry- Number of extra attempts before giving up.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_mcs_init_cal_setup()

int ad9088_mcs_init_cal_setup ( struct ad9088_phy * phy)

Zero the desired internal-to-external SYSREF offsets before init cal.

The offsets are what the calibration aims for; zero asks for the internal SYSREF to land on the external edge. Which offsets exist depends on whether the device runs one clock or two.

Parameters
phy- The device structure.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_mcs_init_cal_status_print()

void ad9088_mcs_init_cal_status_print ( struct ad9088_phy * phy,
adi_apollo_mcs_cal_init_status_t * cal_status )

Print the MCS init cal status and measurements.

Parameters
phy- The device structure.
cal_status- Init cal status read back from the device.

◆ ad9088_mcs_init_cal_validate()

int ad9088_mcs_init_cal_validate ( struct ad9088_phy * phy,
adi_apollo_mcs_cal_init_status_t * cal_status )

Check that MCS init cal aligned the internal SYSREF and locked.

The external and internal SYSREF must end up within +/- 0.4 device clock cycles of the offset the calibration recommended, and the relevant SYSREF must report locked. In dual clock mode both sides are checked and at least one must lock; in single clock mode only the center matters.

Parameters
phy- The device structure.
cal_status- Init cal status read back from the device.
Returns
- 0 when the calibration is good, negative otherwise.

◆ ad9088_mcs_tracking_cal_setup()

int ad9088_mcs_tracking_cal_setup ( struct ad9088_phy * phy,
uint32_t mcs_track_decimation,
uint16_t initialize_track_cal )

Arm MCS tracking calibration.

Tracking cal keeps the internal SYSREF on the external edge as the device clock drifts, by trimming the clock PLL. Only supported in single clock mode.

Parameters
phy- The device structure.
mcs_track_decimation- TDC decimation; higher is more precise.
initialize_track_cal- Initialize the tracking cal, needed unless the device profile already did it.
Returns
- 0 in case of success, negative error otherwise.

◆ ad9088_parse_struct()

int ad9088_parse_struct ( struct ad9088_phy ** device,
const struct ad9088_init_param * init_param )

Allocate the device structure and apply the initialisation parameters.

Acquires the SPI and GPIO descriptors, loads and version-checks the device profile, then applies the caller's overrides to it: lane mapping, JESD204 subclass, Nyquist zone and multi-chip synchronisation settings. The profile checksum is recomputed last so the on-chip firmware still accepts the modified profile.

On failure everything acquired so far is released.

Parameters
device- The device structure to allocate.
init_param- The structure that contains the device initialisation parameters.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_print_link_phase()

void ad9088_print_link_phase ( struct ad9088_phy * phy,
struct jesd204_link * lnk )

Print the deframer phase difference for one link.

Parameters
phy- The device structure.
lnk- The JESD204 link.

◆ ad9088_print_sysref_phase()

void ad9088_print_sysref_phase ( struct ad9088_phy * phy)

Print the captured SYSREF phase several times over.

The value is a signed count of device clock periods between the external and internal SYSREF edges. It is sampled repeatedly because a phase that moves between reads means the capture is not deterministic, which a single read would hide.

Parameters
phy- The device structure.

◆ ad9088_remove()

int ad9088_remove ( struct ad9088_phy * phy)

Free the resources allocated by ad9088_init().

Parameters
phy- The device structure.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_cnco_freq()

int ad9088_set_cnco_freq ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t cddc_num,
int64_t freq_hz )

Set the coarse NCO frequency shift.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
cddc_num- Coarse datapath index within the side.
freq_hz- Signed frequency shift, in Hz.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_cnco_test_tone()

int ad9088_set_cnco_test_tone ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t cddc_num,
bool enable,
uint16_t offset )

Enable or disable the coarse NCO DC test tone.

While the tone is enabled the mixer runs in test mode and emits a DC offset instead of mixing; disabling it restores the mixer mode the device profile asks for.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
cddc_num- Coarse datapath index within the side.
enable- True to emit the tone, false to restore normal mixing.
offset- Tone amplitude as a raw DC offset, clamped to the maximum the datapath accepts.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_fnco_freq()

int ad9088_set_fnco_freq ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t fddc_num,
int64_t freq_hz )

Set the fine NCO frequency shift.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
fddc_num- Fine datapath index within the side.
freq_hz- Signed frequency shift, in Hz.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_fnco_test_tone()

int ad9088_set_fnco_test_tone ( struct ad9088_phy * phy,
adi_apollo_terminal_e terminal,
uint8_t side,
uint8_t fddc_num,
bool enable,
uint16_t offset )

Enable or disable the fine NCO DC test tone.

While the tone is enabled the mixer runs in test mode and emits a DC offset instead of mixing; disabling it restores the mixer mode the device profile asks for.

Parameters
phy- The device structure.
terminal- Selects the transmit or receive datapath.
side- Datapath side index.
fddc_num- Fine datapath index within the side.
enable- True to emit the tone, false to restore normal mixing.
offset- Tone amplitude as a raw DC offset, clamped to the maximum the datapath accepts.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_set_loopback_mode()

int ad9088_set_loopback_mode ( struct ad9088_phy * phy,
uint8_t side,
uint8_t mode )

Select the datapath loopback mode for one side.

Any active loopback is torn down first, so switching modes needs a single call. A loopback only makes sense when the two directions run at the same sample rate, which is checked here.

Parameters
phy- The device structure.
side- Datapath side index.
mode- One of the ADI_APOLLO_LOOPBACK_* modes.
Returns
- 0 in case of success, negative error code otherwise.

◆ ad9088_to_link()

uint8_t ad9088_to_link ( uint8_t linkid)

Map a state-machine link identifier onto a device link identifier.

The state machine numbers the transmit and receive links in one sequence, while the device numbers each direction from zero, so the two halves of the range fold onto the same device identifiers.

Parameters
linkid- State-machine link identifier.
Returns
- The corresponding device link identifier.

◆ adi_ad9088_calc_nco_freq()

int adi_ad9088_calc_nco_freq ( struct ad9088_phy * phy,
uint64_t freq,
uint64_t ftw,
uint32_t a,
uint32_t b,
uint32_t bits,
int64_t * nco_shift )

Convert a frequency tuning word back into a frequency shift.

The inverse of adi_ad9088_calc_nco_ftw(). Tuning words in the upper half of the accumulator range encode a negative shift.

Parameters
phy- The device structure.
freq- NCO clock rate, in Hz.
ftw- Integer frequency tuning word.
a- Numerator of the fractional part.
b- Denominator of the fractional part.
bits- Accumulator width of the source NCO, in bits.
nco_shift- Decoded signed frequency shift, in Hz.
Returns
- 0 in case of success, negative error code otherwise.

◆ adi_ad9088_calc_nco_ftw()

int adi_ad9088_calc_nco_ftw ( struct ad9088_phy * phy,
uint64_t freq,
int64_t nco_shift,
uint32_t div,
uint32_t bits,
uint64_t * ftw,
uint64_t * frac_a,
uint64_t * frac_b )

Convert an NCO frequency shift into a frequency tuning word.

The tuning word is the shift expressed as a fraction of the NCO clock, scaled to the accumulator width. Whatever the integer word cannot express is returned as the fraction frac_a / frac_b, which the dual-modulus modes use to reach an exact shift.

Parameters
phy- The device structure.
freq- Converter sample rate, in Hz.
nco_shift- Signed frequency shift to encode, in Hz.
div- Decimation or interpolation ratio between the converter and the NCO, so that freq / div is the NCO clock.
bits- Accumulator width of the target NCO, in bits.
ftw- Integer frequency tuning word.
frac_a- Numerator of the leftover fraction.
frac_b- Denominator of the leftover fraction.
Returns
- 0 in case of success, negative error code otherwise.

Variable Documentation

◆ ad9088_fsm_links_to_str

const char* const ad9088_fsm_links_to_str[]
extern

◆ jesd204_ad9088_init

const struct jesd204_dev_data jesd204_ad9088_init
extern