libad9361  0.1
Device specific library for AD936X transceivers
Functions
Top-level functions

Functions

__api int ad9361_multichip_sync (struct iio_device *master, struct iio_device **slaves, unsigned int num_slaves, unsigned int flags)
 Multi-chip synchronization (MCS) management. More...
 
__api int ad9361_fmcomms5_multichip_sync (struct iio_context *ctx, unsigned int flags)
 FMComms5 specific MCS management. More...
 
__api int ad9361_set_bb_rate (struct iio_device *dev, unsigned long rate)
 Baseband rate configuration with generic filter support. More...
 
__api int ad9361_set_trx_fir_enable (struct iio_device *dev, int enable)
 Enable or disable transmit and receiver FIRs simultaneously. More...
 
__api int ad9361_get_trx_fir_enable (struct iio_device *dev, int *enable)
 Get current enable value of transmit and receiver FIRs. More...
 
__api int ad9361_generate_fir_taps (struct filter_design_parameters *parameters, short *taps, int *num_taps, int *gain)
 Design custom FIR filter from specific design criteria. More...
 
__api int ad9361_calculate_rf_clock_chain (unsigned long tx_sample_rate, unsigned long rate_gov, unsigned long *rx_path_clks, unsigned long *tx_path_clks)
 Calculate the clock path rates for both transmit and receiver paths. More...
 
__api int ad9361_calculate_rf_clock_chain_fdp (struct filter_design_parameters *fdpTX, struct filter_design_parameters *fdpRX, unsigned long sample_rate)
 Calculate the clock path rates and default filter settings for both transmit and receiver for a desired baseband rate. More...
 
__api int ad9361_set_bb_rate_custom_filter_auto (struct iio_device *dev, unsigned long rate)
 Baseband rate configuration with custom filter support based on desired baseband sample rate. More...
 
__api int ad9361_set_bb_rate_custom_filter_manual (struct iio_device *dev, unsigned long rate, unsigned long Fpass, unsigned long Fstop, unsigned long wnom_tx, unsigned long wnom_rx)
 Baseband rate configuration with custom filter support based on desired baseband sample rate and simplified filter configuration. More...
 

Detailed Description

Function Documentation

__api int ad9361_calculate_rf_clock_chain ( unsigned long  tx_sample_rate,
unsigned long  rate_gov,
unsigned long *  rx_path_clks,
unsigned long *  tx_path_clks 
)

Calculate the clock path rates for both transmit and receiver paths.

Parameters
tx_sample_rateSample rate in samples per second of desired baseband rate
rate_govRate governor enable setting forcing HB3=3 when enabled
rx_path_clksA pointer to a unsigned long variable where the 6 RX path rates should be stored
tx_path_clksA pointer to a unsigned long variable where the 6 TX path rates should be stored
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_calculate_rf_clock_chain_fdp ( struct filter_design_parameters fdpTX,
struct filter_design_parameters fdpRX,
unsigned long  sample_rate 
)

Calculate the clock path rates and default filter settings for both transmit and receiver for a desired baseband rate.

Parameters
fdpTXFilter design parameters structure where TX filter design parameters will be stored
fdpRXFilter design parameters structure where RX filter design parameters will be stored
sample_rateDesired basedband sample rate in samples per second for both RX and TX filter configurations
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_fmcomms5_multichip_sync ( struct iio_context *  ctx,
unsigned int  flags 
)

FMComms5 specific MCS management.

Parameters
ctxA pointer to an iio_context structure
flagsControl flags for MCS configuration
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_generate_fir_taps ( struct filter_design_parameters parameters,
short *  taps,
int *  num_taps,
int *  gain 
)

Design custom FIR filter from specific design criteria.

Parameters
parametersA pointer filter designer structure
tapsA pointer to taps of designed filter
num_tapsA pointer to integer number of taps designed in taps
gainInteger gain for designed filter
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_get_trx_fir_enable ( struct iio_device *  dev,
int *  enable 
)

Get current enable value of transmit and receiver FIRs.

Parameters
devA pointer to an iio_device structure
enableReturned integer value of FIR enabled
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_multichip_sync ( struct iio_device *  master,
struct iio_device **  slaves,
unsigned int  num_slaves,
unsigned int  flags 
)

Multi-chip synchronization (MCS) management.

Parameters
masterA pointer to an iio_device structure
slavesA double pointer to an iio_device structure
num_slavesNumber of slave devices associated with the master
flagsControl flags for MCS configuration
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_set_bb_rate ( struct iio_device *  dev,
unsigned long  rate 
)

Baseband rate configuration with generic filter support.

Parameters
devA pointer to an iio_device structure
rateRate in samples per second of desired baseband rate
Returns
On success, 0 is returned
On error, a negative errno code is returned

NOTE: Three possible filters are loaded based on required rate and associated decimation/interpolation. These filters are generally very wide band and not waveform specific.

__api int ad9361_set_bb_rate_custom_filter_auto ( struct iio_device *  dev,
unsigned long  rate 
)

Baseband rate configuration with custom filter support based on desired baseband sample rate.

Parameters
devA pointer to an iio_device structure
rateRate in samples per second of desired baseband rate
Returns
On success, 0 is returned
On error, a negative errno code is returned

NOTE: Designed filter will have the following configuration: Fpass = rate / 3 Fstop = Fpass * 1.25 wnomTX = 1.6 * Fstop wnomRX = 1.4 * Fstop

__api int ad9361_set_bb_rate_custom_filter_manual ( struct iio_device *  dev,
unsigned long  rate,
unsigned long  Fpass,
unsigned long  Fstop,
unsigned long  wnom_tx,
unsigned long  wnom_rx 
)

Baseband rate configuration with custom filter support based on desired baseband sample rate and simplified filter configuration.

Parameters
devA pointer to an iio_device structure
rateRate in samples per second of desired baseband rate
FpassStop edge frequency in hertz of passband
FstopStart edge frequency in hertz of stopband
wnom_txTX RF bandwidth of analog filter in hertz
wnom_rxRX RF bandwidth of analog filter in hertz
Returns
On success, 0 is returned
On error, a negative errno code is returned
__api int ad9361_set_trx_fir_enable ( struct iio_device *  dev,
int  enable 
)

Enable or disable transmit and receiver FIRs simultaneously.

Parameters
devA pointer to an iio_device structure
enableInteger to enable FIRs when 1 or disable when 0
Returns
On success, 0 is returned
On error, a negative errno code is returned