no-OS
Functions
adaq8092.c File Reference

Implementation of ADAQ8092 Driver. More...

#include <stdlib.h>
#include <errno.h>
#include "adaq8092.h"
#include "no_os_delay.h"
Include dependency graph for adaq8092.c:

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...
 

Detailed Description

Implementation of ADAQ8092 Driver.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2022(c) Analog Devices, Inc.

All rights reserved.

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 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

Function Documentation

◆ adaq8092_get_alt_pol_en()

enum adaq8092_alt_bit_pol adaq8092_get_alt_pol_en ( struct adaq8092_dev dev)

Get the alternate bit polarity mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_clk_dc_mode()

enum adaq8092_clk_dutycycle adaq8092_get_clk_dc_mode ( struct adaq8092_dev dev)

Get the clock duty cycle stabilizer mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_clk_phase_mode()

enum adaq8092_clk_phase_delay adaq8092_get_clk_phase_mode ( struct adaq8092_dev dev)

Get the clock phase delay mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_clk_pol_mode()

enum adaq8092_clk_invert adaq8092_get_clk_pol_mode ( struct adaq8092_dev dev)

Get the clock polarity mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_data_rand_en()

enum adaq8092_data_rand adaq8092_get_data_rand_en ( struct adaq8092_dev dev)

Get the data output randomizer mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_dout_en()

enum adaq8092_dout_enable adaq8092_get_dout_en ( struct adaq8092_dev dev)

Get digital outputs.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_dout_mode()

enum adaq8092_dout_modes adaq8092_get_dout_mode ( struct adaq8092_dev dev)

Get the digital output mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_lvds_cur_mode()

enum adaq8092_lvds_out_current adaq8092_get_lvds_cur_mode ( struct adaq8092_dev dev)

Get the LVDS output current mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_lvds_term_mode()

enum adaq8092_internal_term adaq8092_get_lvds_term_mode ( struct adaq8092_dev dev)

Get the LVDS internal temination device mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_pd_mode()

enum adaq8092_powerdown_modes adaq8092_get_pd_mode ( struct adaq8092_dev dev)

Get the device powerdown mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_test_mode()

enum adaq8092_out_test_modes adaq8092_get_test_mode ( struct adaq8092_dev dev)

Get digital output test pattern mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_get_twos_comp()

enum adaq8092_twoscomp adaq8092_get_twos_comp ( struct adaq8092_dev dev)

Get the Tows Complement mode.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_init()

int adaq8092_init ( struct adaq8092_dev **  device,
struct adaq8092_init_param  init_param 
)

Initialize the device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_read()

int adaq8092_read ( struct adaq8092_dev dev,
uint8_t  reg_addr,
uint8_t *  reg_data 
)

Read device register.

Parameters
dev- The device structure.
reg_addr- The register address.
reg_data- The data read from the register.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_remove()

int adaq8092_remove ( struct adaq8092_dev dev)

Remove the device and release resources.

Parameters
dev- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ adaq8092_set_alt_pol_en()

int adaq8092_set_alt_pol_en ( struct adaq8092_dev dev,
enum adaq8092_alt_bit_pol  mode 
)

Set the alternate bit polarity mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_clk_dc_mode()

int adaq8092_set_clk_dc_mode ( struct adaq8092_dev dev,
enum adaq8092_clk_dutycycle  mode 
)

Set the clock duty cycle stabilizer mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_clk_phase_mode()

int adaq8092_set_clk_phase_mode ( struct adaq8092_dev dev,
enum adaq8092_clk_phase_delay  mode 
)

Set the clock phase delay mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_clk_pol_mode()

int adaq8092_set_clk_pol_mode ( struct adaq8092_dev dev,
enum adaq8092_clk_invert  mode 
)

Set the clock polarity mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_data_rand_en()

int adaq8092_set_data_rand_en ( struct adaq8092_dev dev,
enum adaq8092_data_rand  mode 
)

Set the data output randomizer mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_dout_en()

int adaq8092_set_dout_en ( struct adaq8092_dev dev,
enum adaq8092_dout_enable  mode 
)

Set digital outputs.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_dout_mode()

int adaq8092_set_dout_mode ( struct adaq8092_dev dev,
enum adaq8092_dout_modes  mode 
)

Set the digital output mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_lvds_cur_mode()

int adaq8092_set_lvds_cur_mode ( struct adaq8092_dev dev,
enum adaq8092_lvds_out_current  mode 
)

Set the LVDS output current mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_lvds_term_mode()

int adaq8092_set_lvds_term_mode ( struct adaq8092_dev dev,
enum adaq8092_internal_term  mode 
)

Set the LVDS internal temination mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_pd_mode()

int adaq8092_set_pd_mode ( struct adaq8092_dev dev,
enum adaq8092_powerdown_modes  mode 
)

Set the device powerodown mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_test_mode()

int adaq8092_set_test_mode ( struct adaq8092_dev dev,
enum adaq8092_out_test_modes  mode 
)

Set digital output test pattern mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_set_twos_comp()

int adaq8092_set_twos_comp ( struct adaq8092_dev dev,
enum adaq8092_twoscomp  mode 
)

Set the Tows Complement mode.

Parameters
dev- The device structure.
mode- The device mode.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_update_bits()

int adaq8092_update_bits ( struct adaq8092_dev dev,
uint8_t  reg_addr,
uint8_t  mask,
uint8_t  reg_data 
)

Update specific register bits.

Parameters
dev- The device structure.
reg_addr- The register address.
mask- Specific bits mask.
reg_data- The data to be written.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ adaq8092_write()

int adaq8092_write ( struct adaq8092_dev dev,
uint8_t  reg_addr,
uint8_t  reg_data 
)

Write device register.

Parameters
dev-The device structure.
reg_addr- The register address.
reg_data- The data to be written.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function: