![]() |
no-OS
|
Header file of AD9250 Driver. More...
Classes | |
| struct | ad9250_platform_data |
| Platform specific information. More... | |
| struct | ad9250_jesd204b_cfg |
| JESD204B interface configuration. More... | |
| struct | ad9250_fast_detect_cfg |
| Fast Detect module configuration. More... | |
| struct | ad9250_state |
| struct | ad9250_dev |
| struct | ad9250_init_param |
Functions | |
| int32_t | ad9250_setup (struct ad9250_dev **device, struct ad9250_init_param init_param) |
| Configures the device. | |
| int32_t | ad9250_remove (struct ad9250_dev *dev) |
| Free the resources allocated by ad9250_setup(). | |
| int32_t | ad9250_read (struct ad9250_dev *dev, int32_t register_address) |
| Reads the value of the selected register. | |
| int32_t | ad9250_write (struct ad9250_dev *dev, int32_t register_address, int32_t register_value) |
| Writes a value to the selected register. | |
| int32_t | ad9250_transfer (struct ad9250_dev *dev) |
| Initiates a transfer and waits for the operation to end. Note: This function may be called after a shadowed register was written, so that the internal update can actually take place. | |
| int32_t | ad9250_soft_reset (struct ad9250_dev *dev) |
| Resets all registers to their default values. | |
| int32_t | ad9250_chip_pwr_mode (struct ad9250_dev *dev, int32_t mode) |
| Configures the power mode of the chip. | |
| int32_t | ad9250_select_channel_for_config (struct ad9250_dev *dev, int32_t channel) |
| Selects a channel as the current channel for further configurations. | |
| int32_t | ad9250_test_mode (struct ad9250_dev *dev, int32_t mode) |
| Sets the ADC's test mode. | |
| int32_t | ad9250_offset_adj (struct ad9250_dev *dev, int32_t adj) |
| Sets the offset adjustment. | |
| int32_t | ad9250_output_disable (struct ad9250_dev *dev, int32_t en) |
| Disables (1) or enables (0) the data output. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place. | |
| int32_t | ad9250_output_invert (struct ad9250_dev *dev, int32_t invert) |
| Activates the inverted (1) or normal (0) output mode. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place. | |
| int32_t | ad9250_output_format (struct ad9250_dev *dev, int32_t format) |
| Specifies the output format. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place. | |
| int32_t | ad9250_reset_PN29 (struct ad9250_dev *dev, int32_t rst) |
| int32_t | ad9250_reset_pn23 (struct ad9250_dev *dev, int32_t rst) |
| Sets (1) or clears (0) the reset long PN sequence bit(PN23). | |
| int32_t | ad9250_set_user_pattern (struct ad9250_dev *dev, int32_t pattern_no, int32_t user_pattern) |
| Configures a User Test Pattern. | |
| int32_t | ad9250_bist_enable (struct ad9250_dev *dev, int32_t enable) |
| Enables the Build-In-Self-Test. | |
| int32_t | ad9250_bist_reset (struct ad9250_dev *dev, int32_t reset) |
| Resets the Build-In-Self-Test. | |
| int32_t | ad9250_jesd204b_setup (struct ad9250_dev *dev) |
| Configures the JESD204B interface. | |
| int32_t | ad9250_jesd204b_pwr_mode (struct ad9250_dev *dev, int32_t mode) |
| Configures the power mode of the JESD204B data transmit block. | |
| int32_t | ad9250_jesd204b_select_test_injection_point (struct ad9250_dev *dev, int32_t inj_point) |
| Selects the point in the processing path of a lane, where the test data will be inserted. | |
| int32_t | ad9250_jesd204b_test_mode (struct ad9250_dev *dev, int32_t test_mode) |
| Selects a JESD204B test mode. | |
| int32_t | ad9250_jesd204b_invert_logic (struct ad9250_dev *dev, int32_t invert) |
| Inverts the logic of JESD204B bits. | |
| int32_t | ad9250_fast_detect_setup (struct ad9250_dev *dev) |
| Configures the Fast-Detect module. | |
| int32_t | ad9250_dcc_enable (struct ad9250_dev *dev, int32_t enable) |
| Enables DC correction for use in the output data signal path. | |
| int32_t | ad9250_dcc_bandwidth (struct ad9250_dev *dev, int32_t bw) |
| Selects the bandwidth value for the DC correction circuit. | |
| int32_t | ad9250_dcc_freeze (struct ad9250_dev *dev, int32_t freeze) |
| Freezes DC correction value. | |
Header file of AD9250 Driver.
Copyright 2013(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| #define AD9250_204B_CTRL1_ILAS_MODE | ( | x | ) |
| #define AD9250_204B_CTRL1_POWER_DOWN (1 << 0) |
| #define AD9250_204B_CTRL1_TAIL_BITS (1 << 6) |
| #define AD9250_204B_CTRL1_TEST_SAMPLE_EN (1 << 5) |
| #define AD9250_204B_CTRL2_INVERT_JESD_BITS (1 << 1) |
| #define AD9250_204B_CTRL3_JESD_TEST_MODE | ( | x | ) |
| #define AD9250_204B_CTRL3_TEST_DATA_INJ_PT | ( | x | ) |
| #define AD9250_204B_LANE_ASSGN1 | ( | x | ) |
| #define AD9250_204B_LANE_ASSGN2 | ( | x | ) |
| #define AD9250_204B_LMFC_OFFSET | ( | x | ) |
| #define AD9250_204B_PARAM_CS_N_ADC_RESOLUTION | ( | x | ) |
| #define AD9250_204B_PARAM_CS_N_NR_CTRL_BITS | ( | x | ) |
| #define AD9250_204B_PARAM_HD_CF_CF_VAL | ( | x | ) |
| #define AD9250_204B_PARAM_HD_CF_HD_VAL (1 << 7) |
| #define AD9250_204B_PARAM_NP_JESD_N_VAL | ( | x | ) |
| #define AD9250_204B_PARAM_NP_JESD_SUBCLASS | ( | x | ) |
| #define AD9250_204B_PARAM_S | ( | x | ) |
| #define AD9250_204B_PARAM_SCR_L_LANES (1 << 0) |
| #define AD9250_204B_PARAM_SCR_L_SCRAMBLING (1 << 7) |
| #define AD9250_204B_QUICK_CFG | ( | x | ) |
| #define AD9250_ADDR | ( | x | ) |
| #define AD9250_BIST_ENABLE (1 << 0) |
| #define AD9250_BIST_RESET (1 << 2) |
| #define AD9250_CH_INDEX_ADC_A (1 << 0) |
| #define AD9250_CH_INDEX_ADC_B (1 << 1) |
| #define AD9250_CLOCK_DIV_PHASE | ( | x | ) |
| #define AD9250_CLOCK_DIV_RATIO | ( | x | ) |
| #define AD9250_CLOCK_DUTY_CYCLE (1 << 0) |
| #define AD9250_CLOCK_SELECTION | ( | x | ) |
| #define AD9250_CML_DIFF_OUT_LEVEL | ( | x | ) |
| #define AD9250_CNT | ( | x | ) |
| #define AD9250_DCC_CTRL_DCC_BW | ( | x | ) |
| #define AD9250_DCC_CTRL_DCC_EN (1 << 1) |
| #define AD9250_DCC_CTRL_FREEZE_DCC (1 << 6) |
| #define AD9250_DEVICE_UPDATE_SW (1 << 0) |
| #define AD9250_FAST_DETECT_FORCE_FDA_FDB_PIN (1 << 3) |
| #define AD9250_FAST_DETECT_FORCE_FDA_FDB_VAL (1 << 2) |
| #define AD9250_FAST_DETECT_OUTPUT_ENABLE (1 << 0) |
| #define AD9250_FAST_DETECT_PIN_FCT (1 << 4) |
| #define AD9250_OUT_2S_COMPLEMENT 0x01 |
| #define AD9250_OUT_MODE_DATA_FORMAT | ( | x | ) |
| #define AD9250_OUT_MODE_DISABLE (1 << 4) |
| #define AD9250_OUT_MODE_INVERT_DATA (1 << 3) |
| #define AD9250_OUT_MODE_JTX_BIT_ASSIGN | ( | x | ) |
| #define AD9250_OUT_OFFSET_BINARY 0x00 |
| #define AD9250_PDWN_CHIP | ( | x | ) |
| #define AD9250_PDWN_EXTERN (1 << 5) |
| #define AD9250_PDWN_JESD204B | ( | x | ) |
| #define AD9250_PDWN_JTX (1 << 4) |
| #define AD9250_PLL_ENCODE | ( | x | ) |
| #define AD9250_PLL_STAT_204B_LINK_RDY (1 << 0) |
| #define AD9250_PLL_STAT_LOCKED (1 << 7) |
| #define AD9250_R1B (1 << 8) |
| #define AD9250_R2B (2 << 8) |
| #define AD9250_R3B (3 << 8) |
| #define AD9250_READ (1 << 15) |
| #define AD9250_REG_204B_BID_CFG (AD9250_R1B | 0x65) |
| #define AD9250_REG_204B_CHKSUM0 (AD9250_R1B | 0x79) |
| #define AD9250_REG_204B_CHKSUM1 (AD9250_R1B | 0x7A) |
| #define AD9250_REG_204B_CTRL1 (AD9250_R1B | 0x5F) |
| #define AD9250_REG_204B_CTRL2 (AD9250_R1B | 0x60) |
| #define AD9250_REG_204B_CTRL3 (AD9250_R1B | 0x61) |
| #define AD9250_REG_204B_DID_CFG (AD9250_R1B | 0x64) |
| #define AD9250_REG_204B_LANE_ASSGN1 (AD9250_R1B | 0x82) |
| #define AD9250_REG_204B_LANE_ASSGN2 (AD9250_R1B | 0x83) |
| #define AD9250_REG_204B_LID_CFG0 (AD9250_R1B | 0x66) |
| #define AD9250_REG_204B_LID_CFG1 (AD9250_R1B | 0x67) |
| #define AD9250_REG_204B_LMFC_OFFSET (AD9250_R1B | 0x8B) |
| #define AD9250_REG_204B_PARAM_CS_N (AD9250_R1B | 0x72) |
| #define AD9250_REG_204B_PARAM_F (AD9250_R1B | 0x6F) |
| #define AD9250_REG_204B_PARAM_HD_CF (AD9250_R1B | 0x75) |
| #define AD9250_REG_204B_PARAM_K (AD9250_R1B | 0x70) |
| #define AD9250_REG_204B_PARAM_M (AD9250_R1B | 0x71) |
| #define AD9250_REG_204B_PARAM_NP (AD9250_R1B | 0x73) |
| #define AD9250_REG_204B_PARAM_S (AD9250_R1B | 0x74) |
| #define AD9250_REG_204B_PARAM_SCR_L (AD9250_R1B | 0x6E) |
| #define AD9250_REG_204B_PRE_EMPHASIS (AD9250_R1B | 0xA8) |
| #define AD9250_REG_204B_QUICK_CFG (AD9250_R1B | 0x5E) |
| #define AD9250_REG_204B_RESV1 (AD9250_R1B | 0x76) |
| #define AD9250_REG_204B_RESV2 (AD9250_R1B | 0x77) |
| #define AD9250_REG_BIST (AD9250_R1B | 0x0E | SHADOW(4)) |
| #define AD9250_REG_BIST_MISR (AD9250_R2B | 0x25) |
| #define AD9250_REG_CH_INDEX (AD9250_R1B | 0x05) |
| #define AD9250_REG_CHIP_ID (AD9250_R1B | 0x01) |
| #define AD9250_REG_CHIP_INFO (AD9250_R1B | 0x02) |
| #define AD9250_REG_CLOCK (AD9250_R1B | 0x09 | SHADOW(1)) |
| #define AD9250_REG_CLOCK_DIV (AD9250_R1B | 0x0B | SHADOW(2)) |
| #define AD9250_REG_CML (AD9250_R1B | 0x15) |
| #define AD9250_REG_DCC_CTRL (AD9250_R1B | 0x40 | SHADOW(9)) |
| #define AD9250_REG_DCC_VAL (AD9250_R2B | 0x42 | SHADOW(10)) |
| #define AD9250_REG_DEVICE_UPDATE (AD9250_R1B | 0xFF) |
| #define AD9250_REG_FAST_DETECT (AD9250_R1B | 0x45 | SHADOW(11)) |
| #define AD9250_REG_FD_DWELL_TIME (AD9250_R2B | 0x4C | SHADOW(14)) |
| #define AD9250_REG_FD_LOWER_THD (AD9250_R2B | 0x4A | SHADOW(13)) |
| #define AD9250_REG_FD_UPPER_THD (AD9250_R2B | 0x48 | SHADOW(12)) |
| #define AD9250_REG_OFFSET (AD9250_R1B | 0x10 | SHADOW(5)) |
| #define AD9250_REG_OFFSET_ADJUST | ( | x | ) |
| #define AD9250_REG_OUT_MODE (AD9250_R1B | 0x14 | SHADOW(6)) |
| #define AD9250_REG_PDWN (AD9250_R1B | 0x08) |
| #define AD9250_REG_PLL_ENCODE (AD9250_R1B | 0x21) |
| #define AD9250_REG_PLL_STAT (AD9250_R1B | 0x0A) |
| #define AD9250_REG_SPI_CFG (AD9250_R1B | 0x00) |
| #define AD9250_REG_SYS_CTRL (AD9250_R1B | 0x3A | SHADOW(8)) |
| #define AD9250_REG_TEST (AD9250_R1B | 0x0D | SHADOW(3)) |
| #define AD9250_REG_USER_TEST1 (AD9250_R2B | 0x1A) |
| #define AD9250_REG_USER_TEST2 (AD9250_R2B | 0x1C) |
| #define AD9250_REG_USER_TEST3 (AD9250_R2B | 0x1E) |
| #define AD9250_REG_USER_TEST4 (AD9250_R2B | 0x20) |
| #define AD9250_REG_VREF (AD9250_R1B | 0x18 | SHADOW(7)) |
| #define AD9250_SPI_CFG_LSB_FIRST ((1 << 6) | (1 << 1)) |
| #define AD9250_SPI_CFG_SOFT_RST ((1 << 5) | (1 << 2)) |
| #define AD9250_SYS_CTRL_REALIGN_ON_SYNCINB (1 << 4) |
| #define AD9250_SYS_CTRL_REALIGN_ON_SYSREF (1 << 3) |
| #define AD9250_SYS_CTRL_SYNCINB_EN (1 << 0) |
| #define AD9250_SYS_CTRL_SYSREF_EN (1 << 1) |
| #define AD9250_SYS_CTRL_SYSREF_MODE (1 << 2) |
| #define AD9250_TEST_CHECKBOARD 0x04 |
| #define AD9250_TEST_MID_SCALE 0x01 |
| #define AD9250_TEST_NEG_FSCALE 0x03 |
| #define AD9250_TEST_OFF 0x00 |
| #define AD9250_TEST_ONE2ZERO 0x07 |
| #define AD9250_TEST_OUTPUT_TEST | ( | x | ) |
| #define AD9250_TEST_PATTERN 0x08 |
| #define AD9250_TEST_PNLONG 0x05 |
| #define AD9250_TEST_POS_FSCALE 0x02 |
| #define AD9250_TEST_RAMP 0x0F |
| #define AD9250_TEST_RST_PN_LONG (1 << 5) |
| #define AD9250_TEST_RST_PN_SHOR (1 << 4) |
| #define AD9250_TEST_USER_TEST_MODE | ( | x | ) |
| #define AD9250_TRANSF_LEN | ( | x | ) |
| #define AD9250_VREF_FS_ADJUST | ( | x | ) |
| #define AD9250_WRITE (0 << 15) |
| #define SHADOW | ( | x | ) |
| enum shadow_registers |
| int32_t ad9250_bist_enable | ( | struct ad9250_dev * | dev, |
| int32_t | enable ) |
Enables the Build-In-Self-Test.
Enables the Build-In-Self-Test.
| dev | - The device structure. |
| enable | - enable option. |
| int32_t ad9250_bist_reset | ( | struct ad9250_dev * | dev, |
| int32_t | reset ) |
Resets the Build-In-Self-Test.
Resets the Build-In-Self-Test.
| dev | - The device structure. |
| reset | - reset option. |
| int32_t ad9250_chip_pwr_mode | ( | struct ad9250_dev * | dev, |
| int32_t | mode ) |
Configures the power mode of the chip.
Configures the power mode of the chip.
| dev | - The device structure. |
| mode | - The power mode. Example: 00 � normal operation(default); 01 � power-down; 10 - standby. |
| int32_t ad9250_dcc_bandwidth | ( | struct ad9250_dev * | dev, |
| int32_t | bw ) |
Selects the bandwidth value for the DC correction circuit.
Selects the bandwidth value for the DC correction circuit.
| dev | - The device structure. |
| bw | - DC correction bandwidth. Example: 0 - 2387.32 Hz at Sample Rate of 245.76 MSPS 1 - 1193.66 Hz at Sample Rate of 245.76 MSPS ... 13 - 0.29 Hz at Sample Rate of 245.76 MSPS |
| int32_t ad9250_dcc_enable | ( | struct ad9250_dev * | dev, |
| int32_t | enable ) |
Enables DC correction for use in the output data signal path.
Enables DC correction for use in the output data signal path.
| dev | - The device structure. |
| enable | - enable option. Example: 0 - correction off 1 - correction on |
| int32_t ad9250_dcc_freeze | ( | struct ad9250_dev * | dev, |
| int32_t | freeze ) |
Freezes DC correction value.
Freezes DC correction value.
| dev | - The device structure. |
| freeze | - freeze option. Example: 0 - calculates the correction value 1 - freezes the DC correction at its current state |
| int32_t ad9250_fast_detect_setup | ( | struct ad9250_dev * | dev | ) |
Configures the Fast-Detect module.
Configures the Fast-Detect module.
| dev | - The device structure. |
| int32_t ad9250_jesd204b_invert_logic | ( | struct ad9250_dev * | dev, |
| int32_t | invert ) |
Inverts the logic of JESD204B bits.
Inverts the logic of JESD204B bits.
| dev | - The device structure. |
| invert | - Invert option. Example: 1 - Activates the inverted mode 0 - Activates the normal mode |
| int32_t ad9250_jesd204b_pwr_mode | ( | struct ad9250_dev * | dev, |
| int32_t | mode ) |
Configures the power mode of the JESD204B data transmit block.
Configures the power mode of the JESD204B data transmit block.
| dev | - The device structure. |
| mode | - The power mode. Example: 00 � normal operation(default); 01 � power-down; 10 - standby. |
| int32_t ad9250_jesd204b_select_test_injection_point | ( | struct ad9250_dev * | dev, |
| int32_t | inj_point ) |
Selects the point in the processing path of a lane, where the test data will be inserted.
Selects the point in the processing path of a lane, where the test data will be inserted.
| dev | - The device structure. |
| inj_point | - The point in the processing path of a lane. Example: 1 - a 10-bit data is inserted at 8B/10B ENCODER output 2 - a 8-bit at scrambler input |
| int32_t ad9250_jesd204b_setup | ( | struct ad9250_dev * | dev | ) |
Configures the JESD204B interface.
Configures the JESD204B interface.
| dev | - The device structure. |
| int32_t ad9250_jesd204b_test_mode | ( | struct ad9250_dev * | dev, |
| int32_t | test_mode ) |
Selects a JESD204B test mode.
Selects a JESD204B test mode.
| dev | - The device structure. |
| test_mode | - mode option. Example: 0 - test mode disabled 1 - alternating checker board 2 - 1/0 word toggle 3 - PN23 sequence 4 - PN9 sequence 5 - continuous/repeat user test mode 6 - single user test mode 7 - reserved 8 - modified RPAT test sequence 12 - PN7 sequence 13 - PN15 sequence |
| int32_t ad9250_offset_adj | ( | struct ad9250_dev * | dev, |
| int32_t | adj ) |
Sets the offset adjustment.
Sets the offset adjustment.
| dev | - The device structure. |
| adj | - The offset adjust value in LSBs from +31 to -32. |
| int32_t ad9250_output_disable | ( | struct ad9250_dev * | dev, |
| int32_t | en ) |
Disables (1) or enables (0) the data output. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place.
Disables (1) or enables (0) the data output.
| dev | - The device structure. |
| en | - Enable option. Example: 1 - Disables the data output; 0 - Enables the data output(default). |
| int32_t ad9250_output_format | ( | struct ad9250_dev * | dev, |
| int32_t | format ) |
Specifies the output format. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place.
Specifies the output format.
| dev | - The device structure. |
| format | - The output format. Example: 0 � offset binary(default); 1 � two's complement; |
| int32_t ad9250_output_invert | ( | struct ad9250_dev * | dev, |
| int32_t | invert ) |
Activates the inverted (1) or normal (0) output mode. Note: This function modifies a shadowed register, therefore a call of ad9250_transfer() is required for the internal update to take place.
Activates the inverted (1) or normal (0) output mode.
| dev | - The device structure. |
| invert | - Invert option. Example: 1 - Activates the inverted output mode; 0 - Activates the normal output mode(default). |
| int32_t ad9250_read | ( | struct ad9250_dev * | dev, |
| int32_t | register_address ) |
Reads the value of the selected register.
Reads the value of the selected register.
| dev | - The device structure. |
| register_address | - The address of the register to read. |
| int32_t ad9250_remove | ( | struct ad9250_dev * | dev | ) |
Free the resources allocated by ad9250_setup().
Free the resources allocated by ad9250_setup().
| dev | - The device structure. |
| int32_t ad9250_reset_pn23 | ( | struct ad9250_dev * | dev, |
| int32_t | rst ) |
Sets (1) or clears (0) the reset long PN sequence bit(PN23).
Sets (1) or clears (0) the reset long PN sequence bit(PN23).
| dev | - The device structure. |
| rst | - Enable option. Example: 1 - The PN sequence is held in reset; 0 - The PN sequence resumes from the seed value(0x3AFF). |
| int32_t ad9250_reset_PN29 | ( | struct ad9250_dev * | dev, |
| int32_t | rst ) |
Sets (1) or clears (0) the reset short PN sequence bit(PN9).
| int32_t ad9250_select_channel_for_config | ( | struct ad9250_dev * | dev, |
| int32_t | channel ) |
Selects a channel as the current channel for further configurations.
Selects a channel as the current channel for further configurations.
| dev | - The device structure. |
| channel | - Channel option. Example 1 - channel A 2 - channel B 3 - channel A and channel B |
| int32_t ad9250_set_user_pattern | ( | struct ad9250_dev * | dev, |
| int32_t | pattern_no, | ||
| int32_t | user_pattern ) |
Configures a User Test Pattern.
Configures a User Test Pattern.
| dev | - The device structure. |
| pattern_no | - Selects the patterns to be configured. Range 1..4. |
| user_pattern | - Users's pattern. |
| int32_t ad9250_setup | ( | struct ad9250_dev ** | device, |
| struct ad9250_init_param | init_param ) |
Configures the device.
Configures the device.
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
| int32_t ad9250_soft_reset | ( | struct ad9250_dev * | dev | ) |
Resets all registers to their default values.
Resets all registers to their default values.
| dev | - The device structure. |
| int32_t ad9250_test_mode | ( | struct ad9250_dev * | dev, |
| int32_t | mode ) |
Sets the ADC's test mode.
Sets the ADC's test mode.
| dev | - The device structure. |
| mode | - ADC test mode. Example: 0 -> off(default) 1 -> midscale short 2 -> +FS short 3 -> -FS short 4 -> checkerboard output 5 -> PN sequence long 6 -> PN 9 short 7 -> one/zero word toggle 8 -> user test mode 9 to 14 -> unused 15 -> ramp output |
| int32_t ad9250_transfer | ( | struct ad9250_dev * | dev | ) |
Initiates a transfer and waits for the operation to end. Note: This function may be called after a shadowed register was written, so that the internal update can actually take place.
Initiates a transfer and waits for the operation to end.
| dev | - The device structure. |
| int32_t ad9250_write | ( | struct ad9250_dev * | dev, |
| int32_t | register_address, | ||
| int32_t | register_value ) |
Writes a value to the selected register.
Writes a value to the selected register.
| dev | - The device structure. |
| register_address | - The address of the register to write to. |
| register_value | - The value to write to the register. |