no-OS
|
Contains AD9208 APIs for ADC, DDC, NCO configuration and control. More...
Classes | |
struct | adi_dec_filt_data |
struct | chip_decimation_ratio_cfg |
Macros | |
#define | AD9208_NOF_FC_MAX 4 |
#define | AD9208_ADC_DCM_NONE 1 |
#define | AD9208_ADC_DCM_MIN 1 |
#define | AD9208_ADC_DCM_MAX 48 |
#define | NCO_RESET_PERIOD_US 0 |
#define | LOWER_16(A) ((A) & 0xFFFF) |
#define | UPPER_16(A) (((A) >> 16) & 0xFFFF) |
#define | LOWER_32(A) ((A) & (uint32_t) 0xFFFFFFFF) |
#define | MHZ_TO_HZ(x) (((uint64_t)x)*1000*1000) |
#define | MS_TO_US(x) ((x)*1000) |
#define | U64MSB 0x8000000000000000ull |
Typedefs | |
typedef struct adi_dec_filt_data | adi_dec_filt_data |
Functions | |
int | ad9208_get_decimation (ad9208_handle_t *h, uint8_t *dcm) |
int | ad9208_adc_set_input_scale (ad9208_handle_t *h, ad9208_adc_scale_range_t full_scale_range) |
int | ad9208_adc_set_input_cfg (ad9208_handle_t *h, signal_coupling_t analog_input_mode, uint8_t ext_vref, ad9208_adc_scale_range_t full_scale_range) |
Set AD9208 ADC Input Configuration. More... | |
int | ad9208_adc_set_input_buffer_cfg (ad9208_handle_t *h, ad9208_adc_buff_curr_t buff_curr_n, ad9208_adc_buff_curr_t buff_curr_p, ad9208_adc_buff_curr_t vcm_buff) |
Set AD9208 Input Buffer Configuration. More... | |
int | ad9208_adc_set_dc_offset_filt_en (ad9208_handle_t *h, uint8_t en) |
Enable AD9208 ADC DC Offset Calibaration. More... | |
int | ad9208_adc_set_fc_ch_mode (ad9208_handle_t *h, uint8_t fc_ch) |
Set AD9208 ADC Operational Mode-Number of Channels. More... | |
int | ad9208_adc_set_dcm_mode (ad9208_handle_t *h, uint8_t dcm) |
Set AD9208 ADC Operational Mode-decimation rate. More... | |
int | ad9208_adc_set_data_format (ad9208_handle_t *h, ad9208_adc_data_frmt_t ip_data_frmt, ad9208_adc_data_frmt_t op_data_frmt) |
Set AD9208 ADC Data Format. More... | |
int | ad9208_adc_set_sync_update_mode_enable (ad9208_handle_t *h, uint8_t en) |
Set AD9208 ADC Synchronized Update mode Mode. More... | |
int | ad9208_adc_set_ddc_ip_mux (ad9208_handle_t *h, uint8_t ddc_ch, ad9208_adc_ch_t i_data_src, ad9208_adc_ch_t q_data_src) |
Select ADC Source for each DDC Channel. More... | |
int | ad9208_adc_set_ddc_dcm (ad9208_handle_t *h, uint8_t ddc_ch, uint8_t dcm) |
Set AD9208 Decimation Filters. More... | |
int | ad9208_adc_set_ddc_gain (ad9208_handle_t *h, uint8_t ddc_ch, uint8_t gain_db) |
Set AD9208 DDC Gain Stage. More... | |
int | ad9208_adc_set_ddc_nco_mode (ad9208_handle_t *h, uint8_t ddc_ch, ad9208_adc_nco_mode_t mode) |
API to set DDC Frequency Translation Mode. More... | |
int | ad9208_adc_set_ddc_nco_ftw (ad9208_handle_t *h, uint8_t ddc_ch, uint64_t ftw, uint64_t mod_a, uint64_t mod_b) |
API to directly set the NCO Parameters. More... | |
int | ad9208_adc_set_ddc_nco_phase (ad9208_handle_t *h, uint8_t ddc_ch, uint64_t po) |
Set AD9208 NCO Phase Offset. More... | |
int | ad9208_adc_set_ddc_nco (ad9208_handle_t *h, uint8_t ddc_ch, const int64_t carrier_freq_hz) |
Set AD9208 NCO based on the Channel Carrier Frequency. More... | |
int | ad9208_adc_set_ddc_nco_reset (ad9208_handle_t *h) |
API to trigger a DDC Soft Reset. More... | |
int | ad9208_adc_set_clk_phase (ad9208_handle_t *h, uint8_t phase_adj) |
Set AD9208 ADC Clock Phase Adjust. More... | |
int | ad9208_adc_temp_sensor_set_enable (ad9208_handle_t *h, uint8_t en) |
Enable Temp Sensor. More... | |
Contains AD9208 APIs for ADC, DDC, NCO 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_DCM_MAX 48 |
#define AD9208_ADC_DCM_MIN 1 |
#define AD9208_ADC_DCM_NONE 1 |
#define AD9208_NOF_FC_MAX 4 |
#define LOWER_16 | ( | A | ) | ((A) & 0xFFFF) |
#define LOWER_32 | ( | A | ) | ((A) & (uint32_t) 0xFFFFFFFF) |
#define MHZ_TO_HZ | ( | x | ) | (((uint64_t)x)*1000*1000) |
#define MS_TO_US | ( | x | ) | ((x)*1000) |
#define NCO_RESET_PERIOD_US 0 |
#define U64MSB 0x8000000000000000ull |
#define UPPER_16 | ( | A | ) | (((A) >> 16) & 0xFFFF) |
typedef struct adi_dec_filt_data adi_dec_filt_data |
int ad9208_adc_set_clk_phase | ( | ad9208_handle_t * | h, |
uint8_t | phase_adj | ||
) |
Set AD9208 ADC Clock Phase Adjust.
Note Phase can be applied independantly to each ADC. Use ad9208_adc_select_ch prior to selecting ADC Note 1: 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. |
phase_adj | Number of 1/2 cycle delays to apply. Range 0-15 0 = No Delay 1 = 1/2 Input clock Cycle delay (Invert Clock) 2 = 1 input clock cycle delay .... 15 = 7.5 Input clock Cyle delay |
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_data_format | ( | ad9208_handle_t * | h, |
ad9208_adc_data_frmt_t | ip_data_frmt, | ||
ad9208_adc_data_frmt_t | op_data_frmt | ||
) |
Set AD9208 ADC Data Format.
h | Pointer to the AD9208 device reference handle. |
ip_data_frmt | Input data format Real or Complex |
op_data_frmt | Output data format Real or Complex |
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_dc_offset_filt_en | ( | ad9208_handle_t * | h, |
uint8_t | en | ||
) |
Enable AD9208 ADC DC Offset Calibaration.
The AD9208 contains a digital filter to remove the dc offset from the output of the ADC. This API enables or disables this optional digital Filter
h | Pointer to the AD9208 device reference handle. |
en | Desired enable setting for the DC Offset Calibration 0 - Disable DC Offset Calibration 1 - Disable DC Offset Calibration |
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_dcm_mode | ( | ad9208_handle_t * | h, |
uint8_t | dcm | ||
) |
Set AD9208 ADC Operational Mode-decimation rate.
The AD9208 contains a configurable ADC signal path to support a wide range of applications. This API configures the ADC decimation mode based desired requred ADC sampling rate (Fs) and the desired output sample rate (Fout). Fs/Fout
NOTE: The ADC DCM rate shall be set to the lowest Channel DCM value.
h | Pointer to the AD9208 device reference handle. |
dcm | Set ADC Decimation Ratio Range 1-48 TODO: Verify All this modes are really Valid |
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_ddc_dcm | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
uint8_t | dcm | ||
) |
Set AD9208 Decimation Filters.
Each DDC Channel supports a range of Decimation filters This API enables the appropriate Decimation filters per Channel based on the desired decimation.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to set Decimation Filters. Valid Range 0 to 3 |
dcm | DDC Channel Decimation. Valid Range 1 - 48 |
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_ddc_gain | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
uint8_t | gain_db | ||
) |
Set AD9208 DDC Gain Stage.
Each DDC Channel contains an independently controlled gain stage. For the AD9208 a 0dB or 6dB gain can be applied. This API sets the gain for a particular DDC.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to set the Gain Stage. Range 0 to 3 |
gain_db | Desired gain setting. 0dB or 6dB |
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_ddc_ip_mux | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
ad9208_adc_ch_t | i_data_src, | ||
ad9208_adc_ch_t | q_data_src | ||
) |
Select ADC Source for each DDC Channel.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to set Decimation Filters Valid Range 0-3 |
i_data_src | ADC data source for DDC I data channel. AD9208_ADC_CH_A - ADC Channel A AD9208_ADC_CH_B - ADC Channel B |
q_data_src | ADC data source for DDC Q data channel. AD9208_ADC_CH_A - ADC Channel A AD9208_ADC_CH_B - ADC Channel B |
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_ddc_nco | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
const int64_t | carrier_freq_hz | ||
) |
Set AD9208 NCO based on the Channel Carrier Frequency.
Each DDC Channel support an NCO for frequency translation This API configures NCO based on the Channel Carrier Frequency and the adc_clk_freq_hz.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to set NCO Frequency Translation. Range 0 to 3 |
carrier_freq_hz | Desired Channel Carrier Frequency in Hz |
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_ddc_nco_ftw | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
uint64_t | ftw, | ||
uint64_t | mod_a, | ||
uint64_t | mod_b | ||
) |
API to directly set the NCO Parameters.
Each DDC Channel supports an NCO for frequency translation This API configures NCO parameters for the desired frequency Translation. Alternatively the NCO may be configured based on the carrier Frequency. Refer to ad9208_adc_set_ddc_nco
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDDC Channel on which to set NCO Frequency Translation. Range 0 to 3 |
ftw | Desired 48-bit FTW value for the NCO on the Target DDC Channel |
mod_a | Desired 48-bit MAW value for the NCO on the Target DDC Channel |
mod_b | Desired 48-bit MBW value for the NCO on the Target DDC Channel |
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_ddc_nco_mode | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
ad9208_adc_nco_mode_t | mode | ||
) |
API to set DDC Frequency Translation Mode.
Each DDC Channel supports an NCO for frequency translation. This API enables or disables the NCO to achieve Variable IF mode( NCO enabled) or Zero IF Mode (NCO disabled). Alternatively there a test mode may be enabled where the NCO directly injects a ramp into the signal path.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to enable the NCO. Range 0-3. |
mode | Desired NCO mode for target DDC Channel. |
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_ddc_nco_phase | ( | ad9208_handle_t * | h, |
uint8_t | ddc_ch, | ||
uint64_t | po | ||
) |
Set AD9208 NCO Phase Offset.
Each DDC Channel support an NCO for frequency translation This API configures NCO parameters for the desired frequency Translation.
h | Pointer to the AD9208 device reference handle. |
ddc_ch | DDC Channel on which to enable the NCO, Range 0-3 |
po | Desired 48-bit NCO Phase offset |
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_ddc_nco_reset | ( | ad9208_handle_t * | h | ) |
API to trigger a DDC Soft Reset.
Following an update NCOs may be synchronized via DDC software Reset This may be required as alternative to SYSREF signal Synchronization. All NCO will be synchronized.
h | Pointer to the AD9208 device reference handle. |
API_ERROR_OK | API Completed Successfully |
API_ERROR_INVALID_HANDLE_PTR | Invalid reference handle |
API_ERROR_INVALID_XFER_PTR | SPI Access Failed |
API_ERROR_INVALID_PARAM | Invalid Parameter |
API_ERROR_INIT_SEQ_FAIL | Init sequence failed |
API_ERROR_SPI_SDO | Invalid SPI configuration |
int ad9208_adc_set_fc_ch_mode | ( | ad9208_handle_t * | h, |
uint8_t | fc_ch | ||
) |
Set AD9208 ADC Operational Mode-Number of Channels.
The AD9208 contains a configurable ADC signal path to support a wide range of applications. This API configures the ADC operational mode based on the Carrier Frequency (Fc) Channels on input signal.
h | Pointer to the AD9208 device reference handle. |
fc_ch | Number of Carrier Frequencies. Valid Values 0 - Full Bandwidth 1 - One Channel 2 - Two Channel 4 - Four Channel |
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_input_buffer_cfg | ( | ad9208_handle_t * | h, |
ad9208_adc_buff_curr_t | buff_curr_n, | ||
ad9208_adc_buff_curr_t | buff_curr_p, | ||
ad9208_adc_buff_curr_t | vcm_buff | ||
) |
Set AD9208 Input Buffer Configuration.
The AD9208 analog inputs are internally biased to the comon mode voltage. For DC coupled applications the internal common mode buffer may be disabled. And its recommended to export the internal common mode voltage to the input buffer via the Vref pin. The buffer currents may be adjusted to optimize of SFDR over various input frequencies and bandwidth.
h | Pointer to the AD9208 device reference handle. |
buff_curr_n | N-Input buffer current. Valid values defined by ad9208_adc_buff_curr_t enumeration |
buff_curr_p | P-Input buffer current. Valid values defined by ad9208_adc_buff_curr_t enumeration |
vcm_buff | VCM buffer current. Valid values defined by ad9208_adc_buff_curr_t enumeration |
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_input_cfg | ( | ad9208_handle_t * | h, |
signal_coupling_t | analog_input_mode, | ||
uint8_t | ext_vref, | ||
ad9208_adc_scale_range_t | full_scale_range | ||
) |
Set AD9208 ADC Input Configuration.
The AD9208 analog inputs are internally biased to the comon mode voltage. For AC coupled applications an external Vref may be used. For DC coupled applications the internal common mode buffer may be disabled. And its recommended to export the internal common mode voltage reference to the input buffer via the Vref pin. Refer to the Datasheet for more details. Finally the internal voltage reference may be adjusted to modify the full-scale voltage. Refer to the Datasheet for full details.
h | Pointer to the AD9208 device reference handle. |
analog_input_mode | ADC Analog Input mode. Enumerated by signal_coupling_t COUPLING_AC - AC Coupled Mode COUPLING_DC- DC Coupled Mode |
ext_vref | External Voltage Reference mode of AC Coupled Applications. This parameter shall be ignored in DC Coupled Applications 0 - AC Coupled Mode 1- DC Coupled Mode |
full_scale_range | Full Scale Voltage settings. Valid options are defined by ad9208_adc_scale_range_t |
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_input_scale | ( | ad9208_handle_t * | h, |
ad9208_adc_scale_range_t | full_scale_range | ||
) |
int ad9208_adc_set_sync_update_mode_enable | ( | ad9208_handle_t * | h, |
uint8_t | en | ||
) |
Set AD9208 ADC Synchronized Update mode Mode.
DDC NCO Parameters and Programable Filter Registers may be updated either instantaneously or in a synchronized update. In Synchronized Mode update may be trigger by a SPI bit trigger or alternatively a GPIO pin may be configured to trigger synchronized update. This api enables or disables the synchronized update mode. This affects updates to FTW, POW, MAW & MBW and programmable filter configuration.
h | Pointer to the AD9208 device reference handle. |
en | Enable Synchronized update 0- Synchronized Update Mode Disabled. Instantaneous update 1- Synchronized Update Mode 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_adc_temp_sensor_set_enable | ( | ad9208_handle_t * | h, |
uint8_t | en | ||
) |
Enable Temp Sensor.
AD9208 Contains diode-based temperature sensors. And the diode output voltages may be output to the VREF Pin.
Note 1: the VREF pin may be used for the ADC reference voltage DC coupled applications and External VREF for the ADC in AC coupled modes. If VREF pin is used for the ADC Analog Input, VREF cannot be used for Temperature Sensor. Refer to the Datasheet and the ad9208_adc_set_input_cfg API
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. |
en | Enable the Temp Sensor Diodes. |
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_decimation | ( | ad9208_handle_t * | h, |
uint8_t * | dcm | ||
) |