no-OS
Macros | Functions
ad9528.h File Reference

Contains function declarations and ad9528Device_t structure typedef for ad9528.c. More...

#include "t_ad9528.h"
Include dependency graph for ad9528.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CLEMENTE_TDD_AD9528_CLKOUT_INDEX   13
 

Functions

ADI_ERR AD9528_initDeviceDataStruct (ad9528Device_t *device, uint32_t vcxoFrequency_Hz, uint32_t refAFrequency_Hz, uint32_t outputDeviceClock_Hz)
 Helper function for ADI transceiver eval boards to init the AD9528 data structure. More...
 
ADI_ERR AD9528_reportClockRates (ad9528Device_t *device)
 Debug function to print out summary of AD9528 setup. More...
 
ADI_ERR AD9528_resetDevice (ad9528Device_t *device)
 Performs a hard reset on the AD9528 DUT. More...
 
ADI_ERR AD9528_setSpiSettings (ad9528Device_t *device)
 Sets the AD9528 device SPI settings (3wire/4wire, MSBFirst, etc). More...
 
ADI_ERR AD9528_initialize (ad9528Device_t *device)
 Initializes the AD9528 by writing all SPI registers. More...
 
ADI_ERR AD9528_waitForPllLock (ad9528Device_t *device)
 Waits for PLL1 and PLL2 to lock and the REFA and VCXO clocks to be present. More...
 
ADI_ERR AD9528_readPllStatus (ad9528Device_t *device, uint8_t *status)
 Reads the Lock Status of the PLLs and present detect of the reference clocks. More...
 
ADI_ERR AD9528_enableClockOutputs (ad9528Device_t *device, uint16_t clkEnable)
 Update the AD9528 clock outputs that are enabled. More...
 
ADI_ERR AD9528_setupSYSREF (ad9528Device_t *device, uint16_t divideFromPll1Out, sysrefPatternMode_t sysrefPatternMode, sysrefNshotMode_t nShotPulses)
 Allow changing the 9528 SYSREF frequency and pattern mode(CONTINUOUS, PRBS vs NSHOT mode) More...
 
ADI_ERR AD9528_requestSysref (ad9528Device_t *device, uint8_t enableSYSREF)
 Send a SPI message to request a SYSREF pulse or continuous SYSREF from the AD9528. More...
 

Detailed Description

Contains function declarations and ad9528Device_t structure typedef for ad9528.c.

Macro Definition Documentation

◆ CLEMENTE_TDD_AD9528_CLKOUT_INDEX

#define CLEMENTE_TDD_AD9528_CLKOUT_INDEX   13

Legal Disclaimer Copyright 2015-2017 Analog Devices Inc. Released under the AD9371 API license, for more information see the "LICENSE.txt" file in this zip file.

Function Documentation

◆ AD9528_enableClockOutputs()

ADI_ERR AD9528_enableClockOutputs ( ad9528Device_t device,
uint16_t  clkEnable 
)

Update the AD9528 clock outputs that are enabled.

NOTE: this function will update the device structure with the parameter values passed into this function. The device->sysrefSettings->sysrefPatternMode, device->sysrefSettings->sysrefNshotMode, and device->sysrefSettings->sysrefDivide values will be updated in the device structure.

Dependencies

  • device->spiSettings
Parameters
deviceis structure pointer to AD9528 clock device structure
clkEnableSets which clock outputs are enabled. Bit per clock output. bit0 = out0, etc.
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_initDeviceDataStruct()

ADI_ERR AD9528_initDeviceDataStruct ( ad9528Device_t device,
uint32_t  vcxoFrequency_Hz,
uint32_t  refAFrequency_Hz,
uint32_t  outputDeviceClock_Hz 
)

Helper function for ADI transceiver eval boards to init the AD9528 data structure.

This function inits the AD9528 device data structure with defaults that are known to work with the ADI AD9369 and AD9371 evaluation boards. NOTE: This function will modify the contents of the AD9528 device data structure.

Dependencies

  • spi->chipSelectIndex
  • spi
Parameters
devicePointer to the AD9528 device data structure to initialize
vcxoFrequency_HzThe VCXO frequency that is connected to the AD9528
refAFrequency_HzThe reference clock frequency being input into the AD9528 REFCLK A input
outputDeviceClock_HzDesired output clock frequency to the FPGA and transceiver device
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_initialize()

ADI_ERR AD9528_initialize ( ad9528Device_t device)

Initializes the AD9528 by writing all SPI registers.

Initializes the AD9528 for use with the AD9369 transceiver. Designed to work with a reference clock of 122.88MHz. Reference clock is expected to be 30.72MHz. The output clocks from the AD9528 can run at 122.88M, 153.6M, 184.32M, 245.76M, or 307.2M. Typical setup: REFA frequency = 30.72, VCXO = 122.88MHz SYNC(SYSREF) pulses output at rate of 120kHz

Dependencies

  • All parameters in device structure
Parameters
deviceis structure pointer to AD9528 clock device structure
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_readPllStatus()

