Go to the documentation of this file.
44 #include "adi_ad9081.h"
50 #define MAX_NUM_MAIN_DATAPATHS 4
51 #define MAX_NUM_CHANNELIZER 8
212 #define AD9081_PERI_SEL_GPIO6 2
213 #define AD9081_PERI_SEL_GPIO7 3
214 #define AD9081_PERI_SEL_GPIO8 4
215 #define AD9081_PERI_SEL_GPIO9 5
216 #define AD9081_PERI_SEL_GPIO10 6
217 #define AD9081_PERI_SEL_SYNCINB1_P 7
218 #define AD9081_PERI_SEL_SYNCINB1_N 8
220 #define AD9081_FFH_CHAN_SEL_REG_MODE 0
221 #define AD9081_FFH_CHAN_SEL_1GPIO_MODE 1
222 #define AD9081_FFH_CHAN_SEL_2GPIO_MODE 2
223 #define AD9081_FFH_CHAN_SEL_3GPIO_MODE 3
224 #define AD9081_FFH_CHAN_SEL_4GPIO_MODE 4
225 #define AD9081_FFH_CHAN_SEL_GPIO0_EDGE_MODE 8
226 #define AD9081_FFH_CHAN_SEL_GPIO1_EDGE_MODE 9
227 #define AD9081_FFH_CHAN_SEL_GPIO2_EDGE_MODE 10
228 #define AD9081_FFH_CHAN_SEL_GPIO3_EDGE_MODE 11
229 #define AD9081_FFH_CHAN_SEL_FHT_EXP_MODE 12
234 #define DEFRAMER_LINK0_TX 0
235 #define DEFRAMER_LINK1_TX 1
236 #define FRAMER_LINK0_RX 2
237 #define FRAMER_LINK1_RX 3
uint32_t nyquist_zone[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:191
uint8_t rx_main_complex_to_real_enable[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:195
jesd204_dev_cb per_device
Definition: jesd204.h:191
@ SPI_SDO
Definition: api_def.h:182
@ JESD204_OP_OPT_SETUP_STAGE1
Definition: jesd204.h:205
@ SIGNAL_CMOS
Definition: api_def.h:194
JESD204 link configuration settings.
Definition: jesd204.h:105
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
int32_t ad9081_parse_init_param(struct ad9081_phy *phy, const struct ad9081_init_param *init_param)
Definition: ad9081.c:946
int64_t rx_main_nco_frequency_shift_hz[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:193
uint64_t dac_frequency_hz
Definition: ad9081.h:177
uint32_t link_mode
Definition: ad9081.h:144
struct no_os_gpio_init_param * gpio_reset
Definition: ad9081.h:156
uint8_t rx_channel_enable[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:204
uint32_t rx_channel_decimation[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:200
struct jesd204_state_op state_ops[__JESD204_MAX_OPS]
Definition: jesd204.h:232
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
struct link_init_param * jrx_link_tx[2]
Definition: ad9081.h:188
@ JESD204_STATE_OP_REASON_INIT
Definition: jesd204.h:148
uint8_t samples_per_conv_frame
Definition: jesd204.h:135
uint8_t device_id
Definition: jesd204.h:127
struct ad9081_jesd_link jtx_link_rx[2]
Definition: ad9081.h:84
#define DEFRAMER_LINK0_TX
Definition: ad9081.h:234
uint8_t ctrl_bits_per_sample
Definition: jesd204.h:134
Header file of SPI Interface.
@ JESD_SUBCLASS_0
Definition: api_def.h:251
uint8_t sysref_cmos_single_end_term_neg
Definition: ad9081.h:165
uint32_t subclass
Definition: ad9081.h:143
uint8_t tx_dac_chan_xbar[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:100
void jesd204_copy_link_params(struct jesd204_link *dst, const struct jesd204_link *src)
@ COUPLING_DC
Definition: api_def.h:202
unsigned long lane_rate_kbps
Definition: ad9081.h:61
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
void ad9081_work_func(struct ad9081_phy *phy)
uint8_t rx_ffh_gpio_mux_selection[6]
Definition: ad9081.h:206
uint16_t chan_gain[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:66
uint8_t link_converter_select[16]
Definition: ad9081.h:59
unsigned long lane_cal_rate_kbps
Definition: ad9081.h:62
@ JESD204_STATE_OP_MODE_PER_DEVICE
Definition: jesd204.h:176
uint64_t lane_rate
Definition: ad9081.h:60
Header file of Delay functions.
bool nco_sync_direct_sysref_mode_enable
Definition: ad9081.h:171
@ JESD204_ENCODER_8B10B
Definition: jesd204.h:30
uint8_t rx_main_enable[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:197
@ SYSREF_CONT
Definition: api_def.h:224
enum jesd204_sysref_mode mode
Definition: jesd204.h:61
jesd204_state_op_reason
Definition: jesd204.h:147
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
@ JESD204_VERSION_C
Definition: jesd204.h:24
Definition: no_os_clk.h:64
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
int32_t ad9081_parse_jesd_link_init_param(struct ad9081_jesd_link *link, const struct link_init_param *init_param, bool jtx)
Definition: ad9081.c:897
uint8_t rx_main_digital_gain_6db_enable[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:196
adi_cms_jesd_param_t jesd_param
Definition: ad9081.h:55
uint32_t adc_chan_decimation[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:122
Definition: ad9361_util.h:69
uint8_t converter_resolution
Definition: jesd204.h:122
uint32_t device_id
Definition: ad9081.h:133
uint32_t sample_rate_div
Definition: jesd204.h:110
uint8_t rx_cddc_c2r[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:118
uint8_t subclass
Definition: jesd204.h:125
@ SIGNAL_LVDS
Definition: api_def.h:195
uint16_t tx_channel_gain[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:187
uint8_t logiclane_mapping[8]
Definition: ad9081.h:58
uint32_t nco_sync_ms_extra_lmfc_num
Definition: ad9081.h:170
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
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
struct jesd204_sysref sysref
Definition: jesd204.h:139
@ JESD204_STATE_OP_REASON_UNINIT
Definition: jesd204.h:149
uint8_t scrambling
Definition: jesd204.h:130
uint32_t rx_main_decimation[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:194
int64_t rx_channel_nco_frequency_shift_hz[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:199
const struct no_os_clk_desc * clk_desc
Definition: no_os_clk.h:68
uint32_t lanes_per_device
Definition: ad9081.h:142
bool is_initialized
Definition: ad9081.h:93
uint8_t link_converter_select[16]
Definition: ad9081.h:149
bool tx_disable
Definition: ad9081.h:174
void * jesd204_dev_priv(struct jesd204_dev *jdev)
uint8_t high_density
Definition: jesd204.h:131
bool sysref_coupling_ac_en
Definition: ad9081.h:78
Header file of Clock Driver.
uint32_t tx_main_interpolation
Definition: ad9081.h:179
uint64_t no_os_do_div(uint64_t *n, uint64_t base)
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
bool rx_disable
Definition: ad9081.h:95
@ JESD204_OP_OPT_SETUP_STAGE3
Definition: jesd204.h:207
uint32_t adc_main_decimation[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:115
uint8_t rx_fddc_dcm[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:123
@ JESD204_OP_CLOCKS_ENABLE
Definition: jesd204.h:210
#define for_each_fddc(bit, mask)
Definition: ad9081.c:70
#define pr_debug(fmt, args...)
Definition: no_os_print_log.h:129
uint8_t sysref_cmos_single_end_term_pos
Definition: ad9081.h:80
int32_t ad9081_remove(struct ad9081_phy *dev)
Definition: ad9081.c:1583
struct link_init_param * jtx_link_rx[2]
Definition: ad9081.h:207
struct jesd204_link jesd204_link
Definition: ad9081.h:56
int64_t tx_main_shift[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:102
@ JESD204_OP_LINK_INIT
Definition: jesd204.h:198
uint8_t rx_fddc_mxr_if[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:117
@ JESD204_SYSREF_ONESHOT
Definition: jesd204.h:40
bool jesd204_dev_is_top(struct jesd204_dev *jdev)
uint32_t tpl_phase_adjust
Definition: ad9081.h:151
struct no_os_spi_init_param * spi_init
Definition: ad9081.h:155
int32_t ad9081_log_write(void *user_data, int32_t log_type, const char *message, va_list argp)
Definition: ad9081.c:867
uint32_t sysref_average_cnt_exp
Definition: ad9081.h:91
uint8_t rx_channel_digital_gain_6db_enable[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:203
uint8_t rx_channel_nco_mixer_mode[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:202
int64_t rx_cddc_shift[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:114
uint32_t nco_sync_ms_extra_lmfc_num
Definition: ad9081.h:89
uint8_t bits_per_sample
Definition: jesd204.h:120
int ad9081_jesd_tx_link_status_print(struct ad9081_phy *phy, struct jesd204_link *lnk, int retry)
Definition: ad9081.c:443
uint8_t jesd_version
Definition: jesd204.h:123
struct no_os_clk * dev_clk
Definition: ad9081.h:158
@ JESD204_OP_DEVICE_INIT
Definition: jesd204.h:197
#define AD9081_PERI_SEL_SYNCINB1_N
Definition: ad9081.c:59
uint8_t rx_cddc_gain_6db_en[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:125
uint8_t rx_cddc_dcm[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:116
struct no_os_clk * jesd_rx_clk
Definition: ad9081.h:159
uint32_t rx_nyquist_zone[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:112
uint8_t sysref_cmos_single_end_term_neg
Definition: ad9081.h:81
bool is_transmit
Definition: jesd204.h:112
uint32_t bits_per_sample
Definition: ad9081.h:139
#define CHIPID_MASK
Definition: ad9081.c:63
struct dac_settings_cache dac_cache
Definition: ad9081.h:108
bool is_jrx
Definition: ad9081.h:54
uint32_t converters_per_device
Definition: ad9081.h:140
uint8_t rx_fddc_c2r[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:124
uint32_t tx_channel_interpolation
Definition: ad9081.h:185
#define CHIPID_AD9081
Definition: ad9081.c:61
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
uint32_t tx_chan_interp
Definition: ad9081.h:104
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
@ JESD204_OP_LINK_ENABLE
Definition: jesd204.h:211
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
struct no_os_gpio_desc * ms_sync_en_gpio
Definition: ad9081.h:72
uint8_t octets_per_frame
Definition: jesd204.h:116
uint64_t adc_frequency_hz
Definition: ad9081.h:111
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
@ JESD204_ENCODER_64B66B
Definition: jesd204.h:31
uint16_t frames_per_multiframe
Definition: jesd204.h:117
uint8_t tx_dac_chan_xbar_1x_non1x[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:101
struct no_os_clk * jesd_tx_clk
Definition: ad9081.h:74
uint8_t rx_channel_complex_to_real_enable[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:201
struct no_os_spi_desc * spi_desc
Definition: ad9081.h:70
uint32_t multidevice_instance_count
Definition: ad9081.h:166
struct no_os_clk * dev_clk
Definition: ad9081.h:75
@ JESD204_STATE_CHANGE_ERROR
Definition: jesd204.h:44
uint8_t sysref_cmos_single_end_term_pos
Definition: ad9081.h:164
int64_t tx_channel_nco_frequency_shift_hz[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:186
#define AD9081_PERI_SEL_SYNCINB1_P
Definition: ad9081.c:58
uint32_t link_id
Definition: jesd204.h:106
uint8_t master_slave_sync_gpio_num
Definition: ad9081.h:161
bool sysref_cmos_input_en
Definition: ad9081.h:79
int64_t tx_main_nco_frequency_shift_hz[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:180
bool config_sync_01_swapped
Definition: ad9081.h:86
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
uint8_t tx_dac_channel_crossbar_select[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:181
#define for_each_cddc(bit, mask)
Definition: ad9081.c:65
int32_t ad9081_init(struct ad9081_phy **device, const struct ad9081_init_param *init_param)
Definition: ad9081.c:1419
uint8_t logical_lane_mapping[8]
Definition: ad9081.h:147
uint32_t control_bits_per_sample
Definition: ad9081.h:141
uint32_t tx_main_interp
Definition: ad9081.h:99
uint8_t num_lanes
Definition: jesd204.h:114
struct no_os_gpio_desc * gpio_reset
Definition: ad9081.h:71
bool sysref_cmos_input_enable
Definition: ad9081.h:163
uint64_t sample_rate
Definition: jesd204.h:109
#define FRAMER_LINK1_RX
Definition: ad9081.h:237
uint8_t rx_fddc_select
Definition: ad9081.h:127
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
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
int64_t rx_fddc_shift[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:121
@ NO_OS_SPI_BIT_ORDER_MSB_FIRST
Definition: no_os_spi.h:76
uint8_t tx_maindp_dac_1x_non1x_crossbar_select[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:182
uint32_t version
Definition: ad9081.h:146
#define FRAMER_LINK0_RX
Definition: ad9081.h:236
int jesd204_dev_register(struct jesd204_dev **jdev, const struct jesd204_dev_data *dev_data)
int64_t tx_chan_shift[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:105
struct no_os_clk * jesd_rx_clk
Definition: ad9081.h:73
int32_t ad9081_init(struct ad9081_phy **dev, const struct ad9081_init_param *init_param)
Definition: ad9081.c:1419
uint8_t rx_cddc_nco_channel_select_mode[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:205
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
uint32_t multidevice_instance_count
Definition: ad9081.h:85
@ COUPLING_AC
Definition: api_def.h:201
int adi_ad9081_device_gpio_set_highz(adi_ad9081_device_t *device, uint8_t gpio_index)
Definition: ad9081.c:193
struct no_os_gpio_init_param * ms_sync_enable
Definition: ad9081.h:157
#define MAX_NUM_MAIN_DATAPATHS
Definition: ad9081.h:50
uint32_t high_density
Definition: ad9081.h:137
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
@ JESD204_OP_OPT_SETUP_STAGE2
Definition: jesd204.h:206
uint8_t rx_cddc_select
Definition: ad9081.h:119
struct ad9081_jesd_link jrx_link_tx[2]
Definition: ad9081.h:83
uint8_t jesd_encoder
Definition: jesd204.h:124
adi_ad9081_device_t ad9081
Definition: ad9081.h:82
int jesd204_link_get_rate_khz(struct jesd204_link *lnk, unsigned long *lane_rate_khz)
uint32_t tx_full_scale_current_ua[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:183
@ JESD204_STATE_CHANGE_DONE
Definition: jesd204.h:46
bool sysref_coupling_ac_en
Definition: ad9081.h:162
int32_t ad9081_remove(struct ad9081_phy *device)
Definition: ad9081.c:1583
bool tx_disable
Definition: ad9081.h:94
@ JESD204_SYSREF_CONTINUOUS
Definition: jesd204.h:39
uint8_t rx_cddc_nco_channel_select_mode[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:128
uint8_t sync_ms_gpio_num
Definition: ad9081.h:77
struct no_os_clk * jesd_tx_clk
Definition: ad9081.h:160
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
@ JESD_SUBCLASS_1
Definition: api_def.h:252
uint8_t rx_fddc_gain_6db_en[MAX_NUM_CHANNELIZER]
Definition: ad9081.h:126
uint32_t adc_dcm[2]
Definition: ad9081.h:110
Header file of GPIO Interface.
uint32_t lmfc_delay_dac_clk_cycles
Definition: ad9081.h:169
uint32_t frames_per_multiframe
Definition: ad9081.h:135
struct ad9081_phy * phy
Definition: ad9081.c:75
#define MAX_NUM_CHANNELIZER
Definition: ad9081.h:51
Header file of AD9081 Driver.
int ad9081_jesd204_uninit(struct jesd204_dev *jdev, enum jesd204_state_op_reason reason)
Definition: ad9081.c:1174
uint32_t converter_resolution
Definition: ad9081.h:138
uint32_t sysref_average_cnt_exp
Definition: ad9081.h:172
bool config_sync_0a_cmos_en
Definition: ad9081.h:87
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
uint32_t jrx_tpl_phase_adjust
Definition: ad9081.h:57
int32_t ad9081_reset_pin_ctrl(void *user_data, uint8_t enable)
Definition: ad9081.c:824
uint8_t rx_ffh_gpio_mux_sel[6]
Definition: ad9081.h:129
uint32_t tx_dac_fsc[MAX_NUM_MAIN_DATAPATHS]
Definition: ad9081.h:106
Header file of utility functions.
bool jesd_sync_pins_01_swap_enable
Definition: ad9081.h:167
#define CHIPID_AD9082
Definition: ad9081.c:62
@ JESD204_OP_LINK_RUNNING
Definition: jesd204.h:212
bool config_sync_0a_cmos_enable
Definition: ad9081.h:168
bool continuous_sysref_mode_disable
Definition: ad9081.h:173
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
uint32_t dual_link
Definition: ad9081.h:145
uint64_t dac_frequency_hz
Definition: ad9081.h:97
int32_t no_os_clk_recalc_rate(struct no_os_clk_desc *desc, uint64_t *rate)
bool rx_disable
Definition: ad9081.h:175
JESD204 device initialization data.
Definition: jesd204.h:227
bool tx_ffh_hopf_via_gpio_en
Definition: ad9081.h:107
uint32_t samples_per_converter_per_frame
Definition: ad9081.h:136
@ SYSREF_ONESHOT
Definition: api_def.h:223
uint32_t lmfc_delay
Definition: ad9081.h:88
uint8_t num_converters
Definition: jesd204.h:115
uint64_t adc_frequency_hz
Definition: ad9081.h:190
bool sysref_continuous_dis
Definition: ad9081.h:92
bool nco_sync_direct_sysref_mode_en
Definition: ad9081.h:90
#define DEFRAMER_LINK1_TX
Definition: ad9081.h:235
uint32_t octets_per_frame
Definition: ad9081.h:134
struct jesd204_dev * jdev
Definition: ad9081.h:76
chip_id
Definition: ad9172.h:51
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75