no-OS
|
Header file of ADAQ8092 Driver. More...
#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_spi.h"
#include "no_os_gpio.h"
Go to the source code of this file.
Classes | |
struct | adaq8092_init_param |
ADAQ8092 Device initialization parameters. More... | |
struct | adaq8092_dev |
ADAQ8092 Device structure. More... | |
Macros | |
#define | ADAQ8092_SPI_READ NO_OS_BIT(7) |
#define | ADAQ8092_ADDR(x) ((x) & 0xFF) |
#define | ADAQ8092_REG_RESET 0x00 |
#define | ADAQ8092_REG_POWERDOWN 0x01 |
#define | ADAQ8092_REG_TIMING 0x02 |
#define | ADAQ8092_REG_OUTPUT_MODE 0x03 |
#define | ADAQ8092_REG_DATA_FORMAT 0x04 |
#define | ADAQ8092_RESET NO_OS_BIT(7) |
#define | ADAQ8092_POWERDOWN_MODE NO_OS_GENMASK(1, 0) |
#define | ADAQ8092_CLK_INVERT NO_OS_BIT(3) |
#define | ADAQ8092_CLK_PHASE NO_OS_GENMASK(2, 1) |
#define | ADAQ8092_CLK_DUTYCYCLE NO_OS_BIT(0) |
#define | ADAQ8092_ILVDS NO_OS_GENMASK(6, 4) |
#define | ADAQ8092_TERMON NO_OS_BIT(3) |
#define | ADAQ8092_OUTOFF NO_OS_BIT(2) |
#define | ADAQ8092_OUTMODE NO_OS_GENMASK(1, 0) |
#define | ADAQ8092_OUTTEST NO_OS_GENMASK(5, 3) |
#define | ADAQ8092_ABP NO_OS_BIT(2) |
#define | ADAQ8092_RAND NO_OS_BIT(1) |
#define | ADAQ8092_TWOSCOMP NO_OS_BIT(0) |
Functions | |
int | adaq8092_read (struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t *reg_data) |
Read device register. More... | |
int | adaq8092_write (struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t reg_data) |
Write device register. More... | |
int | adaq8092_update_bits (struct adaq8092_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_data) |
Update specific register bits. More... | |
int | adaq8092_init (struct adaq8092_dev **device, struct adaq8092_init_param init_param) |
Initialize the device. More... | |
int | adaq8092_remove (struct adaq8092_dev *dev) |
Remove the device and release resources. More... | |
int | adaq8092_set_pd_mode (struct adaq8092_dev *dev, enum adaq8092_powerdown_modes mode) |
Set the device powerodown mode. More... | |
enum adaq8092_powerdown_modes | adaq8092_get_pd_mode (struct adaq8092_dev *dev) |
Get the device powerdown mode. More... | |
int | adaq8092_set_clk_pol_mode (struct adaq8092_dev *dev, enum adaq8092_clk_invert mode) |
Set the clock polarity mode. More... | |
enum adaq8092_clk_invert | adaq8092_get_clk_pol_mode (struct adaq8092_dev *dev) |
Get the clock polarity mode. More... | |
int | adaq8092_set_clk_phase_mode (struct adaq8092_dev *dev, enum adaq8092_clk_phase_delay mode) |
Set the clock phase delay mode. More... | |
enum adaq8092_clk_phase_delay | adaq8092_get_clk_phase_mode (struct adaq8092_dev *dev) |
Get the clock phase delay mode. More... | |
int | adaq8092_set_clk_dc_mode (struct adaq8092_dev *dev, enum adaq8092_clk_dutycycle mode) |
Set the clock duty cycle stabilizer mode. More... | |
enum adaq8092_clk_dutycycle | adaq8092_get_clk_dc_mode (struct adaq8092_dev *dev) |
Get the clock duty cycle stabilizer mode. More... | |
int | adaq8092_set_lvds_cur_mode (struct adaq8092_dev *dev, enum adaq8092_lvds_out_current mode) |
Set the LVDS output current mode. More... | |
enum adaq8092_lvds_out_current | adaq8092_get_lvds_cur_mode (struct adaq8092_dev *dev) |
Get the LVDS output current mode. More... | |
int | adaq8092_set_lvds_term_mode (struct adaq8092_dev *dev, enum adaq8092_internal_term mode) |
Set the LVDS internal temination mode. More... | |
enum adaq8092_internal_term | adaq8092_get_lvds_term_mode (struct adaq8092_dev *dev) |
Get the LVDS internal temination device mode. More... | |
int | adaq8092_set_dout_en (struct adaq8092_dev *dev, enum adaq8092_dout_enable mode) |
Set digital outputs. More... | |
enum adaq8092_dout_enable | adaq8092_get_dout_en (struct adaq8092_dev *dev) |
Get digital outputs. More... | |
int | adaq8092_set_dout_mode (struct adaq8092_dev *dev, enum adaq8092_dout_modes mode) |
Set the digital output mode. More... | |
enum adaq8092_dout_modes | adaq8092_get_dout_mode (struct adaq8092_dev *dev) |
Get the digital output mode. More... | |
int | adaq8092_set_test_mode (struct adaq8092_dev *dev, enum adaq8092_out_test_modes mode) |
Set digital output test pattern mode. More... | |
enum adaq8092_out_test_modes | adaq8092_get_test_mode (struct adaq8092_dev *dev) |
Get digital output test pattern mode. More... | |
int | adaq8092_set_alt_pol_en (struct adaq8092_dev *dev, enum adaq8092_alt_bit_pol mode) |
Set the alternate bit polarity mode. More... | |
enum adaq8092_alt_bit_pol | adaq8092_get_alt_pol_en (struct adaq8092_dev *dev) |
Get the alternate bit polarity mode. More... | |
int | adaq8092_set_data_rand_en (struct adaq8092_dev *dev, enum adaq8092_data_rand mode) |
Set the data output randomizer mode. More... | |
enum adaq8092_data_rand | adaq8092_get_data_rand_en (struct adaq8092_dev *dev) |
Get the data output randomizer mode. More... | |
int | adaq8092_set_twos_comp (struct adaq8092_dev *dev, enum adaq8092_twoscomp mode) |
Set the Tows Complement mode. More... | |
enum adaq8092_twoscomp | adaq8092_get_twos_comp (struct adaq8092_dev *dev) |
Get the Tows Complement mode. More... | |
Header file of ADAQ8092 Driver.
Copyright 2022(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 ADAQ8092_ABP NO_OS_BIT(2) |
#define ADAQ8092_ADDR | ( | x | ) | ((x) & 0xFF) |
#define ADAQ8092_CLK_DUTYCYCLE NO_OS_BIT(0) |
#define ADAQ8092_CLK_INVERT NO_OS_BIT(3) |
#define ADAQ8092_CLK_PHASE NO_OS_GENMASK(2, 1) |
#define ADAQ8092_ILVDS NO_OS_GENMASK(6, 4) |
#define ADAQ8092_OUTMODE NO_OS_GENMASK(1, 0) |
#define ADAQ8092_OUTOFF NO_OS_BIT(2) |
#define ADAQ8092_OUTTEST NO_OS_GENMASK(5, 3) |
#define ADAQ8092_POWERDOWN_MODE NO_OS_GENMASK(1, 0) |
#define ADAQ8092_RAND NO_OS_BIT(1) |
#define ADAQ8092_REG_DATA_FORMAT 0x04 |
#define ADAQ8092_REG_OUTPUT_MODE 0x03 |
#define ADAQ8092_REG_POWERDOWN 0x01 |
#define ADAQ8092_REG_RESET 0x00 |
#define ADAQ8092_REG_TIMING 0x02 |
#define ADAQ8092_RESET NO_OS_BIT(7) |
#define ADAQ8092_SPI_READ NO_OS_BIT(7) |
#define ADAQ8092_TERMON NO_OS_BIT(3) |
#define ADAQ8092_TWOSCOMP NO_OS_BIT(0) |
enum adaq8092_alt_bit_pol |
enum adaq8092_clk_invert |
enum adaq8092_data_rand |
enum adaq8092_dout_enable |
enum adaq8092_dout_modes |
enum adaq8092_twoscomp |
enum adaq8092_alt_bit_pol adaq8092_get_alt_pol_en | ( | struct adaq8092_dev * | dev | ) |
Get the alternate bit polarity mode.
dev | - The device structure. |
enum adaq8092_clk_dutycycle adaq8092_get_clk_dc_mode | ( | struct adaq8092_dev * | dev | ) |
Get the clock duty cycle stabilizer mode.
dev | - The device structure. |
enum adaq8092_clk_phase_delay adaq8092_get_clk_phase_mode | ( | struct adaq8092_dev * | dev | ) |
Get the clock phase delay mode.
dev | - The device structure. |
enum adaq8092_clk_invert adaq8092_get_clk_pol_mode | ( | struct adaq8092_dev * | dev | ) |
Get the clock polarity mode.
dev | - The device structure. |
enum adaq8092_data_rand adaq8092_get_data_rand_en | ( | struct adaq8092_dev * | dev | ) |
Get the data output randomizer mode.
dev | - The device structure. |
enum adaq8092_dout_enable adaq8092_get_dout_en | ( | struct adaq8092_dev * | dev | ) |
Get digital outputs.
dev | - The device structure. |
enum adaq8092_dout_modes adaq8092_get_dout_mode | ( | struct adaq8092_dev * | dev | ) |
Get the digital output mode.
dev | - The device structure. |
enum adaq8092_lvds_out_current adaq8092_get_lvds_cur_mode | ( | struct adaq8092_dev * | dev | ) |
Get the LVDS output current mode.
dev | - The device structure. |
enum adaq8092_internal_term adaq8092_get_lvds_term_mode | ( | struct adaq8092_dev * | dev | ) |
Get the LVDS internal temination device mode.
dev | - The device structure. |
enum adaq8092_powerdown_modes adaq8092_get_pd_mode | ( | struct adaq8092_dev * | dev | ) |
Get the device powerdown mode.
dev | - The device structure. |
enum adaq8092_out_test_modes adaq8092_get_test_mode | ( | struct adaq8092_dev * | dev | ) |
Get digital output test pattern mode.
dev | - The device structure. |
enum adaq8092_twoscomp adaq8092_get_twos_comp | ( | struct adaq8092_dev * | dev | ) |
Get the Tows Complement mode.
dev | - The device structure. |
int adaq8092_init | ( | struct adaq8092_dev ** | device, |
struct adaq8092_init_param | init_param | ||
) |
Initialize the device.
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
int adaq8092_read | ( | struct adaq8092_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t * | reg_data | ||
) |
Read device register.
dev | - The device structure. |
reg_addr | - The register address. |
reg_data | - The data read from the register. |
int adaq8092_remove | ( | struct adaq8092_dev * | dev | ) |
Remove the device and release resources.
dev | - The device structure. |
int adaq8092_set_alt_pol_en | ( | struct adaq8092_dev * | dev, |
enum adaq8092_alt_bit_pol | mode | ||
) |
Set the alternate bit polarity mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_clk_dc_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_clk_dutycycle | mode | ||
) |
Set the clock duty cycle stabilizer mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_clk_phase_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_clk_phase_delay | mode | ||
) |
Set the clock phase delay mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_clk_pol_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_clk_invert | mode | ||
) |
Set the clock polarity mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_data_rand_en | ( | struct adaq8092_dev * | dev, |
enum adaq8092_data_rand | mode | ||
) |
Set the data output randomizer mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_dout_en | ( | struct adaq8092_dev * | dev, |
enum adaq8092_dout_enable | mode | ||
) |
Set digital outputs.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_dout_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_dout_modes | mode | ||
) |
Set the digital output mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_lvds_cur_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_lvds_out_current | mode | ||
) |
Set the LVDS output current mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_lvds_term_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_internal_term | mode | ||
) |
Set the LVDS internal temination mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_pd_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_powerdown_modes | mode | ||
) |
Set the device powerodown mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_test_mode | ( | struct adaq8092_dev * | dev, |
enum adaq8092_out_test_modes | mode | ||
) |
Set digital output test pattern mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_set_twos_comp | ( | struct adaq8092_dev * | dev, |
enum adaq8092_twoscomp | mode | ||
) |
Set the Tows Complement mode.
dev | - The device structure. |
mode | - The device mode. |
int adaq8092_update_bits | ( | struct adaq8092_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | mask, | ||
uint8_t | reg_data | ||
) |
Update specific register bits.
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Specific bits mask. |
reg_data | - The data to be written. |
int adaq8092_write | ( | struct adaq8092_dev * | dev, |
uint8_t | reg_addr, | ||
uint8_t | reg_data | ||
) |
Write device register.
dev- | The device structure. |
reg_addr | - The register address. |
reg_data | - The data to be written. |