ADI_ERR AD9528_readPllStatus ( ad9528Device_t device,
uint8_t *  status 
)

Reads the Lock Status of the PLLs and present detect of the reference clocks.

NOTE: This is a non blocking function that reads a register to see if PLL1 and PLL2 are locked and Reference clock A and the VCXO input clock are detected (present). If the *status parameter is not NULL, the status will be returned. If *status is NULL, the error return value will denote if the PllStatus is locked or not with ADIERR_OK or ADIERR_FAILED.

Dependencies

  • device->spiSettings
Parameters
deviceis structure pointer to AD9528 clock device structure
statusPLL status
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_reportClockRates()

ADI_ERR AD9528_reportClockRates ( ad9528Device_t device)

Debug function to print out summary of AD9528 setup.

Parameters
deviceAD9528 Device data structure describing setup of device.
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_requestSysref()

ADI_ERR AD9528_requestSysref ( ad9528Device_t device,
uint8_t  enableSYSREF 
)

Send a SPI message to request a SYSREF pulse or continuous SYSREF from the AD9528.

Requests a SYSREF from the AD9528. It will use whatever settings for SYSREF that are current configured in the AD9528. This could be a single pulse, multiple pulses, or continuous pulses. Dependencies

  • device->spiSettings
  • device->sysrefSettings->sysrefPatternMode
Parameters
deviceis structure pointer to AD9528 clock device structure
enableSYSREFIf NSHOT SYSREF mode, this parameter is ignored. If PRBS/CONTINUOUS SYSREF mode, 1= enable SYSREF, 0= disable SYSREF.
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_resetDevice()

ADI_ERR AD9528_resetDevice ( ad9528Device_t device)

Performs a hard reset on the AD9528 DUT.

Legal Disclaimer Copyright 2015-2017 Analog Devices Inc. Released under the AD9371 API license, for more information see the "LICENSE.txt" file in this zip file. Dependencies

  • device->spiSettings->chipSelectIndex
Parameters
deviceis structure pointer to the AD9528 data structure containing settings
Returns
Returns enum ADI_ERR, ADIERR_OK=pass, !ADIERR_OK=fail

◆ AD9528_setSpiSettings()

ADI_ERR AD9528_setSpiSettings ( ad9528Device_t device)

Sets the AD9528 device SPI settings (3wire/4wire, MSBFirst, etc).

This function will use the settings in the device->spiSettings structure to set SPI stream mode, address auto increment direction, MSBFirst/LSBfirst, and 3wire/4wire mode. The AD9528 device always uses SPI MODE 0 (CPHA=0, CPOL=0). This function will update your device->spiSettings to set CHPA=0 and CPOL=0 and longInstructionWord =1 to use a 16bit instruction word.

Dependencies

  • writes device->spiSettings->CPHA = 0
  • writes device->spiSettings->CPOL = 0
  • writes device->spiSettings->longInstructionWord = 1
  • device->spiSettings->MSBFirst
  • device->spiSettings->enSpiStreaming
  • device->spiSettings->autoIncAddrUp
  • device->spiSettings->fourWireMode
Parameters
deviceis structure pointer to the AD9528 data structure containing settings
Returns
Returns enum ADI_ERR, ADIERR_OK=pass, !ADIERR_OK=fail
Here is the caller graph for this function:

◆ AD9528_setupSYSREF()

ADI_ERR AD9528_setupSYSREF ( ad9528Device_t device,
uint16_t  divideFromPll1Out,
sysrefPatternMode_t  sysrefPatternMode,
sysrefNshotMode_t  nShotPulses 
)

Allow changing the 9528 SYSREF frequency and pattern mode(CONTINUOUS, PRBS vs NSHOT mode)

NOTE: this function will update the device structure with the parameter values passed into this function. The device->sysrefSettings->sysrefPatternMode, device->sysrefSettings->sysrefNshotMode, and device->sysrefSettings->sysrefDivide values will be updated in the device structure.

Dependencies

  • device->spiSettings
Parameters
deviceis structure pointer to AD9528 clock device structure
divideFromPll1OutSets the SYSREF pulse frequency. SYSREF frequency = PLL1_VCXO frequency/divideFromPll1Out
sysrefPatternModeValid settings: NSHOT, CONTINUOUS, PRBS, STOP
nShotPulsesValid settings: ONE_PULSE=0, TWO_PULSES=2, FOUR_PULSES=3, SIX_PULSES=4, EIGHT_PULSES=5
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail

◆ AD9528_waitForPllLock()

ADI_ERR AD9528_waitForPllLock ( ad9528Device_t device)

Waits for PLL1 and PLL2 to lock and the REFA and VCXO clocks to be present.

Waits until Reference A clock and VCXO clock input to be detected (present), and PLL1 and PLL2 to lock. Will timeout after 1 second and return ADIERR_FAILED. If clock are detected and PLLs locked, returns ADIERR_OK.

Dependencies

  • device->spiSettings
Parameters
deviceis structure pointer to AD9528 clock device structure
Returns
Returns enum ADI_ERR, 0=pass, >0 = fail