libad9361  0.1
Device specific library for AD936X transceivers
/home/travis/build/analogdevicesinc/libad9361-iio/ad9361.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2015 Analog Devices, Inc.
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  */
00014 
00018 #ifndef __AD9361_H__
00019 #define __AD9361_H__
00020 
00021 #ifdef __cplusplus
00022 extern "C" {
00023 #endif
00024 
00025 
00034 #define FIXUP_INTERFACE_TIMING  1
00035 
00038 #define CHECK_SAMPLE_RATES  2
00039 
00042 #ifdef _WIN32
00043 #   ifdef LIBAD9361_EXPORTS
00044 #   define __api __declspec(dllexport)
00045 #   else
00046 #   define __api __declspec(dllimport)
00047 #   endif
00048 #elif __GNUC__ >= 4 && !defined(MATLAB_MEX_FILE) && !defined(MATLAB_LOADLIBRARY)
00049 #   define __api __attribute__((visibility ("default")))
00050 #else
00051 #   define __api
00052 #endif
00053 
00054 struct iio_context;
00055 struct iio_device;
00056 
00064 struct filter_design_parameters {
00065     double Rdata; 
00066     double Fpass; 
00067     double Fstop; 
00068     double caldiv; 
00069     double FIR; 
00070     double HB1; 
00071     double DAC_div; 
00072     const char *Type; 
00073     const char *RxTx; 
00074     double RFbw; 
00075     double converter_rate; 
00076     double PLL_rate; 
00077     double Fcenter; 
00078     double wnom; 
00079     double FIRdBmin; 
00080     double int_FIR; 
00081     double PLL_mult; 
00082     double Apass; 
00083     double Astop; 
00084     double phEQ; 
00085     double HB2; 
00086     double HB3; 
00087     double maxTaps; 
00088 };
00089 
00090 /* ---------------------------------------------------------------------------*/
00091 /* ------------------------- Top-level functions -----------------------------*/
00103 __api int ad9361_multichip_sync(struct iio_device *master,
00104         struct iio_device **slaves, unsigned int num_slaves,
00105         unsigned int flags);
00106 
00112 __api int ad9361_fmcomms5_multichip_sync(
00113         struct iio_context *ctx, unsigned int flags);
00114 
00124 __api int ad9361_set_bb_rate(struct iio_device *dev, unsigned long rate);
00125 
00131 __api int ad9361_set_trx_fir_enable(struct iio_device *dev, int enable);
00132 
00138 __api int ad9361_get_trx_fir_enable(struct iio_device *dev, int *enable);
00139 
00147 __api int ad9361_generate_fir_taps(struct filter_design_parameters *parameters,
00148                                    short *taps, int *num_taps, int *gain);
00149 
00157 __api int ad9361_calculate_rf_clock_chain(unsigned long tx_sample_rate,
00158                                           unsigned long rate_gov,
00159                                           unsigned long *rx_path_clks,
00160                                           unsigned long *tx_path_clks);
00161 
00168 __api int ad9361_calculate_rf_clock_chain_fdp(struct filter_design_parameters *fdpTX,
00169                                               struct filter_design_parameters *fdpRX,
00170                                               unsigned long sample_rate);
00171 
00183 __api int ad9361_set_bb_rate_custom_filter_auto(struct iio_device *dev,
00184                                                 unsigned long rate);
00185 
00195 __api int ad9361_set_bb_rate_custom_filter_manual(struct iio_device *dev,
00196                                                   unsigned long rate, unsigned long Fpass,
00197                                                   unsigned long Fstop, unsigned long wnom_tx,
00198                                                   unsigned long wnom_rx);
00199 
00202 #ifdef __cplusplus
00203 }
00204 #endif
00205 
00206 #undef __api
00207 
00208 #endif /* __AD9361_H__ */
 All Data Structures Files Functions Variables Defines