no-OS
iio_ad9361.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef IIO_AD9361_H_
40 #define IIO_AD9361_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 
46 #include <stdio.h>
47 #include <stdbool.h>
48 #include "iio.h"
49 #include "iio_types.h"
50 
51 /******************************************************************************/
52 /*************************** Types Declarations *******************************/
53 /******************************************************************************/
54 
62 };
63 
71 };
72 
73 /******************************************************************************/
74 /************************ Functions Declarations ******************************/
75 /******************************************************************************/
76 
77 /* Init ad9361 iio. */
78 int32_t iio_ad9361_init(struct iio_ad9361_desc **desc,
79  struct iio_ad9361_init_param *init);
80 /* Get desciptor. */
82  struct iio_device **dev_descriptor);
83 /* Free the resources allocated by iio_ad9361_init(). */
84 int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc);
85 
86 #endif /* IIO_AD9361_H_ */
ENSM_STATE_SLEEP
#define ENSM_STATE_SLEEP
Definition: ad9361.h:770
ad9361_phy_platform_data::port_ctrl
struct port_control port_ctrl
Definition: ad9361.h:3213
port_control::pp_conf
uint8_t pp_conf[3]
Definition: ad9361.h:3067
ad9361_phy_platform_data::fdd_independent_mode
bool fdd_independent_mode
Definition: ad9361.h:3170
ad9361_rf_phy::bbdc_track_en
bool bbdc_track_en
Definition: ad9361.h:3400
altvoltage_attributes
struct iio_attribute altvoltage_attributes[]
Definition: iio_ad9361.c:2016
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:114
iio_channel
Struct describing the scan type.
Definition: iio_types.h:177
ad9361_fastlock_recall
int32_t ad9361_fastlock_recall(struct ad9361_rf_phy *phy, bool tx, uint32_t profile)
Definition: ad9361.c:5143
iio_ad9361_remove
int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc)
Release resources.
Definition: iio_ad9361.c:2276
LO_DONTCARE
@ LO_DONTCARE
Definition: ad9361.h:3329
iio_ad9361_desc
Structure holding iio descriptor.
Definition: iio_ad9361.h:68
ad9361_fastlock_save
int32_t ad9361_fastlock_save(struct ad9361_rf_phy *phy, bool tx, uint32_t profile, uint8_t *values)
Definition: ad9361.c:5199
rf_rx_gain
Definition: ad9361.h:3222
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:261
ad9361_get_temperature
int32_t ad9361_get_temperature(struct ad9361_rf_phy *phy, int32_t *temp)
Definition: ad9361_api.c:2213
ad9361_rf_phy::rx_fir_ntaps
uint8_t rx_fir_ntaps
Definition: ad9361.h:3397
ad9361_do_calib
int32_t ad9361_do_calib(struct ad9361_rf_phy *phy, uint32_t cal, int32_t arg)
Definition: ad9361_api.c:2115
ad9361_fastlock::current_profile
uint8_t current_profile[2]
Definition: ad9361.h:3309
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:101
ad9361_ensm_states
const char * ad9361_ensm_states[12]
Definition: ad9361.c:686
ad9361_rf_phy::rfdc_track_en
bool rfdc_track_en
Definition: ad9361.h:3399
ad9361_fastlock_load
int32_t ad9361_fastlock_load(struct ad9361_rf_phy *phy, bool tx, uint32_t profile, uint8_t *values)
Definition: ad9361.c:4970
RX_LO_POWER_DOWN
#define RX_LO_POWER_DOWN
Definition: ad9361.h:944
AD9363A_MAX_CARRIER_FREQ_HZ
#define AD9363A_MAX_CARRIER_FREQ_HZ
Definition: ad9361.h:2862
AD9361_TEMP
#define AD9361_TEMP(_idx)
Definition: iio_ad9361.c:2202
AD9361_VOLTAGE_IN
#define AD9361_VOLTAGE_IN(_idx)
Definition: iio_ad9361.c:2172
ad9361_set_rx_lo_int_ext
int32_t ad9361_set_rx_lo_int_ext(struct ad9361_rf_phy *phy, uint8_t int_ext)
Definition: ad9361_api.c:902
ad9361_get_rx_sampling_freq
int32_t ad9361_get_rx_sampling_freq(struct ad9361_rf_phy *phy, uint32_t *sampling_freq_hz)
Definition: ad9361_api.c:848
rf_rssi::multiplier
int32_t multiplier
Definition: ad9361.h:3239
ad9361_rf_phy::agc_mode
uint8_t agc_mode[2]
Definition: ad9361.h:3398
iio_ch_info::ch_out
bool ch_out
Definition: iio_types.h:105
iio_ad9361_get_dev_descriptor
void iio_ad9361_get_dev_descriptor(struct iio_ad9361_desc *desc, struct iio_device **dev_descriptor)
Get iio device descriptor.
Definition: iio_ad9361.c:2238
LVDS_MODE
#define LVDS_MODE
Definition: ad9361.h:708
ad9361_set_tx_lo_int_ext
int32_t ad9361_set_tx_lo_int_ext(struct ad9361_rf_phy *phy, uint8_t int_ext)
Definition: ad9361_api.c:1542
ENSM_STATE_SLEEP_WAIT
#define ENSM_STATE_SLEEP_WAIT
Definition: ad9361.h:761
ad9361_parse_fir
int32_t ad9361_parse_fir(struct ad9361_rf_phy *phy, char *data, uint32_t size)
Definition: ad9361.c:5884
device
Definition: ad9361_util.h:75
ad9361_set_dcxo_tune
int32_t ad9361_set_dcxo_tune(struct ad9361_rf_phy *phy, uint32_t coarse, uint32_t fine)
Definition: ad9361.c:3495
TX_QUAD_CAL
#define TX_QUAD_CAL
Definition: ad9361.h:749
ad9361_fastlock::save_profile
uint8_t save_profile
Definition: ad9361.h:3308
ad9361_1rx1tx_channel_map
int32_t ad9361_1rx1tx_channel_map(struct ad9361_rf_phy *phy, bool tx, int32_t channel)
Definition: ad9361.c:990
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:53
no_os_str_to_uint32
uint32_t no_os_str_to_uint32(const char *str)
ENSM_STATE_TX
#define ENSM_STATE_TX
Definition: ad9361.h:763
ad9361_get_rx_fir_en_dis
int32_t ad9361_get_rx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Definition: ad9361_api.c:1097
ad9361_set_tx_fir_en_dis
int32_t ad9361_set_tx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t en_dis)
Definition: ad9361_api.c:1636
ENSM_STATE_FDD
#define ENSM_STATE_FDD
Definition: ad9361.h:767
ad9361_set_rx_gain
int32_t ad9361_set_rx_gain(struct ad9361_rf_phy *phy, uint32_t rx_id, struct rf_rx_gain *rx_gain)
Definition: ad9361.c:2197
TX_RFPLL
@ TX_RFPLL
Definition: ad9361.h:3286
ad9361_rssi_gain_step_calib
int32_t ad9361_rssi_gain_step_calib(struct ad9361_rf_phy *phy)
Definition: ad9361.c:7393
ad9361_ensm_get_state
uint8_t ad9361_ensm_get_state(struct ad9361_rf_phy *phy)
Definition: ad9361.c:1948
ad9361_phy_platform_data::dcxo_coarse
uint32_t dcxo_coarse
Definition: ad9361.h:3190
iio_ad9361_init_param::ad9361_phy
struct ad9361_rf_phy * ad9361_phy
Definition: iio_ad9361.h:61
iio_ad9361.h
Header file of iio_ad9361.
ad9361_gt
uint32_t ad9361_gt(struct ad9361_rf_phy *phy)
Definition: ad9361.c:1348
voltage_output_attributes
struct iio_attribute voltage_output_attributes[]
Definition: iio_ad9361.c:1883
voltage_input_attributes
struct iio_attribute voltage_input_attributes[]
Definition: iio_ad9361.c:1937
ad9361_phy_platform_data::update_tx_gain_via_alert
bool update_tx_gain_via_alert
Definition: ad9361.h:3204
iio.h
Header file of iio.
no_os_error.h
Error codes definition.
ad9361_get_tx_fir_en_dis
int32_t ad9361_get_tx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Definition: ad9361_api.c:1659
temp0_attributes
struct iio_attribute temp0_attributes[]
Definition: iio_ad9361.c:2069
iio_attribute::name
const char * name
Definition: iio_types.h:140
ad9361_get_tx_rssi
int32_t ad9361_get_tx_rssi(struct ad9361_rf_phy *phy, uint8_t ch, uint32_t *rssi_db_x_1000)
Definition: ad9361_api.c:1677
ad9361_set_ensm_mode
int32_t ad9361_set_ensm_mode(struct ad9361_rf_phy *phy, bool fdd, bool pinctrl)
Definition: ad9361.c:4880
iio_ad9361_desc::dev_descriptor
struct iio_device dev_descriptor
Definition: iio_ad9361.h:70
ad9361_rf_phy::bypass_rx_fir
bool bypass_rx_fir
Definition: ad9361.h:3386
ENSM_STATE_RX
#define ENSM_STATE_RX
Definition: ad9361.h:765
ad9361_synth_lo_powerdown
int ad9361_synth_lo_powerdown(struct ad9361_rf_phy *phy, enum synth_pd_ctrl rx, enum synth_pd_ctrl tx)
Definition: ad9361.c:3440
iio_device::debug_attributes
struct iio_attribute * debug_attributes
Definition: iio_types.h:265
ad9361_rf_phy::rx_fir_dec
uint8_t rx_fir_dec
Definition: ad9361.h:3396
AD9361_OUT
#define AD9361_OUT()
Definition: iio_ad9361.c:2212
ENSM_STATE_ALERT
#define ENSM_STATE_ALERT
Definition: ad9361.h:762
iio_ad9361_init
int32_t iio_ad9361_init(struct iio_ad9361_desc **desc, struct iio_ad9361_init_param *init)
Init for reading/writing and parameterization of a ad9361 device.
Definition: iio_ad9361.c:2251
ad9361_set_gain_ctrl_mode
int32_t ad9361_set_gain_ctrl_mode(struct ad9361_rf_phy *phy, struct rf_gain_ctrl *gain_ctrl)
Definition: ad9361.c:2350
clk_get_rate
uint32_t clk_get_rate(struct ad9361_rf_phy *phy, struct refclk_scale *clk_priv)
clk_get_rate
Definition: ad9361_util.c:67
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:138
ad9361_rf_phy::fastlock
struct ad9361_fastlock fastlock
Definition: ad9361.h:3407
ad9361_ensm_set_state
int32_t ad9361_ensm_set_state(struct ad9361_rf_phy *phy, uint8_t ensm_state, bool pinctrl)
Definition: ad9361.c:4406
LO_OFF
@ LO_OFF
Definition: ad9361.h:3330
ad9361_phy_platform_data::use_ext_rx_lo
bool use_ext_rx_lo
Definition: ad9361.h:3178
rf_rx_gain::gain_db
int32_t gain_db
Definition: ad9361.h:3224
LO_ON
@ LO_ON
Definition: ad9361.h:3331
AD9361_VOLTAGE_OUT
#define AD9361_VOLTAGE_OUT(_idx)
Definition: iio_ad9361.c:2182
ad9361_get_tx_auto_cal_en_dis
int32_t ad9361_get_tx_auto_cal_en_dis(struct ad9361_rf_phy *phy, uint8_t *en_dis)
Definition: ad9361_api.c:1773
ad9361_phy_platform_data::rx2tx2
bool rx2tx2
Definition: ad9361.h:3168
ad9361_rf_phy
Definition: ad9361.h:3340
no_os_str_to_int32
int32_t no_os_str_to_int32(const char *str)
rf_gain_ctrl
Definition: ad9361.h:2902
ad9361_set_rx_rf_port_input
int32_t ad9361_set_rx_rf_port_input(struct ad9361_rf_phy *phy, uint32_t mode)
Definition: ad9361_api.c:1238
ad9361_phy_platform_data::fdd
bool fdd
Definition: ad9361.h:3169
ad9361_rf_phy::cached_synth_pd
uint8_t cached_synth_pd[2]
Definition: ad9361.h:3364
AD9363A_MIN_CARRIER_FREQ_HZ
#define AD9363A_MIN_CARRIER_FREQ_HZ
Definition: ad9361.h:2863
ad9361_set_tx_rf_port_output
int32_t ad9361_set_tx_rf_port_output(struct ad9361_rf_phy *phy, uint32_t mode)
Definition: ad9361_api.c:1719
ad9361_set_tx_auto_cal_en_dis
int32_t ad9361_set_tx_auto_cal_en_dis(struct ad9361_rf_phy *phy, uint8_t en_dis)
Definition: ad9361_api.c:1756
ad9361_rf_phy::current_rx_bw_Hz
uint32_t current_rx_bw_Hz
Definition: ad9361.h:3382
ad9361_rf_phy::quad_track_en
bool quad_track_en
Definition: ad9361.h:3401
ad9361_rf_phy::tx_fir_int
uint8_t tx_fir_int
Definition: ad9361.h:3394
iio_ad9361_init_param
Configuration structure.
Definition: iio_ad9361.h:59
ad9361_get_tx_rf_port_output
int32_t ad9361_get_tx_rf_port_output(struct ad9361_rf_phy *phy, uint32_t *mode)
Definition: ad9361_api.c:1739
ad9361_rf_phy::ref_clk_scale
struct refclk_scale * ref_clk_scale[NUM_AD9361_CLKS]
Definition: ad9361.h:3353
ad9361_to_clk
uint32_t ad9361_to_clk(uint64_t freq)
Definition: ad9361.c:1364
ad9361_set_tx_atten
int32_t ad9361_set_tx_atten(struct ad9361_rf_phy *phy, uint32_t atten_mdb, bool tx1, bool tx2, bool immed)
Definition: ad9361.c:1614
RX_RFPLL
@ RX_RFPLL
Definition: ad9361.h:3285
no_os_clamp_t
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:75
rf_gain_ctrl::mode
uint8_t mode
Definition: ad9361.h:2904
iio_device::buffer_attributes
struct iio_attribute * buffer_attributes
Definition: iio_types.h:267
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:259
ad9361_get_rx_rssi
int32_t ad9361_get_rx_rssi(struct ad9361_rf_phy *phy, uint8_t ch, struct rf_rssi *rssi)
Definition: ad9361_api.c:926
ad9361_rf_phy::rate_governor
uint32_t rate_governor
Definition: ad9361.h:3385
ad9361_set_rx_fir_en_dis
int32_t ad9361_set_rx_fir_en_dis(struct ad9361_rf_phy *phy, uint8_t en_dis)
Definition: ad9361_api.c:1074
ad9361_mcs
int32_t ad9361_mcs(struct ad9361_rf_phy *phy, int32_t step)
Definition: ad9361.c:5219
iio_ad9361_init
int32_t iio_ad9361_init(struct iio_ad9361_desc **desc, struct iio_ad9361_init_param *init)
Init for reading/writing and parameterization of a ad9361 device.
Definition: iio_ad9361.c:2251
AD9361_ALTVOLTAGE_OUT
#define AD9361_ALTVOLTAGE_OUT(_idx)
Definition: iio_ad9361.c:2192
ad9361_from_clk
uint64_t ad9361_from_clk(uint32_t freq)
Definition: ad9361.c:1375
NULL
#define NULL
Definition: wrapper.h:64
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:103
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:254
ad9361_phy
struct ad9361_rf_phy * ad9361_phy
Definition: main.c:508
rf_gain_ctrl::ant
uint32_t ant
Definition: ad9361.h:2903
no_os_clk_set_rate
int32_t no_os_clk_set_rate(struct no_os_clk *clk, uint64_t rate)
ad9361_get_rx_rf_port_input
int32_t ad9361_get_rx_rf_port_input(struct ad9361_rf_phy *phy, uint32_t *mode)
Definition: ad9361_api.c:1258
ad9361_rf_phy::current_tx_bw_Hz
uint32_t current_tx_bw_Hz
Definition: ad9361.h:3383
ad9361_set_rx_sampling_freq
int32_t ad9361_set_rx_sampling_freq(struct ad9361_rf_phy *phy, uint32_t sampling_freq_hz)
Definition: ad9361_api.c:823
ad9361_get_rx_gain
int32_t ad9361_get_rx_gain(struct ad9361_rf_phy *phy, uint32_t rx_id, struct rf_rx_gain *rx_gain)
Definition: ad9361.c:1882
ad9361_get_trx_rate_gov
int32_t ad9361_get_trx_rate_gov(struct ad9361_rf_phy *phy, uint32_t *rate_gov)
Definition: ad9361_api.c:2096
out_attributes
struct iio_attribute out_attributes[]
Definition: iio_ad9361.c:2060
ad9361_validate_rf_bw
uint32_t ad9361_validate_rf_bw(struct ad9361_rf_phy *phy, uint32_t bw)
Definition: ad9361.c:912
ad9361_update_rf_bandwidth
int32_t ad9361_update_rf_bandwidth(struct ad9361_rf_phy *phy, uint32_t rf_rx_bw, uint32_t rf_tx_bw)
Definition: ad9361.c:5688
get_sampling_frequency
int get_sampling_frequency(struct axi_adc *dev, uint32_t chan, uint64_t *sampling_freq_hz)
Definition: headless.c:80
rf_rssi::symbol
uint32_t symbol
Definition: ad9361.h:3237
rf_rssi
Definition: ad9361.h:3235
ad9361_rf_phy::gt_info
struct gain_table_info * gt_info
Definition: ad9361.h:3367
no_os_util.h
Header file of utility functions.
ad9361_get_trx_clock_chain
int32_t ad9361_get_trx_clock_chain(struct ad9361_rf_phy *phy, uint32_t *rx_path_clks, uint32_t *tx_path_clks)
Definition: ad9361.c:4700
ad9361_rf_phy::pdata
struct ad9361_phy_platform_data * pdata
Definition: ad9361.h:3359
RX_FAST_LOCK_CONFIG_WORD_NUM
#define RX_FAST_LOCK_CONFIG_WORD_NUM
Definition: ad9361.h:2419
ad9361_phy_platform_data::use_extclk
bool use_extclk
Definition: ad9361.h:3172
ad9361_set_trx_rate_gov
int32_t ad9361_set_trx_rate_gov(struct ad9361_rf_phy *phy, uint32_t rate_gov)
Definition: ad9361_api.c:2080
ad9361_phy_platform_data::dcxo_fine
uint32_t dcxo_fine
Definition: ad9361.h:3191
ad9361_phy_platform_data::use_ext_tx_lo
bool use_ext_tx_lo
Definition: ad9361.h:3179
RFDC_CAL
#define RFDC_CAL
Definition: ad9361.h:752
iio_ad9361_remove
int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc)
Release resources.
Definition: iio_ad9361.c:2276
ad9361_fastlock_store
int32_t ad9361_fastlock_store(struct ad9361_rf_phy *phy, bool tx, uint32_t profile)
Definition: ad9361.c:5013
ad9361_get_tx_atten
int32_t ad9361_get_tx_atten(struct ad9361_rf_phy *phy, uint32_t tx_num)
Definition: ad9361.c:1653
ad9361_api.h
Header file of AD9361 API Driver.
errno.h
Error macro definition for ARM Compiler.
ad9361_tracking_control
int32_t ad9361_tracking_control(struct ad9361_rf_phy *phy, bool bbdc_track, bool rfdc_track, bool rxquad_track)
Definition: ad9361.c:3289
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:263
ad9361_rf_phy::bypass_tx_fir
bool bypass_tx_fir
Definition: ad9361.h:3387
ad9361_rf_phy::tx_fir_ntaps
uint8_t tx_fir_ntaps
Definition: ad9361.h:3395
iio_ad9361_get_dev_descriptor
void iio_ad9361_get_dev_descriptor(struct iio_ad9361_desc *desc, struct iio_device **dev_descriptor)
Get iio device descriptor.
Definition: iio_ad9361.c:2238
MIN_ADC_CLK
#define MIN_ADC_CLK
Definition: ad9361.h:2834