no-OS
iio_ad9361.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef IIO_AD9361_H_
34 #define IIO_AD9361_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 
40 #include <stdio.h>
41 #include <stdbool.h>
42 #include "iio.h"
43 #include "iio_types.h"
44 
45 /******************************************************************************/
46 /*************************** Types Declarations *******************************/
47 /******************************************************************************/
48 
56 };
57 
65 };
66 
67 /******************************************************************************/
68 /************************ Functions Declarations ******************************/
69 /******************************************************************************/
70 
71 /* Init ad9361 iio. */
72 int32_t iio_ad9361_init(struct iio_ad9361_desc **desc,
73  struct iio_ad9361_init_param *init);
74 /* Get desciptor. */
76  struct iio_device **dev_descriptor);
77 /* Free the resources allocated by iio_ad9361_init(). */
78 int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc);
79 
80 #endif /* IIO_AD9361_H_ */
ENSM_STATE_SLEEP
#define ENSM_STATE_SLEEP
Definition: ad9361.h:764
ad9361_phy_platform_data::port_ctrl
struct port_control port_ctrl
Definition: ad9361.h:3207
port_control::pp_conf
uint8_t pp_conf[3]
Definition: ad9361.h:3061
ad9361_phy_platform_data::fdd_independent_mode
bool fdd_independent_mode
Definition: ad9361.h:3164
ad9361_rf_phy::bbdc_track_en
bool bbdc_track_en
Definition: ad9361.h:3394
altvoltage_attributes
struct iio_attribute altvoltage_attributes[]
Definition: iio_ad9361.c:2011
no_os_alloc.h
END_ATTRIBUTES_ARRAY
#define END_ATTRIBUTES_ARRAY
Definition: iio_types.h:116
iio_channel
Struct describing the scan type.
Definition: iio_types.h:168
ad9361_fastlock_recall
int32_t ad9361_fastlock_recall(struct ad9361_rf_phy *phy, bool tx, uint32_t profile)
Definition: ad9361.c:5173
iio_ad9361_remove
int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc)
Release resources.
Definition: iio_ad9361.c:2274
LO_DONTCARE
@ LO_DONTCARE
Definition: ad9361.h:3323
iio_ad9361_desc
Structure holding iio descriptor.
Definition: iio_ad9361.h:62
ad9361_fastlock_save
int32_t ad9361_fastlock_save(struct ad9361_rf_phy *phy, bool tx, uint32_t profile, uint8_t *values)
Definition: ad9361.c:5229
rf_rx_gain
Definition: ad9361.h:3216
iio_device::channels
struct iio_channel * channels
Definition: iio_types.h:254
ad9361_get_temperature
int32_t ad9361_get_temperature(struct ad9361_rf_phy *phy, int32_t *temp)
Definition: ad9361_api.c:2223
ad9361_rf_phy::rx_fir_ntaps
uint8_t rx_fir_ntaps
Definition: ad9361.h:3391
ad9361_do_calib
int32_t ad9361_do_calib(struct ad9361_rf_phy *phy, uint32_t cal, int32_t arg)
Definition: ad9361_api.c:2125
ad9361_fastlock::current_profile
uint8_t current_profile[2]
Definition: ad9361.h:3303
iio_ch_info
Structure holding channel attributess.
Definition: iio_types.h:103
ad9361_ensm_states
const char * ad9361_ensm_states[12]
Definition: ad9361.c:681
ad9361_rf_phy::rfdc_track_en
bool rfdc_track_en
Definition: ad9361.h:3393
ad9361_fastlock_load
int32_t ad9361_fastlock_load(struct ad9361_rf_phy *phy, bool tx, uint32_t profile, uint8_t *values)
Definition: ad9361.c:4998
RX_LO_POWER_DOWN
#define RX_LO_POWER_DOWN
Definition: ad9361.h:938
AD9363A_MAX_CARRIER_FREQ_HZ
#define AD9363A_MAX_CARRIER_FREQ_HZ
Definition: ad9361.h:2856
AD9361_TEMP
#define AD9361_TEMP(_idx)
Definition: iio_ad9361.c:2197
AD9361_VOLTAGE_IN
#define AD9361_VOLTAGE_IN(_idx)
Definition: iio_ad9361.c:2167
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:912
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:858
rf_rssi::multiplier
int32_t multiplier
Definition: ad9361.h:3233
ad9361_rf_phy::agc_mode
uint8_t agc_mode[2]
Definition: ad9361.h:3392
iio_ch_info::ch_out
bool ch_out
Definition: iio_types.h:107
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:2233
LVDS_MODE
#define LVDS_MODE
Definition: ad9361.h:702
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:1552
ENSM_STATE_SLEEP_WAIT
#define ENSM_STATE_SLEEP_WAIT
Definition: ad9361.h:755
ad9361_parse_fir
int32_t ad9361_parse_fir(struct ad9361_rf_phy *phy, char *data, uint32_t size)
Definition: ad9361.c:5914
device
Definition: ad9361_util.h:69
ad9361_set_dcxo_tune
int32_t ad9361_set_dcxo_tune(struct ad9361_rf_phy *phy, uint32_t coarse, uint32_t fine)
Definition: ad9361.c:3523
TX_QUAD_CAL
#define TX_QUAD_CAL
Definition: ad9361.h:743
ad9361_fastlock::save_profile
uint8_t save_profile
Definition: ad9361.h:3302
ad9361_1rx1tx_channel_map
int32_t ad9361_1rx1tx_channel_map(struct ad9361_rf_phy *phy, bool tx, int32_t channel)
Definition: ad9361.c:1018
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
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:757
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:1107
iio_device::debug_reg_read
int32_t(* debug_reg_read)(void *dev, uint32_t reg, uint32_t *readval)
Definition: iio_types.h:283
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:1646
ENSM_STATE_FDD
#define ENSM_STATE_FDD
Definition: ad9361.h:761
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:2225
TX_RFPLL
@ TX_RFPLL
Definition: ad9361.h:3280
ad9361_rssi_gain_step_calib
int32_t ad9361_rssi_gain_step_calib(struct ad9361_rf_phy *phy)
Definition: ad9361.c:7423
ad9361_ensm_get_state
uint8_t ad9361_ensm_get_state(struct ad9361_rf_phy *phy)
Definition: ad9361.c:1976
ad9361_phy_platform_data::dcxo_coarse
uint32_t dcxo_coarse
Definition: ad9361.h:3184
iio_ad9361_init_param::ad9361_phy
struct ad9361_rf_phy * ad9361_phy
Definition: iio_ad9361.h:55
iio_ad9361.h
Header file of iio_ad9361.
ad9361_gt
uint32_t ad9361_gt(struct ad9361_rf_phy *phy)
Definition: ad9361.c:1376
voltage_output_attributes
struct iio_attribute voltage_output_attributes[]
Definition: iio_ad9361.c:1878
ad9361_reg_read
int32_t ad9361_reg_read(struct ad9361_rf_phy *phy, uint32_t reg, uint32_t *val)
Definition: ad9361.c:754
voltage_input_attributes
struct iio_attribute voltage_input_attributes[]
Definition: iio_ad9361.c:1932
ad9361_phy_platform_data::update_tx_gain_via_alert
bool update_tx_gain_via_alert
Definition: ad9361.h:3198
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:1669
temp0_attributes
struct iio_attribute temp0_attributes[]
Definition: iio_ad9361.c:2064
iio_attribute::name
const char * name
Definition: iio_types.h:131
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:1687
ad9361_set_ensm_mode
int32_t ad9361_set_ensm_mode(struct ad9361_rf_phy *phy, bool fdd, bool pinctrl)
Definition: ad9361.c:4908
iio_ad9361_desc::dev_descriptor
struct iio_device dev_descriptor
Definition: iio_ad9361.h:64
ad9361_rf_phy::bypass_rx_fir
bool bypass_rx_fir
Definition: ad9361.h:3380
ENSM_STATE_RX
#define ENSM_STATE_RX
Definition: ad9361.h:759
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:3468
iio_device::debug_attributes
struct iio_attribute * debug_attributes
Definition: iio_types.h:258
ad9361_rf_phy::rx_fir_dec
uint8_t rx_fir_dec
Definition: ad9361.h:3390
AD9361_OUT
#define AD9361_OUT()
Definition: iio_ad9361.c:2207
ENSM_STATE_ALERT
#define ENSM_STATE_ALERT
Definition: ad9361.h:756
no_os_clk_set_rate
int32_t no_os_clk_set_rate(struct no_os_clk_desc *desc, uint64_t rate)
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:2246
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:2378
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:61
iio_attribute
Structure holding pointers to show and store functions.
Definition: iio_types.h:129
ad9361_rf_phy::fastlock
struct ad9361_fastlock fastlock
Definition: ad9361.h:3401
ad9361_ensm_set_state
int32_t ad9361_ensm_set_state(struct ad9361_rf_phy *phy, uint8_t ensm_state, bool pinctrl)
Definition: ad9361.c:4434
LO_OFF
@ LO_OFF
Definition: ad9361.h:3324
ad9361_phy_platform_data::use_ext_rx_lo
bool use_ext_rx_lo
Definition: ad9361.h:3172
rf_rx_gain::gain_db
int32_t gain_db
Definition: ad9361.h:3218
LO_ON
@ LO_ON
Definition: ad9361.h:3325
AD9361_VOLTAGE_OUT
#define AD9361_VOLTAGE_OUT(_idx)
Definition: iio_ad9361.c:2177
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:1783
ad9361_phy_platform_data::rx2tx2
bool rx2tx2
Definition: ad9361.h:3162
ad9361_rf_phy
Definition: ad9361.h:3334
no_os_str_to_int32
int32_t no_os_str_to_int32(const char *str)
rf_gain_ctrl
Definition: ad9361.h:2896
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:1248
ad9361_phy_platform_data::fdd
bool fdd
Definition: ad9361.h:3163
ad9361_rf_phy::cached_synth_pd
uint8_t cached_synth_pd[2]
Definition: ad9361.h:3358
AD9363A_MIN_CARRIER_FREQ_HZ
#define AD9363A_MIN_CARRIER_FREQ_HZ
Definition: ad9361.h:2857
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:1729
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:1766
ad9361_rf_phy::current_rx_bw_Hz
uint32_t current_rx_bw_Hz
Definition: ad9361.h:3376
ad9361_rf_phy::quad_track_en
bool quad_track_en
Definition: ad9361.h:3395
ad9361_rf_phy::tx_fir_int
uint8_t tx_fir_int
Definition: ad9361.h:3388
iio_ad9361_init_param
Configuration structure.
Definition: iio_ad9361.h:53
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:1749
ad9361_rf_phy::ref_clk_scale
struct refclk_scale * ref_clk_scale[NUM_AD9361_CLKS]
Definition: ad9361.h:3347
ad9361_to_clk
uint32_t ad9361_to_clk(uint64_t freq)
Definition: ad9361.c:1392
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:1642
RX_RFPLL
@ RX_RFPLL
Definition: ad9361.h:3279
no_os_clamp_t
#define no_os_clamp_t(type, val, min_val, max_val)
Definition: no_os_util.h:71
rf_gain_ctrl::mode
uint8_t mode
Definition: ad9361.h:2898
iio_device::buffer_attributes
struct iio_attribute * buffer_attributes
Definition: iio_types.h:260
iio_types.h
Header file for iio_types.
iio_device::num_ch
uint16_t num_ch
Definition: iio_types.h:252
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
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:936
ad9361_rf_phy::rate_governor
uint32_t rate_governor
Definition: ad9361.h:3379
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:1084
ad9361_mcs
int32_t ad9361_mcs(struct ad9361_rf_phy *phy, int32_t step)
Definition: ad9361.c:5249
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:2246
AD9361_ALTVOLTAGE_OUT
#define AD9361_ALTVOLTAGE_OUT(_idx)
Definition: iio_ad9361.c:2187
ad9361_from_clk
uint64_t ad9361_from_clk(uint32_t freq)
Definition: ad9361.c:1403
NULL
#define NULL
Definition: wrapper.h:64
iio_ch_info::ch_num
int16_t ch_num
Definition: iio_types.h:105
iio_device
Structure holding channels and attributes of a device.
Definition: iio_types.h:247
ad9361_phy
struct ad9361_rf_phy * ad9361_phy
Definition: main.c:510
rf_gain_ctrl::ant
uint32_t ant
Definition: ad9361.h:2897
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:1268
ad9361_rf_phy::current_tx_bw_Hz
uint32_t current_tx_bw_Hz
Definition: ad9361.h:3377
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:833
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:1910
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:2106
out_attributes
struct iio_attribute out_attributes[]
Definition: iio_ad9361.c:2055
ad9361_validate_rf_bw
uint32_t ad9361_validate_rf_bw(struct ad9361_rf_phy *phy, uint32_t bw)
Definition: ad9361.c:940
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:5718
get_sampling_frequency
int get_sampling_frequency(struct axi_adc *dev, uint32_t chan, uint64_t *sampling_freq_hz)
Definition: headless.c:75
rf_rssi::symbol
uint32_t symbol
Definition: ad9361.h:3231
rf_rssi
Definition: ad9361.h:3229
ad9361_rf_phy::gt_info
struct gain_table_info * gt_info
Definition: ad9361.h:3361
no_os_util.h
Header file of utility functions.
iio_device::debug_reg_write
int32_t(* debug_reg_write)(void *dev, uint32_t reg, uint32_t writeval)
Definition: iio_types.h:285
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:4728
ad9361_rf_phy::pdata
struct ad9361_phy_platform_data * pdata
Definition: ad9361.h:3353
profile
CUSTOM_FILE profile
Definition: no_os_platform.c:29
RX_FAST_LOCK_CONFIG_WORD_NUM
#define RX_FAST_LOCK_CONFIG_WORD_NUM
Definition: ad9361.h:2413
ad9361_phy_platform_data::use_extclk
bool use_extclk
Definition: ad9361.h:3166
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:2090
ad9361_phy_platform_data::dcxo_fine
uint32_t dcxo_fine
Definition: ad9361.h:3185
ad9361_reg_write
int32_t ad9361_reg_write(struct ad9361_rf_phy *phy, uint32_t reg, uint32_t val)
Definition: ad9361.c:843
ad9361_phy_platform_data::use_ext_tx_lo
bool use_ext_tx_lo
Definition: ad9361.h:3173
RFDC_CAL
#define RFDC_CAL
Definition: ad9361.h:746
iio_ad9361_remove
int32_t iio_ad9361_remove(struct iio_ad9361_desc *desc)
Release resources.
Definition: iio_ad9361.c:2274
ad9361_fastlock_store
int32_t ad9361_fastlock_store(struct ad9361_rf_phy *phy, bool tx, uint32_t profile)
Definition: ad9361.c:5041
ad9361_get_tx_atten
int32_t ad9361_get_tx_atten(struct ad9361_rf_phy *phy, uint32_t tx_num)
Definition: ad9361.c:1681
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:3317
iio_device::attributes
struct iio_attribute * attributes
Definition: iio_types.h:256
ad9361_rf_phy::bypass_tx_fir
bool bypass_tx_fir
Definition: ad9361.h:3381
ad9361_rf_phy::tx_fir_ntaps
uint8_t tx_fir_ntaps
Definition: ad9361.h:3389
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:2233
MIN_ADC_CLK
#define MIN_ADC_CLK
Definition: ad9361.h:2828