no-OS
|
Contains function declarations and ad9528Device_t structure typedef for ad9528.c. More...
#include "t_ad9528.h"
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... | |
Contains function declarations and ad9528Device_t structure typedef for ad9528.c.
#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.
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 | is structure pointer to AD9528 clock device structure |
clkEnable | Sets which clock outputs are enabled. Bit per clock output. bit0 = out0, etc. |
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
device | Pointer to the AD9528 device data structure to initialize |
vcxoFrequency_Hz | The VCXO frequency that is connected to the AD9528 |
refAFrequency_Hz | The reference clock frequency being input into the AD9528 REFCLK A input |
outputDeviceClock_Hz | Desired output clock frequency to the FPGA and transceiver device |
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
device | is structure pointer to AD9528 clock device structure |
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 | is structure pointer to AD9528 clock device structure |
status | PLL status |
ADI_ERR AD9528_reportClockRates | ( | ad9528Device_t * | device | ) |
Debug function to print out summary of AD9528 setup.
device | AD9528 Device data structure describing setup of device. |
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 | is structure pointer to AD9528 clock device structure |
enableSYSREF | If NSHOT SYSREF mode, this parameter is ignored. If PRBS/CONTINUOUS SYSREF mode, 1= enable SYSREF, 0= disable SYSREF. |
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 | is structure pointer to the AD9528 data structure containing settings |
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
device | is structure pointer to the AD9528 data structure containing settings |
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 | is structure pointer to AD9528 clock device structure |
divideFromPll1Out | Sets the SYSREF pulse frequency. SYSREF frequency = PLL1_VCXO frequency/divideFromPll1Out |
sysrefPatternMode | Valid settings: NSHOT, CONTINUOUS, PRBS, STOP |
nShotPulses | Valid settings: ONE_PULSE=0, TWO_PULSES=2, FOUR_PULSES=3, SIX_PULSES=4, EIGHT_PULSES=5 |
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 | is structure pointer to AD9528 clock device structure |