no-OS
|
Implementation of AD4080 Driver. More...
Functions | |
int | ad4080_write (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t reg_val) |
Write device register. More... | |
int | ad4080_read (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t *reg_val) |
Read device register. More... | |
int | ad4080_update_bits (struct ad4080_dev *dev, uint16_t reg_addr, uint8_t mask, uint8_t reg_val) |
Update specific register bits. More... | |
int | ad4080_soft_reset (struct ad4080_dev *dev) |
Software reset the device. More... | |
int | ad4080_set_addr_asc (struct ad4080_dev *dev, enum ad4080_addr_asc addr_asc) |
Set Address Ascension. More... | |
int | ad4080_get_addr_asc (struct ad4080_dev *dev, enum ad4080_addr_asc *addr_asc) |
Get Address Ascension. More... | |
int | ad4080_set_single_instr (struct ad4080_dev *dev, enum ad4080_single_instr single_instr) |
Set Single/Streaming Mode. More... | |
int | ad4080_get_single_instr (struct ad4080_dev *dev, enum ad4080_single_instr *single_instr) |
Get Single/Streaming Mode. More... | |
int | ad4080_set_short_instr (struct ad4080_dev *dev, enum ad4080_short_instr short_instr) |
Set Short Instruction. More... | |
int | ad4080_get_short_instr (struct ad4080_dev *dev, enum ad4080_short_instr *short_instr) |
Get Short Instruction. More... | |
int | ad4080_set_op_mode (struct ad4080_dev *dev, enum ad4080_op_mode op_mode) |
Set Operation Mode. More... | |
int | ad4080_get_op_mode (struct ad4080_dev *dev, enum ad4080_op_mode *op_mode) |
Get Operation Mode. More... | |
int | ad4080_set_strict_reg_access (struct ad4080_dev *dev, enum ad4080_strict_reg_access strict_reg) |
Set Strict Register Access. More... | |
int | ad4080_get_strict_reg_access (struct ad4080_dev *dev, enum ad4080_strict_reg_access *strict_reg) |
Get Strict Register Access. More... | |
int | ad4080_set_intf_chk_en (struct ad4080_dev *dev, enum ad4080_intf_chk_en intf_chk_en) |
Set AD4080 Output Pattern. More... | |
int | ad4080_get_intf_chk_en (struct ad4080_dev *dev, enum ad4080_intf_chk_en *intf_chk_en) |
Get AD4080 Output Pattern. More... | |
int | ad4080_set_cnv_spi_lvds_lanes (struct ad4080_dev *dev, enum ad4080_cnv_spi_lvds_lanes cnv_spi_lvds_lanes) |
Set AD4080 LVDS/SPI Lane Control. More... | |
int | ad4080_get_cnv_spi_lvds_lanes (struct ad4080_dev *dev, enum ad4080_cnv_spi_lvds_lanes *cnv_spi_lvds_lanes) |
Get AD4080 LVDS/SPI Lane Control. More... | |
int | ad4080_set_conv_data_spi_lvds (struct ad4080_dev *dev, enum ad4080_conv_data_spi_lvds conv_data_spi_lvds) |
Set AD4080 Data Interface Configuration. More... | |
int | ad4080_get_conv_data_spi_lvds (struct ad4080_dev *dev, enum ad4080_conv_data_spi_lvds *conv_data_spi_lvds) |
Get AD4080 Data Interface Configuration. More... | |
int | ad4080_set_lvds_cnv_clk_cnt (struct ad4080_dev *dev, uint8_t lvds_cnv_clk_cnt) |
Set AD4080 Interface clock periods from CNV rising edge. More... | |
int | ad4080_get_lvds_cnv_clk_cnt (struct ad4080_dev *dev, uint8_t *lvds_cnv_clk_cnt) |
Get AD4080 Interface clock periods from CNV rising edge. More... | |
int | ad4080_set_lvds_self_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_self_clk_mode lvds_self_clk_mode) |
Set AD4080 LVDS Self Clock Mode. More... | |
int | ad4080_get_lvds_self_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_self_clk_mode *lvds_self_clk_mode) |
Get AD4080 LVDS Self Clock Mode. More... | |
int | ad4080_set_lvds_cnv_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_cnv_clk_mode cnv_clk_mode) |
Set AD4080 LVDS CNV Clock Mode. More... | |
int | ad4080_get_lvds_cnv_clk_mode (struct ad4080_dev *dev, enum ad4080_lvds_cnv_clk_mode *cnv_clk_mode) |
Get AD4080 LVDS CNV Clock Mode. More... | |
int | ad4080_set_lvds_vod (struct ad4080_dev *dev, enum ad4080_lvds_vod lvds_vod) |
Set AD4080 LVDS Differential Output Voltage. More... | |
int | ad4080_get_lvds_vod (struct ad4080_dev *dev, enum ad4080_lvds_vod *lvds_vod) |
Get AD4080 LVDS Differential Output Voltage. More... | |
int | ad4080_set_ana_dig_ldo_pd (struct ad4080_dev *dev, enum ad4080_ana_dig_ldo_pd ana_dig_ldo_pd) |
Set AD4080 Analog/Digital LDO. More... | |
int | ad4080_get_ana_dig_ldo_pd (struct ad4080_dev *dev, enum ad4080_ana_dig_ldo_pd *ana_dig_ldo_pd) |
Get AD4080 Analog/Digital LDO. More... | |
int | ad4080_set_intf_ldo_pd (struct ad4080_dev *dev, enum ad4080_intf_ldo_pd intf_ldo_pd) |
Set AD4080 Interface LDO. More... | |
int | ad4080_get_intf_ldo_pd (struct ad4080_dev *dev, enum ad4080_intf_ldo_pd *intf_ldo_pd) |
Get AD4080 Interface LDO. More... | |
int | ad4080_set_fifo_mode (struct ad4080_dev *dev, enum ad4080_fifo_mode fifo_mode) |
Set AD4080 Conversion Data FIFO Mode. More... | |
int | ad4080_get_fifo_mode (struct ad4080_dev *dev, enum ad4080_fifo_mode *fifo_mode) |
Get Set AD4080 Conversion Data FIFO Mode. More... | |
int | ad4080_set_fifo_watermark (struct ad4080_dev *dev, uint16_t fifo_watermark) |
Set AD4080 FIFO Watermark. More... | |
int | ad4080_get_fifo_watermark (struct ad4080_dev *dev, uint16_t *fifo_watermark) |
Get AD4080 FIFO Watermark. More... | |
int | ad4080_set_gpio_output_enable (struct ad4080_dev *dev, enum ad4080_gpio gpio, enum ad4080_gpio_op_enable gpio_op_enable) |
Configure GPIO as input or output. More... | |
int | ad4080_set_gpio_output_func (struct ad4080_dev *dev, enum ad4080_gpio gpio, enum ad4080_gpio_op_func_sel gpio_func) |
Configure the GPIO output for a specific function. More... | |
int | ad4080_gpio_write_data (struct ad4080_dev *dev, enum ad4080_gpio gpio, bool data) |
Set the GPIO data. More... | |
int | ad4080_gpio_read_data (struct ad4080_dev *dev, enum ad4080_gpio gpio, bool *data) |
Read the GPIO data. More... | |
int | ad4080_configuration_intf_init (struct ad4080_dev *dev, struct ad4080_init_param init_param) |
Configure the config SPI interface during initialization. More... | |
int | ad4080_data_intf_init (struct ad4080_dev *dev, struct ad4080_init_param init_param) |
Configure the data interface during initialization. More... | |
int | ad4080_init (struct ad4080_dev **device, struct ad4080_init_param init_param) |
Initialize the device. More... | |
int | ad4080_remove (struct ad4080_dev *dev) |
Remove the device and release resources. More... | |
Implementation of AD4080 Driver.
Copyright 2023(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.
int ad4080_configuration_intf_init | ( | struct ad4080_dev * | dev, |
struct ad4080_init_param | init_param | ||
) |
Configure the config SPI interface during initialization.
dev | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int ad4080_data_intf_init | ( | struct ad4080_dev * | dev, |
struct ad4080_init_param | init_param | ||
) |
Configure the data interface during initialization.
dev | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int ad4080_get_addr_asc | ( | struct ad4080_dev * | dev, |
enum ad4080_addr_asc * | addr_asc | ||
) |
Get Address Ascension.
dev | - The device structure. |
addr_asc | - The address ascension mode. |
int ad4080_get_ana_dig_ldo_pd | ( | struct ad4080_dev * | dev, |
enum ad4080_ana_dig_ldo_pd * | ana_dig_ldo_pd | ||
) |
Get AD4080 Analog/Digital LDO.
dev | - The device structure. |
ana_dig_ldo_pd | - The Analog/Digital LDO value |
int ad4080_get_cnv_spi_lvds_lanes | ( | struct ad4080_dev * | dev, |
enum ad4080_cnv_spi_lvds_lanes * | cnv_spi_lvds_lanes | ||
) |
Get AD4080 LVDS/SPI Lane Control.
dev | - The device structure. |
cnv_spi_lvds_lanes | - The LVDS/SPI Lane Control mode. |
int ad4080_get_conv_data_spi_lvds | ( | struct ad4080_dev * | dev, |
enum ad4080_conv_data_spi_lvds * | conv_data_spi_lvds | ||
) |
Get AD4080 Data Interface Configuration.
dev | - The device structure. |
conv_data_spi_lvds | - The conversion data mode. |
int ad4080_get_fifo_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_fifo_mode * | fifo_mode | ||
) |
Get Set AD4080 Conversion Data FIFO Mode.
dev | - The device structure. |
fifo_mode | - The Conversion Data FIFO Mode |
int ad4080_get_fifo_watermark | ( | struct ad4080_dev * | dev, |
uint16_t * | fifo_watermark | ||
) |
Get AD4080 FIFO Watermark.
dev | - The device structure. |
fifo_watermark | - The FIFO Watermark. |
int ad4080_get_intf_chk_en | ( | struct ad4080_dev * | dev, |
enum ad4080_intf_chk_en * | intf_chk_en | ||
) |
Get AD4080 Output Pattern.
dev | - The device structure. |
intf_chk_en | - The Output Pattern mode. |
int ad4080_get_intf_ldo_pd | ( | struct ad4080_dev * | dev, |
enum ad4080_intf_ldo_pd * | intf_ldo_pd | ||
) |
Get AD4080 Interface LDO.
dev | - The device structure. |
intf_ldo_pd | - The Interface LDO value |
int ad4080_get_lvds_cnv_clk_cnt | ( | struct ad4080_dev * | dev, |
uint8_t * | lvds_cnv_clk_cnt | ||
) |
Get AD4080 Interface clock periods from CNV rising edge.
dev | - The device structure. |
lvds_cnv_clk_cnt | - Interface clock periods from CNV rising edge value |
int ad4080_get_lvds_cnv_clk_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_cnv_clk_mode * | cnv_clk_mode | ||
) |
Get AD4080 LVDS CNV Clock Mode.
dev | - The device structure. |
cnv_clk_mode | - The LVDS CNV Clock Mode value |
int ad4080_get_lvds_self_clk_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_self_clk_mode * | lvds_self_clk_mode | ||
) |
Get AD4080 LVDS Self Clock Mode.
dev | - The device structure. |
lvds_self_clk_mode | - The LVDS Self Clock Mode. |
int ad4080_get_lvds_vod | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_vod * | lvds_vod | ||
) |
Get AD4080 LVDS Differential Output Voltage.
dev | - The device structure. |
lvds_vod | - The LVDS Differential Output Voltage value |
int ad4080_get_op_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_op_mode * | op_mode | ||
) |
Get Operation Mode.
dev | - The device structure. |
op_mode | - The Operation Mode. |
int ad4080_get_short_instr | ( | struct ad4080_dev * | dev, |
enum ad4080_short_instr * | short_instr | ||
) |
Get Short Instruction.
dev | - The device structure. |
short_instr | - The short instruction mode. |
int ad4080_get_single_instr | ( | struct ad4080_dev * | dev, |
enum ad4080_single_instr * | single_instr | ||
) |
Get Single/Streaming Mode.
dev | - The device structure. |
single_instr | - The single instruction mode. |
int ad4080_get_strict_reg_access | ( | struct ad4080_dev * | dev, |
enum ad4080_strict_reg_access * | strict_reg | ||
) |
Get Strict Register Access.
dev | - The device structure. |
strict_reg | - The strict reg mode. |
int ad4080_gpio_read_data | ( | struct ad4080_dev * | dev, |
enum ad4080_gpio | gpio, | ||
bool * | data | ||
) |
Read the GPIO data.
dev | - The device structure. |
gpio | - The GPIO pin to be configured. |
data | - Pointer to the data (0 or 1) read back. |
int ad4080_gpio_write_data | ( | struct ad4080_dev * | dev, |
enum ad4080_gpio | gpio, | ||
bool | data | ||
) |
Set the GPIO data.
dev | - The device structure. |
gpio | - The GPIO pin to be configured. |
data | - The data (0 or 1) to be written. |
int ad4080_init | ( | struct ad4080_dev ** | device, |
struct ad4080_init_param | init_param | ||
) |
Initialize the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int ad4080_read | ( | struct ad4080_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t * | reg_val | ||
) |
Read device register.
dev | - The device structure. |
reg_addr | - The register address. |
reg_val | - The data read from the register. |
int ad4080_remove | ( | struct ad4080_dev * | dev | ) |
Remove the device and release resources.
dev | - The device structure. |
int ad4080_set_addr_asc | ( | struct ad4080_dev * | dev, |
enum ad4080_addr_asc | addr_asc | ||
) |
Set Address Ascension.
dev | - The device structure. |
addr_asc | - The address ascension mode. |
int ad4080_set_ana_dig_ldo_pd | ( | struct ad4080_dev * | dev, |
enum ad4080_ana_dig_ldo_pd | ana_dig_ldo_pd | ||
) |
Set AD4080 Analog/Digital LDO.
dev | - The device structure. |
ana_dig_ldo_pd | - The Analog/Digital LDO value |
int ad4080_set_cnv_spi_lvds_lanes | ( | struct ad4080_dev * | dev, |
enum ad4080_cnv_spi_lvds_lanes | cnv_spi_lvds_lanes | ||
) |
Set AD4080 LVDS/SPI Lane Control.
dev | - The device structure. |
cnv_spi_lvds_lanes | - The LVDS/SPI Lane Control mode. |
int ad4080_set_conv_data_spi_lvds | ( | struct ad4080_dev * | dev, |
enum ad4080_conv_data_spi_lvds | conv_data_spi_lvds | ||
) |
Set AD4080 Data Interface Configuration.
dev | - The device structure. |
conv_data_spi_lvds | - The conversion data mode. |
int ad4080_set_fifo_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_fifo_mode | fifo_mode | ||
) |
Set AD4080 Conversion Data FIFO Mode.
dev | - The device structure. |
fifo_mode | - The Conversion Data FIFO Mode |
int ad4080_set_fifo_watermark | ( | struct ad4080_dev * | dev, |
uint16_t | fifo_watermark | ||
) |
Set AD4080 FIFO Watermark.
dev | - The device structure. |
fifo_watermark | - The FIFO Watermark. |
int ad4080_set_gpio_output_enable | ( | struct ad4080_dev * | dev, |
enum ad4080_gpio | gpio, | ||
enum ad4080_gpio_op_enable | gpio_op_enable | ||
) |
Configure GPIO as input or output.
dev | - The device structure. |
gpio | - The GPIO pin to be configured. |
gpio_op_enable | - The GPIO Output Enable bit selection |
int ad4080_set_gpio_output_func | ( | struct ad4080_dev * | dev, |
enum ad4080_gpio | gpio, | ||
enum ad4080_gpio_op_func_sel | gpio_func | ||
) |
Configure the GPIO output for a specific function.
dev | - The device structure. |
gpio | - The GPIO pin to be configured. |
gpio_func | - The function to be selected for the GPIO. |
int ad4080_set_intf_chk_en | ( | struct ad4080_dev * | dev, |
enum ad4080_intf_chk_en | intf_chk_en | ||
) |
Set AD4080 Output Pattern.
dev | - The device structure. |
intf_chk_en | - The Output Pattern mode. |
int ad4080_set_intf_ldo_pd | ( | struct ad4080_dev * | dev, |
enum ad4080_intf_ldo_pd | intf_ldo_pd | ||
) |
Set AD4080 Interface LDO.
dev | - The device structure. |
intf_ldo_pd | - The Interface LDO value |
int ad4080_set_lvds_cnv_clk_cnt | ( | struct ad4080_dev * | dev, |
uint8_t | lvds_cnv_clk_cnt | ||
) |
Set AD4080 Interface clock periods from CNV rising edge.
dev | - The device structure. |
lvds_cnv_clk_cnt | - Interface clock periods from CNV rising edge value |
int ad4080_set_lvds_cnv_clk_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_cnv_clk_mode | cnv_clk_mode | ||
) |
Set AD4080 LVDS CNV Clock Mode.
dev | - The device structure. |
cnv_clk_mode | - The LVDS CNV Clock Mode value |
int ad4080_set_lvds_self_clk_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_self_clk_mode | lvds_self_clk_mode | ||
) |
Set AD4080 LVDS Self Clock Mode.
dev | - The device structure. |
lvds_self_clk_mode | - The LVDS Self Clock Mode. |
int ad4080_set_lvds_vod | ( | struct ad4080_dev * | dev, |
enum ad4080_lvds_vod | lvds_vod | ||
) |
Set AD4080 LVDS Differential Output Voltage.
dev | - The device structure. |
lvds_vod | - The LVDS Differential Output Voltage value |
int ad4080_set_op_mode | ( | struct ad4080_dev * | dev, |
enum ad4080_op_mode | op_mode | ||
) |
Set Operation Mode.
dev | - The device structure. |
op_mode | - The operation mode. |
int ad4080_set_short_instr | ( | struct ad4080_dev * | dev, |
enum ad4080_short_instr | short_instr | ||
) |
Set Short Instruction.
dev | - The device structure. |
short_instr | - The short instruction mode. |
int ad4080_set_single_instr | ( | struct ad4080_dev * | dev, |
enum ad4080_single_instr | single_instr | ||
) |
Set Single/Streaming Mode.
dev | - The device structure. |
single_instr | - The single instruction mode. |
int ad4080_set_strict_reg_access | ( | struct ad4080_dev * | dev, |
enum ad4080_strict_reg_access | strict_reg | ||
) |
Set Strict Register Access.
dev | - The device structure. |
strict_reg | - The strict reg mode. |
int ad4080_soft_reset | ( | struct ad4080_dev * | dev | ) |
Software reset the device.
dev | - The device structure. |
int ad4080_update_bits | ( | struct ad4080_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | reg_val | ||
) |
Update specific register bits.
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Specific bits mask. |
reg_val | - The data to be written. |
int ad4080_write | ( | struct ad4080_dev * | dev, |
uint16_t | reg_addr, | ||
uint8_t | reg_val | ||
) |
Write device register.
dev- | The device structure. |
reg_addr | - The register address. |
reg_val | - The data to be written. |