no-OS
|
Contains AD9208 APIs for ADC Chip Level Configuration and Control. More...
Macros | |
#define | AD9208_IP_CLK_MIN_HZ 2500000000ULL |
#define | AD9208_IP_CLK_MAX_HZ 6000000000ULL |
#define | AD9208_ADC_CLK_MIN_HZ 2500000000ULL |
#define | AD9208_ADC_CLK_MAX_HZ 3100000000ULL |
#define | HW_RESET_PERIOD_US 5000 |
#define | SPI_RESET_PERIOD_US 5000 |
Functions | |
int | ad9208_init (ad9208_handle_t *h) |
Initialize AD9208 Device This API must be called first before any other API calls. It performs internal API initialization of the memory and API states. If AD9208 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 AD9208 devices. For example GPIO, SPI etc. More... | |
int | ad9208_deinit (ad9208_handle_t *h) |
De-initialize the AD9208 Device. More... | |
int | ad9208_get_chip_id (ad9208_handle_t *h, adi_chip_id_t *chip_id) |
Get Chip Identification Data. More... | |
int | ad9208_reset (ad9208_handle_t *h, uint8_t hw_reset) |
Reset the AD9208. More... | |
int | ad9208_adc_set_channel_select (ad9208_handle_t *h, uint8_t ch) |
Set AD9208 ADC Channel Select. More... | |
int | ad9208_adc_get_channel_select (ad9208_handle_t *h, uint8_t *ch) |
Get AD9208 ADC Channel Select. More... | |
int | ad9208_set_pdn_pin_mode (ad9208_handle_t *h, uint8_t pin_enable, ad9208_pdn_mode_t pin_mode) |
Sets the operation of the Power Down pin the AD9208. More... | |
int | ad9208_adc_set_ch_pdn_mode (ad9208_handle_t *h, ad9208_pdn_mode_t mode) |
Set ADC Channel Power Down Mode. More... | |
int | ad9208_set_input_clk_cfg (ad9208_handle_t *h, uint64_t clk_freq_hz, uint8_t div) |
Set AD9208 Input Sample Clock Configuration. More... | |
int | ad9208_get_adc_clk_freq (ad9208_handle_t *h, uint64_t *adc_clk_freq_hz) |
Get AD9208 ADC Sampling Clock (Fs) value. More... | |
int | ad9208_set_input_clk_duty_cycle_stabilizer (ad9208_handle_t *h, uint8_t en) |
Set AD9208 Input Sample Clock Duty Cycle Enablers. More... | |
int | ad9208_get_revision (ad9208_handle_t *h, uint8_t *rev_major, uint8_t *rev_minor, uint8_t *rev_rc) |
Get API Revision Data. More... | |
Contains AD9208 APIs for ADC Chip Level Configuration and Control.
Release 1.0.x
Copyright(c) 2017 Analog Devices, Inc. All Rights Reserved. This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.
#define AD9208_ADC_CLK_MAX_HZ 3100000000ULL |
#define AD9208_ADC_CLK_MIN_HZ 2500000000ULL |
#define AD9208_IP_CLK_MAX_HZ 6000000000ULL |
#define AD9208_IP_CLK_MIN_HZ 2500000000ULL |
#define HW_RESET_PERIOD_US 5000 |
#define SPI_RESET_PERIOD_US 5000 |
int ad9208_adc_get_channel_select | ( | ad9208_handle_t * | h, |
uint8_t * | ch | ||
) |
Get AD9208 ADC Channel Select.
Returns the ADC Channels currently Selected
h | Pointer to the AD9208 device reference handle. |
*ch | A pointer to a Bit wise representation of ADC Channels that are currently active ADC channels are enumerated by ad9208_adc_ch_t For example: *ch = AD9208_ADC_CH_NONE ....No Channel selected *ch = AD9208_ADC_CH_A | AD9208_ADC_CH_B ... Channel A and Channel B Select |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_adc_set_ch_pdn_mode | ( | ad9208_handle_t * | h, |
ad9208_pdn_mode_t | mode | ||
) |
Set ADC Channel Power Down Mode.
Sets the Powerdown mode of the AD9208 Channels. The AD9208 has 3 powerdown settings PowerUp/Normal Operation, StandBy Mode, Powerdown Mode This API may be used to set the desired powerdown mode via software. Note 1: The AD9208 also features a Hardware CTRL PIN that may be configured as a global Power down Pin. Note 2: This API should be used in conjunction with ad9208_adc_set_channel_select To set the target channel.
h | Pointer to the AD9208 device reference handle. |
mode | Desired Powerdown mode |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_adc_set_channel_select | ( | ad9208_handle_t * | h, |
uint8_t | ch | ||
) |
Set AD9208 ADC Channel Select.
Selects the ADC Channels to be active for configuration. Once an ADC Channel is selected to be active subsequent API calls related to ADC Channel configuration shall be applied to that API
h | Pointer to the AD9208 device reference handle. |
ch | Bit wise representation of ADC Channels to be made active ADC channels are enumerated by ad9208_adc_ch_t For example ch = AD9208_ADC_CH_NONE ....No Channel selected ch = AD9208_ADC_CH_A | AD9208_ADC_CH_B ... Channel A and Channel B Select |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_deinit | ( | ad9208_handle_t * | h | ) |
De-initialize the AD9208 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 AD9208 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 AD9208 Device. For example GPIO, SPI etc
h | Pointer to the AD9208 device reference handle. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_HW_CLOSE | HW Close Function Failed |
int ad9208_get_adc_clk_freq | ( | ad9208_handle_t * | h, |
uint64_t * | adc_clk_freq_hz | ||
) |
Get AD9208 ADC Sampling Clock (Fs) value.
h | Pointer to the AD9208 device reference handle. |
*adc_clk_freq_hz | Pointer to the a uint64_t variable to store the ADC Clk Frequency |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_get_chip_id | ( | ad9208_handle_t * | h, |
adi_chip_id_t * | chip_id | ||
) |
Get Chip Identification Data.
read-back Product type, identification and revision data
h | Pointer to the AD9208 device reference handle. |
chip_id | Pointer to a variable of type ad9208_chip_id_t to which the product data read-back from chip shall be stored. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle. |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_get_revision | ( | ad9208_handle_t * | h, |
uint8_t * | rev_major, | ||
uint8_t * | rev_minor, | ||
uint8_t * | rev_rc | ||
) |
Get API Revision Data.
h | Pointer to the AD9208 device reference handle. |
rev_major | Pointer to variable to store the Major Revision Number |
rev_minor | Pointer to variable to store the Minor Revision Number |
rev_rc | Pointer to variable to store the RC Revision Number |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_init | ( | ad9208_handle_t * | h | ) |
Initialize AD9208 Device This API must be called first before any other API calls. It performs internal API initialization of the memory and API states. If AD9208 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 AD9208 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.
h | Pointer to the AD9208 device reference handle. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_HW_OPEN | HW Open Function Failed |
int ad9208_reset | ( | ad9208_handle_t * | h, |
uint8_t | hw_reset | ||
) |
Reset the AD9208.
Issues a hard reset or soft reset of the device. Performs a full reset of AD9208 via the hardware pin (hard) or via the spi register (soft). Resetting all SPI registers to default and triggering the required initialization sequence.
h | Pointer to the AD9208 device reference handle. |
hw_reset | A 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. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
API_ERROR_RESET_PIN_CTRL | HW Reset Pin Function Failed |
int ad9208_set_input_clk_cfg | ( | ad9208_handle_t * | h, |
uint64_t | clk_freq_hz, | ||
uint8_t | div | ||
) |
Set AD9208 Input Sample Clock Configuration.
Value of the ADC Clock shall be Input Sample Clock/Clock Divider setting. Valid range of Input Clock is 2.5 GHz to 6 GHz The ADC sample clock shall be derived from the input clock and the configured divider setting. Fs = clk_freq_hz/div. Valid range of ADC Clock is 2.5 GHz to 3.5 GHz.
h | Pointer to the AD9208 device reference handle. |
clk_freq_hz | ADC CLK applied to AD9208 |
div | The desired CLK input divider setting. Valid values are 1,2 and 4. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_set_input_clk_duty_cycle_stabilizer | ( | ad9208_handle_t * | h, |
uint8_t | en | ||
) |
Set AD9208 Input Sample Clock Duty Cycle Enablers.
When its not possible to provide a higher frequency clock, it is recommended to turn on the Dyty Cycle Stabilizers (DCS)
h | Pointer to the AD9208 device reference handle. |
en | Desired Enable setting for the targeted DCS 0= Disabled 1= Enabled. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
int ad9208_set_pdn_pin_mode | ( | ad9208_handle_t * | h, |
uint8_t | pin_enable, | ||
ad9208_pdn_mode_t | pin_mode | ||
) |
Sets the operation of the Power Down pin the AD9208.
Sets the Operation of the External power down pin of the AD9208. This pin can configured so that it control entering and exiting powerdown or Standby modes based on the signal applied to the pin. It may also be configured to be disabled so that it does not effect the powerdown mode.
h | Pointer to the AD9208 device reference handle. |
pin_enable | Powerdown pin enable/disable. 1 - Powerdown pin controls powerdown status 0 - Powerdown pin disable. Does not effect powerdown Status. |
pin_mode | Powerdown mode that Powerdown pin status, if enabled, shall control. Valid options are AD9208_STANDBY -Pin status will control AD9208 Standby Status AD9208_POWERDOWN -Pin status will control AD9208 Powerdown Status |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_SPI_XFER | SPI XFER Function Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |