no-OS
|
Header file of AD9467 Driver. More...
Go to the source code of this file.
Classes | |
struct | ad9467_dev |
struct | ad9467_init_param |
Functions | |
int32_t | ad9467_setup (struct ad9467_dev **device, struct ad9467_init_param init_param) |
Configures the test mode and the output mode to a default state. More... | |
int32_t | ad9467_remove (struct ad9467_dev *dev) |
Free the resources allocated by ad9467_setup(). More... | |
int32_t | ad9467_write (struct ad9467_dev *dev, uint16_t reg_addr, uint8_t reg_val) |
Writes data into a register. More... | |
int32_t | ad9467_read (struct ad9467_dev *dev, uint16_t reg_addr, uint8_t *reg_val) |
Reads data from a register. More... | |
uint32_t | ad9467_set_bits_to_reg (struct ad9467_dev *dev, uint16_t register_address, uint8_t bits_value, uint8_t mask) |
Sets a bit or a group of bits inside a register without modifying the other bits. More... | |
int32_t | ad9467_pwr_mode (struct ad9467_dev *dev, int32_t mode, int32_t *ret_mode) |
Configures the power mode. More... | |
int32_t | ad9467_test_mode (struct ad9467_dev *dev, int32_t mode, int32_t *ret_mode) |
Sets the ADC's test mode. More... | |
int32_t | ad9467_reset_pn9 (struct ad9467_dev *dev, int32_t rst, int32_t *ret_stat) |
Sets (1) or clears (0) the reset short PN sequence bit(PN9). More... | |
int32_t | ad9467_reset_pn23 (struct ad9467_dev *dev, int32_t rst, int32_t *ret_stat) |
Sets (1) or clears (0) the reset long PN sequence bit(PN23). More... | |
int32_t | ad9467_external_ref (struct ad9467_dev *dev, int32_t en, int32_t *ret_stat) |
Enables (1) or disables (0) the external voltage reference. More... | |
int32_t | ad9467_analog_input_disconnect (struct ad9467_dev *dev, int32_t en, int32_t *ret_stat) |
Disconnects (1) or connects (0) the analog input from or to the the ADC channel. More... | |
int32_t | ad9467_offset_adj (struct ad9467_dev *dev, int32_t adj, int32_t *ret_stat) |
Sets the offset adjustment. More... | |
int32_t | ad9467_output_disable (struct ad9467_dev *dev, int32_t en, int32_t *ret_stat) |
Disables (1) or enables (0) the data output. More... | |
int32_t | ad9467_output_invert (struct ad9467_dev *dev, int32_t invert, int32_t *ret_stat) |
Activates the inverted (1) or normal (0) output mode. More... | |
int32_t | ad9467_output_format (struct ad9467_dev *dev, int32_t format, int32_t *ret_stat) |
Specifies the output format. More... | |
int32_t | ad9467_coarse_lvds_adj (struct ad9467_dev *dev, int32_t lvds_adj, int32_t *ret_stat) |
Determines LVDS output properties. More... | |
int32_t | ad9467_output_current_adj (struct ad9467_dev *dev, int32_t adj, int32_t *ret_stat) |
Sets the output current adjustment. More... | |
int32_t | ad9467_dco_clock_invert (struct ad9467_dev *dev, int32_t invert, int32_t *ret_stat) |
Activates the normal (0) or inverted (1) DCO clock. More... | |
int32_t | ad9467_dco_output_clock_delay (struct ad9467_dev *dev, int32_t delay, int32_t *ret_stat) |
Configures the clock delay setting. More... | |
int32_t | ad9467_full_scale_range (struct ad9467_dev *dev, float v_fs, float *ret_stat) |
Configures the full-scale input voltage selection. More... | |
int32_t | ad9467_analog_input_coupling (struct ad9467_dev *dev, int32_t coupling_mode, int32_t *ret_stat) |
Sets the AC coupling(0) or DC coupling(1) mode. More... | |
int32_t | ad9467_buffer_current_1 (struct ad9467_dev *dev, int32_t percentage, int32_t *ret_stat) |
Changes the input buffer current(1). More... | |
int32_t | ad9467_buffer_current_2 (struct ad9467_dev *dev, int32_t percentage, int32_t *ret_stat) |
Changes the input buffer current(2). More... | |
int32_t | ad9467_transfer (struct ad9467_dev *dev) |
Initiates a transfer and waits for the operation to end. More... | |
Header file of AD9467 Driver.
Copyright 2012(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AD9467_ADC_INPUT_ANALOG_DSCN (1 << 2) |
#define AD9467_ADC_INPUT_XVREF (1 << 7) |
#define AD9467_ADDR | ( | x | ) | ((x) & 0X1FFF) |
#define AD9467_ANALOG_INPUT_COUPLING (1 << 2) |
#define AD9467_BUFF_CURRENT_1 | ( | x | ) | (((x) & 0x3F) << 2) |
#define AD9467_BUFF_CURRENT_2 | ( | x | ) | (((x) & 0x3F) << 2) |
#define AD9467_CHIP_GRADE_BITS | ( | x | ) | (((x) & 0x3) << 4) |
#define AD9467_CHIP_PORT_CGF_LSB_FIRST (1 << 6) |
#define AD9467_CHIP_PORT_CGF_SOFT_RST (1 << 5) |
#define AD9467_CNT | ( | x | ) | (((x) - 1) << 13) |
#define AD9467_DEVICE_UPDATE_SW (1 << 0) |
#define AD9467_MODES_INT_PD_MODE | ( | x | ) | (((x) & 0x3) << 0) |
#define AD9467_OUT_ADJ_LVDS (1 << 3) |
#define AD9467_OUT_ADJ_OUT_CURRENT | ( | x | ) | (((x) & 0x7) << 0) |
#define AD9467_OUT_DELAY_DCO_DLY_EN (1 << 7) |
#define AD9467_OUT_DELAY_OUT_DLY | ( | x | ) | (((x) & 0x1F) << 0) |
#define AD9467_OUT_MODE_DATA_FORMAT | ( | x | ) | (((x) & 0x3) << 0) |
#define AD9467_OUT_MODE_DOUT_DISBL (1 << 4) |
#define AD9467_OUT_MODE_OUT_INV (1 << 2) |
#define AD9467_OUT_PHASE_DCO_INV (1 << 7) |
#define AD9467_READ (1 << 15) |
#define AD9467_REG_ADC_INPUT 0x0F |
#define AD9467_REG_ANALOG_INPUT 0x2C |
#define AD9467_REG_BUFF_CURRENT_1 0x36 |
#define AD9467_REG_BUFF_CURRENT_2 0x107 |
#define AD9467_REG_CHIP_GRADE 0x02 |
#define AD9467_REG_CHIP_ID 0x01 |
#define AD9467_REG_CHIP_PORT_CFG 0x00 |
#define AD9467_REG_DEVICE_UPDATE 0xFF |
#define AD9467_REG_MODES 0x08 |
#define AD9467_REG_OFFSET 0x10 |
#define AD9467_REG_OUT_ADJ 0x15 |
#define AD9467_REG_OUT_DELAY 0x17 |
#define AD9467_REG_OUT_MODE 0x14 |
#define AD9467_REG_OUT_PHASE 0x16 |
#define AD9467_REG_TEST_IO 0x0D |
#define AD9467_REG_V_REF 0x18 |
#define AD9467_TEST_IO_OUT_TEST | ( | x | ) | (((x) & 0xF) << 0) |
#define AD9467_TEST_IO_RST_PN_LONG (1 << 5) |
#define AD9467_TEST_IO_RST_PN_SHORT (1 << 4) |
#define AD9467_V_REF_IN_FS_RANGE | ( | x | ) | (((x) & 0xF) << 0) |
#define AD9467_WRITE (0 << 15) |
int32_t ad9467_analog_input_coupling | ( | struct ad9467_dev * | dev, |
int32_t | coupling_mode, | ||
int32_t * | ret_stat | ||
) |
Sets the AC coupling(0) or DC coupling(1) mode.
Sets the AC coupling(0) or DC coupling(1) mode.
dev | - The device structure. |
coupling_mode | - Input coupling mode selection. Example: 0 - AC coupling; 1 - DC coupling(default). |
ret_stat | - Return parameter of the set coupling mode. |
int32_t ad9467_analog_input_disconnect | ( | struct ad9467_dev * | dev, |
int32_t | en, | ||
int32_t * | ret_stat | ||
) |
Disconnects (1) or connects (0) the analog input from or to the the ADC channel.
Disconnects (1) or connects (0) the analog input from or to the ADC channel.
dev | - The device structure. |
en | - Enable option. Example: 1 - Disconnects the analog input. 0 - Connects the analog input(default). |
ret_stat | - Return parameter of the set analog input disconnect status. |
int32_t ad9467_buffer_current_1 | ( | struct ad9467_dev * | dev, |
int32_t | percentage, | ||
int32_t * | ret_stat | ||
) |
Changes the input buffer current(1).
Changes the input buffer current(1).
dev | - The device structure. |
percentage | - Buffer current select 1. Example: +530% +520% ...
|
ret_stat | - Return parameter of the set buffer current. |
int32_t ad9467_buffer_current_2 | ( | struct ad9467_dev * | dev, |
int32_t | percentage, | ||
int32_t * | ret_stat | ||
) |
Changes the input buffer current(2).
Changes the input buffer current(2).
dev | - The device structure. |
percentage | - Buffer current select 2. Example: +530% +520% ...
|
ret_stat | - Return parameter of the set buffer current. |
int32_t ad9467_coarse_lvds_adj | ( | struct ad9467_dev * | dev, |
int32_t | lvds_adj, | ||
int32_t * | ret_stat | ||
) |
Determines LVDS output properties.
Determines LVDS output properties.
dev | - The device structure. |
lvds_adj | - Coarse LVDS adjust. Example: 0 - 3.0 mA output current level(default); 1 - 1.71 mA output current level. |
ret_stat | - Return parameter of the set LVDS adjust state. |
int32_t ad9467_dco_clock_invert | ( | struct ad9467_dev * | dev, |
int32_t | invert, | ||
int32_t * | ret_stat | ||
) |
Activates the normal (0) or inverted (1) DCO clock.
Activates the normal (0) or inverted (1) DCO clock.
dev | - The device structure. |
invert | - Invert option. Example: 0 - Activates the normal DCO clock(default); 1 - Activates the inverted DCO clock. |
ret_stat | - Return parameter of the set DCO clock inversion status. |
int32_t ad9467_dco_output_clock_delay | ( | struct ad9467_dev * | dev, |
int32_t | delay, | ||
int32_t * | ret_stat | ||
) |
Configures the clock delay setting.
Configures the clock delay setting.
dev | - The device structure. |
delay | - The clock delay setting in ps {0, 100, 200, ..., 3200}. Setting the delay to 0 disables the DCO output clock delay. |
ret_stat | - Return parameter of the set clock delay. |
int32_t ad9467_external_ref | ( | struct ad9467_dev * | dev, |
int32_t | en, | ||
int32_t * | ret_stat | ||
) |
Enables (1) or disables (0) the external voltage reference.
Enables (1) or disables (0) the external voltage reference.
dev | - The device structure. |
en | - Enable option. Example: 1 - Enables the external reference; 0 - Disables the external reference(default). |
ret_stat | - Return parameter of the set external reference enable state. |
int32_t ad9467_full_scale_range | ( | struct ad9467_dev * | dev, |
float | v_fs, | ||
float * | ret_stat | ||
) |
Configures the full-scale input voltage selection.
Configures the full-scale input voltage selection.
dev | - The device structure. |
v_fs | - Full-scale input voltage selection. Example: 2.0 V p-p 2.1 V p-p 2.2 V p-p 2.3 V p-p 2.4 V p-p 2.5 V p-p(default) |
ret_stat | - Return parameter of the set input voltage selection. |
int32_t ad9467_offset_adj | ( | struct ad9467_dev * | dev, |
int32_t | adj, | ||
int32_t * | ret_stat | ||
) |
Sets the offset adjustment.
Sets the offset adjustment.
dev | - The device structure. |
adj | - The offset adjust value in LSBs from +127 to -128. |
ret_stat | - Return parameter of the set offset adjustment. |
int32_t ad9467_output_current_adj | ( | struct ad9467_dev * | dev, |
int32_t | adj, | ||
int32_t * | ret_stat | ||
) |
Sets the output current adjustment.
Sets the output current adjustment.
dev | - The device structure. |
adj | - The output current adjustment. Example: 001 = 3.0 mA output drive current (default); 010 = 2.79 mA output drive current; 011 = 2.57 mA output drive current; 100 = 2.35 mA output drive current; 101 = 2.14 mA output drive current; 110 = 1.93 mA output drive current; 111 = 1.71 mA output drive current; |
ret_stat | - Return parameter of the set current adjustment. |
int32_t ad9467_output_disable | ( | struct ad9467_dev * | dev, |
int32_t | en, | ||
int32_t * | ret_stat | ||
) |
Disables (1) or enables (0) the data output.
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). |
ret_stat | - Return parameter of the set output disable state. |
int32_t ad9467_output_format | ( | struct ad9467_dev * | dev, |
int32_t | format, | ||
int32_t * | ret_stat | ||
) |
Specifies the output format.
Specifies the output format.
dev | - The device structure. |
format | - The output format. Example: 0 � offset binary(default); 1 � two's complement; 2 � gray code; 3 � reserved. |
ret_stat | - Return parameter of the set output format. |
int32_t ad9467_output_invert | ( | struct ad9467_dev * | dev, |
int32_t | invert, | ||
int32_t * | ret_stat | ||
) |
Activates the inverted (1) or normal (0) output mode.
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). |
ret_stat | - Return parameter of the set output mode. |
int32_t ad9467_pwr_mode | ( | struct ad9467_dev * | dev, |
int32_t | mode, | ||
int32_t * | ret_mode | ||
) |
Configures the power mode.
Configures the power mode.
dev | - The device structure. |
mode | - The power mode. Example: 00 � normal operation(default); 01 � full power-down; |
ret_mode | - Return parameter of the set power mode. |
int32_t ad9467_read | ( | struct ad9467_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t * | reg_val | ||
) |
Reads data from a register.
Reads data from a register.
dev | - The device structure. |
reg_addr | - The address of the register to be read. |
reg_val | - The value read from the register. |
int32_t ad9467_remove | ( | struct ad9467_dev * | dev | ) |
Free the resources allocated by ad9467_setup().
Free the resources allocated by ad9467_setup().
dev | - The device structure. |
int32_t ad9467_reset_pn23 | ( | struct ad9467_dev * | dev, |
int32_t | rst, | ||
int32_t * | ret_stat | ||
) |
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 | - Reset option. Example: 1 - The PN sequence is held in reset; 0 - The PN sequence resumes from the seed value(0x3AFF). |
ret_stat | - Return parameter of the set PN23 status. |
int32_t ad9467_reset_pn9 | ( | struct ad9467_dev * | dev, |
int32_t | rst, | ||
int32_t * | ret_stat | ||
) |
Sets (1) or clears (0) the reset short PN sequence bit(PN9).
Sets (1) or clears (0) the reset short PN sequence bit(PN9).
dev | - The device structure. |
rst | - Reset option. Example: 1 - The PN sequence is held in reset; 0 - The PN sequence resumes from the seed value(0x92). |
ret_stat | - Return parameter of the set PN9 status. |
uint32_t ad9467_set_bits_to_reg | ( | struct ad9467_dev * | dev, |
uint16_t | register_address, | ||
uint8_t | bits_value, | ||
uint8_t | mask | ||
) |
Sets a bit or a group of bits inside a register without modifying the other bits.
Sets a bit or a group of bits inside a register without modifying the other bits.
dev | - The device structure. |
register_address | - The address of the register to be written. |
bits_value | - The value of the bit/bits. |
mask | - The bit/bits position in the register. |
int32_t ad9467_setup | ( | struct ad9467_dev ** | device, |
struct ad9467_init_param | init_param | ||
) |
Configures the test mode and the output mode to a default state.
Configures the test mode and the output mode to a default state.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int32_t ad9467_test_mode | ( | struct ad9467_dev * | dev, |
int32_t | mode, | ||
int32_t * | ret_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 23 sequence 6 -> PN 9 sequence 7 -> one/zero word toggle |
ret_mode | - Return parameter of the set test mode. |
int32_t ad9467_transfer | ( | struct ad9467_dev * | dev | ) |
Initiates a transfer and waits for the operation to end.
Initiates a transfer and waits for the operation to end.
int32_t ad9467_write | ( | struct ad9467_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
Writes data into a register.
Writes data into a register.
dev | - The device structure. |
reg_addr | - The address of the register to be written. |
reg_val | - The value to be written into the register. |