no-OS
Classes | Macros | Enumerations | Functions
ad717x.h File Reference

AD717X header file. Devices: AD7172-2, AD7172-4, AD7173-8, AD7175-2, AD7175-8, AD7176-2, AD7177-2, AD4111, AD4112, AD4114, AD4115. More...

#include <stdint.h>
#include "no_os_spi.h"
#include "no_os_util.h"
#include <stdbool.h>
Include dependency graph for ad717x.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  ad717x_analog_inputs
 
struct  ad717x_channel_setup
 
struct  ad717x_filtcon
 
struct  ad717x_channel_map
 
struct  ad717x_st_reg
 
struct  ad717x_dev
 
struct  ad717x_init_param
 

Macros

#define AD717x_MAX_SETUPS   8
 
#define AD717x_MAX_CHANNELS   16
 
#define AD717X_COMM_REG   0x00
 
#define AD717X_STATUS_REG   0x00
 
#define AD717X_ADCMODE_REG   0x01
 
#define AD717X_IFMODE_REG   0x02
 
#define AD717X_REGCHECK_REG   0x03
 
#define AD717X_DATA_REG   0x04
 
#define AD717X_GPIOCON_REG   0x06
 
#define AD717X_ID_REG   0x07
 
#define AD717X_CHMAP0_REG   0x10
 
#define AD717X_CHMAP1_REG   0x11
 
#define AD717X_CHMAP2_REG   0x12
 
#define AD717X_CHMAP3_REG   0x13
 
#define AD717X_CHMAP4_REG   0x14
 
#define AD717X_CHMAP5_REG   0x15
 
#define AD717X_CHMAP6_REG   0x16
 
#define AD717X_CHMAP7_REG   0x17
 
#define AD717X_CHMAP8_REG   0x18
 
#define AD717X_CHMAP9_REG   0x19
 
#define AD717X_CHMAP10_REG   0x1A
 
#define AD717X_CHMAP11_REG   0x1B
 
#define AD717X_CHMAP12_REG   0x1C
 
#define AD717X_CHMAP13_REG   0x1D
 
#define AD717X_CHMAP14_REG   0x1E
 
#define AD717X_CHMAP15_REG   0x1F
 
#define AD717X_SETUPCON0_REG   0x20
 
#define AD717X_SETUPCON1_REG   0x21
 
#define AD717X_SETUPCON2_REG   0x22
 
#define AD717X_SETUPCON3_REG   0x23
 
#define AD717X_SETUPCON4_REG   0x24
 
#define AD717X_SETUPCON5_REG   0x25
 
#define AD717X_SETUPCON6_REG   0x26
 
#define AD717X_SETUPCON7_REG   0x27
 
#define AD717X_FILTCON0_REG   0x28
 
#define AD717X_FILTCON1_REG   0x29
 
#define AD717X_FILTCON2_REG   0x2A
 
#define AD717X_FILTCON3_REG   0x2B
 
#define AD717X_FILTCON4_REG   0x2C
 
#define AD717X_FILTCON5_REG   0x2D
 
#define AD717X_FILTCON6_REG   0x2E
 
#define AD717X_FILTCON7_REG   0x2F
 
#define AD717X_OFFSET0_REG   0x30
 
#define AD717X_OFFSET1_REG   0x31
 
#define AD717X_OFFSET2_REG   0x32
 
#define AD717X_OFFSET3_REG   0x33
 
#define AD717X_OFFSET4_REG   0x34
 
#define AD717X_OFFSET5_REG   0x35
 
#define AD717X_OFFSET6_REG   0x36
 
#define AD717X_OFFSET7_REG   0x37
 
#define AD717X_GAIN0_REG   0x38
 
#define AD717X_GAIN1_REG   0x39
 
#define AD717X_GAIN2_REG   0x3A
 
#define AD717X_GAIN3_REG   0x3B
 
#define AD717X_GAIN4_REG   0x3C
 
#define AD717X_GAIN5_REG   0x3D
 
#define AD717X_GAIN6_REG   0x3E
 
#define AD717X_GAIN7_REG   0x3F
 
#define AD717X_COMM_REG_WEN   (0 << 7)
 
#define AD717X_COMM_REG_WR   (0 << 6)
 
#define AD717X_COMM_REG_RD   (1 << 6)
 
#define AD717X_COMM_REG_RA(x)   ((x) & 0x3F)
 
#define AD717X_STATUS_REG_RDY   (1 << 7)
 
#define AD717X_STATUS_REG_ADC_ERR   (1 << 6)
 
#define AD717X_STATUS_REG_CRC_ERR   (1 << 5)
 
#define AD717X_STATUS_REG_REG_ERR   (1 << 4)
 
#define AD717X_STATUS_REG_CH(x)   ((x) & 0x0F)
 
#define AD717X_ADCMODE_REG_REF_EN   (1 << 15)
 
#define AD717X_ADCMODE_SING_CYC   (1 << 13)
 
#define AD717X_ADCMODE_REG_DELAY(x)   (((x) & 0x7) << 8)
 
#define AD717X_ADCMODE_REG_MODE(x)   (((x) & 0x7) << 4)
 
#define AD717X_ADCMODE_REG_CLKSEL(x)   (((x) & 0x3) << 2)
 
#define AD717X_ADCMODE_REG_HIDE_DELAY   (1 << 14)
 
#define AD717X_IFMODE_REG_ALT_SYNC   (1 << 12)
 
#define AD717X_IFMODE_REG_IOSTRENGTH   (1 << 11)
 
#define AD717X_IFMODE_REG_DOUT_RESET   (1 << 8)
 
#define AD717X_IFMODE_REG_CONT_READ   (1 << 7)
 
#define AD717X_IFMODE_REG_DATA_STAT   (1 << 6)
 
#define AD717X_IFMODE_REG_REG_CHECK   (1 << 5)
 
#define AD717X_IFMODE_REG_XOR_EN   (0x01 << 2)
 
#define AD717X_IFMODE_REG_CRC_EN   (0x02 << 2)
 
#define AD717X_IFMODE_REG_XOR_STAT(x)   (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)
 
#define AD717X_IFMODE_REG_CRC_STAT(x)   (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)
 
#define AD717X_IFMODE_REG_DATA_WL16   (1 << 0)
 
#define AD717X_IFMODE_REG_HIDE_DELAY   (1 << 10)
 
#define AD717X_GPIOCON_REG_MUX_IO   (1 << 12)
 
#define AD717X_GPIOCON_REG_SYNC_EN   (1 << 11)
 
#define AD717X_GPIOCON_REG_ERR_EN(x)   (((x) & 0x3) << 9)
 
#define AD717X_GPIOCON_REG_ERR_DAT   (1 << 8)
 
#define AD717X_GPIOCON_REG_IP_EN1   (1 << 5)
 
#define AD717X_GPIOCON_REG_IP_EN0   (1 << 4)
 
#define AD717X_GPIOCON_REG_OP_EN1   (1 << 3)
 
#define AD717X_GPIOCON_REG_OP_EN0   (1 << 2)
 
#define AD717X_GPIOCON_REG_DATA1   (1 << 1)
 
#define AD717X_GPIOCON_REG_DATA0   (1 << 0)
 
#define AD717X_GPIOCON_REG_GP_DATA3   (1 << 7)
 
#define AD717X_GPIOCON_REG_GP_DATA2   (1 << 6)
 
#define AD717X_GPIOCON_REG_GP_DATA1   (1 << 1)
 
#define AD717X_GPIOCON_REG_GP_DATA0   (1 << 0)
 
#define AD717X_GPIOCON_REG_PDSW   (1 << 14)
 
#define AD717X_GPIOCON_REG_OP_EN2_3   (1 << 13)
 
#define AD4111_GPIOCON_REG_OP_EN0_1   (1 << 13)
 
#define AD4111_GPIOCON_REG_DATA1   (1 << 7)
 
#define AD4111_GPIOCON_REG_DATA0   (1 << 6)
 
#define AD4116_GPIOCON_REG_OP_EN2_3   (1 << 13)
 
#define AD4116_GPIOCON_REG_DATA3   (1 << 7)
 
#define AD4116_GPIOCON_REG_DATA2   (1 << 6)
 
#define AD4111_GPIOCON_REG_OW_EN   (1 << 12)
 
#define AD717X_CHMAP_REG_CH_EN   (1 << 15)
 
#define AD717X_CHMAP_REG_SETUP_SEL(x)   (((x) & 0x7) << 12)
 
#define AD717X_CHMAP_REG_AINPOS(x)   (((x) & 0x1F) << 5)
 
#define AD717X_CHMAP_REG_AINNEG(x)   (((x) & 0x1F) << 0)
 
#define AD4111_CHMAP_REG_INPUT(x)   (((x) & 0x3FF) << 0)
 
#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR   (1 << 12)
 
#define AD717X_SETUP_CONF_REG_REF_SEL(x)   (((x) & 0x3) << 4)
 
#define AD717X_SETUP_CONF_REG_REF_BUF(x)   (((x) & 0x3) << 10)
 
#define AD717X_SETUP_CONF_REG_AIN_BUF(x)   (((x) & 0x3) << 8)
 
#define AD717X_SETUP_CONF_REG_BURNOUT_EN   (1 << 7)
 
#define AD717X_SETUP_CONF_REG_BUFCHOPMAX   (1 << 6)
 
#define AD717X_SETUP_CONF_REG_REFBUF_P   (1 << 11)
 
#define AD717X_SETUP_CONF_REG_REFBUF_N   (1 << 10)
 
#define AD717X_SETUP_CONF_REG_AINBUF_P   (1 << 9)
 
#define AD717X_SETUP_CONF_REG_AINBUF_N   (1 << 8)
 
#define AD4111_SETUP_CONF_REG_REFPOS_BUF   (1 << 11)
 
#define AD4111_SETUP_CONF_REG_REFNEG_BUF   (1 << 10)
 
#define AD4111_SETUP_CONF_REG_AIN_BUF(x)   (((x) & 0x3) << 8)
 
#define AD4111_SETUP_CONF_REG_BUFCHOPMAX   (1 << 6)
 
#define AD717X_FILT_CONF_REG_SINC3_MAP   (1 << 15)
 
#define AD717X_FILT_CONF_REG_ENHFILTEN   (1 << 11)
 
#define AD717X_FILT_CONF_REG_ENHFILT(x)   (((x) & 0x7) << 8)
 
#define AD717X_FILT_CONF_REG_ORDER(x)   (((x) & 0x3) << 5)
 
#define AD717X_FILT_CONF_REG_ODR(x)   (((x) & 0x1F) << 0)
 
#define AD717X_ID_REG_MASK   0xFFF0
 
#define AD7172_2_ID_REG_VALUE   0x00D0
 
#define AD7172_4_ID_REG_VALUE   0x2050
 
#define AD7173_8_ID_REG_VALUE   0x30D0
 
#define AD7175_2_ID_REG_VALUE   0x0CD0
 
#define AD7175_8_ID_REG_VALUE   0x3CD0
 
#define AD7176_2_ID_REG_VALUE   0x0C90
 
#define AD7177_2_ID_REG_VALUE   0x4FD0
 
#define AD411X_ID_REG_VALUE   0x30D0
 
#define AD4114_5_ID_REG_VALUE   0x31D0
 
#define AD4116_ID_REG_VALUE   0x34D0
 
#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION   0x07 /* x8 + x2 + x + 1 */
 
#define AD717X_CONV_TIMEOUT   10000
 
#define AD717x_CHANNEL_INPUT_MASK   NO_OS_GENMASK(9,0)
 
#define AD717X_CHMAP_REG_SETUP_SEL_MSK   NO_OS_GENMASK(14,12)
 
#define AD717X_CHMAP_REG_AINPOS_MSK   NO_OS_GENMASK(9,5)
 
#define AD717X_CHMAP_REG_AINNEG_MSK   NO_OS_GENMASK(4,0)
 
#define AD717X_ADCMODE_REG_MODE_MSK   NO_OS_GENMASK(6,4)
 
#define AD717X_SETUP_CONF_REG_REF_SEL_MSK   NO_OS_GENMASK(5,4)
 
#define AD717x_ODR_MSK   NO_OS_GENMASK(4,0)
 

Enumerations

enum  ad717x_mode {
  CONTINUOUS,
  SINGLE,
  STANDBY,
  POWER_DOWN,
  INTERNAL_OFFSET_CALIB,
  INTERNAL_GAIN_CALIB,
  SYS_OFFSET_CALIB,
  SYS_GAIN_CALIB
}
 
enum  ad717x_reference_source {
  EXTERNAL_REF = 0x0,
  INTERNAL_REF = 0x2,
  AVDD_AVSS = 0x3
}
 
enum  ad717x_analog_input_pairs {
  VIN0_VIN1 = 0x1,
  VIN0_VINCOM = 0x10,
  VIN1_VIN0 = 0x20,
  VIN1_VINCOM = 0x30,
  VIN2_VIN3 = 0x43,
  VIN2_VINCOM = 0x50,
  VIN3_VIN2 = 0x63,
  VIN3_VINCOM = 0x70,
  VIN4_VIN5 = 0x85,
  VIN4_VINCOM = 0x90,
  VIN5_VIN4 = 0xA4,
  VIN5_VINCOM = 0xB0,
  VIN6_VIN7 = 0xC7,
  VIN6_VINCOM = 0xD0,
  VIN7_VIN6 = 0xE6,
  VIN7_VINCOM = 0xF0,
  IIN3P_IIN3M = 0x18B,
  IIN2P_IIN2M = 0x1AA,
  IIN1P_IIN1M = 0x1C9
}
 
enum  ad717x_analog_input {
  AIN0 = 0x0,
  AIN1 = 0x1,
  AIN2 = 0x2,
  AIN3 = 0x3,
  AIN4 = 0x4,
  TEMP_SENSOR_P = 0x11,
  TEMP_SENSOR_M = 0x12,
  AVDD_AVSS_P = 0x13,
  AVDD_AVSS_M = 0x14,
  REF_P = 0x15,
  REF_M = 0x16
}
 
enum  ad717x_device_type {
  ID_AD4111,
  ID_AD4112,
  ID_AD4114,
  ID_AD4115,
  ID_AD7172_2,
  ID_AD7172_4,
  ID_AD7173_8,
  ID_AD7175_2,
  ID_AD7175_8,
  ID_AD7176_2,
  ID_AD7177_2
}
 
enum  ad717x_enhfilt {
  sps27_db47_ms36p7 = 0x2,
  sps25_db62_ms40 = 0x3,
  sps20_db86_ms50 = 0x5,
  sps16p6_db82_ms60 = 0x6
}
 
enum  ad717x_order {
  sinc5_sinc1 = 0x0,
  sinc3 = 0x3
}
 
enum  ad717x_odr {
  sps_31250_a = 0x0,
  sps31250_b = 0x1,
  sps_31250_c = 0x2,
  sps_31250_d = 0x3,
  sps31250_e = 0x4,
  sps_31250_f = 0x5,
  sps_15625 = 0x6,
  sps_10417 = 0x7,
  sps_5208 = 0x8,
  sps_2957 = 0x9,
  sps_1007 = 0xA,
  sps_503 = 0xB,
  sps_381 = 0xC,
  sps_200 = 0xD,
  sps_100 = 0xE,
  sps_59 = 0xF,
  sps_49 = 0x10,
  sps_20 = 0x11,
  sps_16 = 0x12,
  sps_10 =0x13,
  sps_5 = 0x14,
  sps_2p5 = 0x15,
  sps_1p25 = 0x16
}
 
enum  ad717x_crc_mode {
  AD717X_DISABLE,
  AD717X_USE_CRC,
  AD717X_USE_XOR
}
 

Functions

ad717x_st_regAD717X_GetReg (ad717x_dev *device, uint8_t reg_address)
 Searches through the list of registers of the driver instance and retrieves a pointer to the register that matches the given address. More...
 
int32_t AD717X_ReadRegister (ad717x_dev *device, uint8_t addr)
 Reads the value of the specified register. More...
 
int32_t AD717X_WriteRegister (ad717x_dev *device, uint8_t)
 Writes the value of the specified register. More...
 
int32_t AD717X_Reset (ad717x_dev *device)
 Resets the device. More...
 
int32_t AD717X_WaitForReady (ad717x_dev *device, uint32_t timeout)
 Waits until a new conversion result is available. More...
 
int32_t AD717X_ReadData (ad717x_dev *device, int32_t *pData)
 Reads the conversion result from the device. More...
 
int32_t AD717X_ComputeDataregSize (ad717x_dev *device)
 Computes data register read size to account for bit number and status read. More...
 
uint8_t AD717X_ComputeCRC8 (uint8_t *pBuf, uint8_t bufSize)
 Computes the CRC checksum for a data buffer. More...
 
uint8_t AD717X_ComputeXOR8 (uint8_t *pBuf, uint8_t bufSize)
 Computes the XOR checksum for a data buffer. More...
 
int32_t AD717X_UpdateCRCSetting (ad717x_dev *device)
 Updates the CRC settings. More...
 
int32_t AD717X_Init (ad717x_dev **device, ad717x_init_param init_param)
 Initializes the AD717X. More...
 
int32_t AD717X_remove (ad717x_dev *dev)
 Free the resources allocated by AD717X_Init(). More...
 
int ad717x_set_channel_status (ad717x_dev *device, uint8_t channel_id, bool channel_status)
 Set channel status - Enable/Disable. More...
 
int ad717x_set_adc_mode (ad717x_dev *device, enum ad717x_mode mode)
 Set ADC Mode. More...
 
int ad717x_connect_analog_input (ad717x_dev *device, uint8_t channel_id, union ad717x_analog_inputs analog_input)
 Set Analog Inputs to channel. More...
 
int ad717x_assign_setup (ad717x_dev *device, uint8_t channel_id, uint8_t setup)
 Assign Setup to Channel. More...
 
int ad717x_set_polarity (ad717x_dev *device, bool bipolar, uint8_t setup_id)
 Set Polarity. More...
 
int ad717x_set_reference_source (ad717x_dev *device, enum ad717x_reference_source ref_source, uint8_t setup_id)
 Select the reference source. More...
 
int ad717x_enable_buffers (ad717x_dev *device, bool inbuf_en, bool refbuf_en, uint8_t setup_id)
 
int ad717x_single_read (ad717x_dev *device, uint8_t id, int32_t *adc_raw_data)
 Perform Single Conversion. More...
 
int32_t ad717x_configure_device_odr (ad717x_dev *dev, uint8_t filtcon_id, uint8_t odr_sel)
 Configure ODR for the device. More...
 

Detailed Description

AD717X header file. Devices: AD7172-2, AD7172-4, AD7173-8, AD7175-2, AD7175-8, AD7176-2, AD7177-2, AD4111, AD4112, AD4114, AD4115.

Author
acozma (andre.nosp@m.i.co.nosp@m.zma@a.nosp@m.nalo.nosp@m.g.com) dnechita (dan.n.nosp@m.echi.nosp@m.ta@an.nosp@m.alog.nosp@m..com)

Copyright 2015(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.

Macro Definition Documentation

◆ AD4111_CHMAP_REG_INPUT

#define AD4111_CHMAP_REG_INPUT (   x)    (((x) & 0x3FF) << 0)

◆ AD4111_GPIOCON_REG_DATA0

#define AD4111_GPIOCON_REG_DATA0   (1 << 6)

◆ AD4111_GPIOCON_REG_DATA1

#define AD4111_GPIOCON_REG_DATA1   (1 << 7)

◆ AD4111_GPIOCON_REG_OP_EN0_1

#define AD4111_GPIOCON_REG_OP_EN0_1   (1 << 13)

◆ AD4111_GPIOCON_REG_OW_EN

#define AD4111_GPIOCON_REG_OW_EN   (1 << 12)

◆ AD4111_SETUP_CONF_REG_AIN_BUF

#define AD4111_SETUP_CONF_REG_AIN_BUF (   x)    (((x) & 0x3) << 8)

◆ AD4111_SETUP_CONF_REG_BUFCHOPMAX

#define AD4111_SETUP_CONF_REG_BUFCHOPMAX   (1 << 6)

◆ AD4111_SETUP_CONF_REG_REFNEG_BUF

#define AD4111_SETUP_CONF_REG_REFNEG_BUF   (1 << 10)

◆ AD4111_SETUP_CONF_REG_REFPOS_BUF

#define AD4111_SETUP_CONF_REG_REFPOS_BUF   (1 << 11)

◆ AD4114_5_ID_REG_VALUE

#define AD4114_5_ID_REG_VALUE   0x31D0

◆ AD4116_GPIOCON_REG_DATA2

#define AD4116_GPIOCON_REG_DATA2   (1 << 6)

◆ AD4116_GPIOCON_REG_DATA3

#define AD4116_GPIOCON_REG_DATA3   (1 << 7)

◆ AD4116_GPIOCON_REG_OP_EN2_3

#define AD4116_GPIOCON_REG_OP_EN2_3   (1 << 13)

◆ AD4116_ID_REG_VALUE

#define AD4116_ID_REG_VALUE   0x34D0

◆ AD411X_ID_REG_VALUE

#define AD411X_ID_REG_VALUE   0x30D0

◆ AD7172_2_ID_REG_VALUE

#define AD7172_2_ID_REG_VALUE   0x00D0

◆ AD7172_4_ID_REG_VALUE

#define AD7172_4_ID_REG_VALUE   0x2050

◆ AD7173_8_ID_REG_VALUE

#define AD7173_8_ID_REG_VALUE   0x30D0

◆ AD7175_2_ID_REG_VALUE

#define AD7175_2_ID_REG_VALUE   0x0CD0

◆ AD7175_8_ID_REG_VALUE

#define AD7175_8_ID_REG_VALUE   0x3CD0

◆ AD7176_2_ID_REG_VALUE

#define AD7176_2_ID_REG_VALUE   0x0C90

◆ AD7177_2_ID_REG_VALUE

#define AD7177_2_ID_REG_VALUE   0x4FD0

◆ AD717X_ADCMODE_REG

#define AD717X_ADCMODE_REG   0x01

◆ AD717X_ADCMODE_REG_CLKSEL

#define AD717X_ADCMODE_REG_CLKSEL (   x)    (((x) & 0x3) << 2)

◆ AD717X_ADCMODE_REG_DELAY

#define AD717X_ADCMODE_REG_DELAY (   x)    (((x) & 0x7) << 8)

◆ AD717X_ADCMODE_REG_HIDE_DELAY

#define AD717X_ADCMODE_REG_HIDE_DELAY   (1 << 14)

◆ AD717X_ADCMODE_REG_MODE

#define AD717X_ADCMODE_REG_MODE (   x)    (((x) & 0x7) << 4)

◆ AD717X_ADCMODE_REG_MODE_MSK

#define AD717X_ADCMODE_REG_MODE_MSK   NO_OS_GENMASK(6,4)

◆ AD717X_ADCMODE_REG_REF_EN

#define AD717X_ADCMODE_REG_REF_EN   (1 << 15)

◆ AD717X_ADCMODE_SING_CYC

#define AD717X_ADCMODE_SING_CYC   (1 << 13)

◆ AD717x_CHANNEL_INPUT_MASK

#define AD717x_CHANNEL_INPUT_MASK   NO_OS_GENMASK(9,0)

◆ AD717X_CHMAP0_REG

#define AD717X_CHMAP0_REG   0x10

◆ AD717X_CHMAP10_REG

#define AD717X_CHMAP10_REG   0x1A

◆ AD717X_CHMAP11_REG

#define AD717X_CHMAP11_REG   0x1B

◆ AD717X_CHMAP12_REG

#define AD717X_CHMAP12_REG   0x1C

◆ AD717X_CHMAP13_REG

#define AD717X_CHMAP13_REG   0x1D

◆ AD717X_CHMAP14_REG

#define AD717X_CHMAP14_REG   0x1E

◆ AD717X_CHMAP15_REG

#define AD717X_CHMAP15_REG   0x1F

◆ AD717X_CHMAP1_REG

#define AD717X_CHMAP1_REG   0x11

◆ AD717X_CHMAP2_REG

#define AD717X_CHMAP2_REG   0x12

◆ AD717X_CHMAP3_REG

#define AD717X_CHMAP3_REG   0x13

◆ AD717X_CHMAP4_REG

#define AD717X_CHMAP4_REG   0x14

◆ AD717X_CHMAP5_REG

#define AD717X_CHMAP5_REG   0x15

◆ AD717X_CHMAP6_REG

#define AD717X_CHMAP6_REG   0x16

◆ AD717X_CHMAP7_REG

#define AD717X_CHMAP7_REG   0x17

◆ AD717X_CHMAP8_REG

#define AD717X_CHMAP8_REG   0x18

◆ AD717X_CHMAP9_REG

#define AD717X_CHMAP9_REG   0x19

◆ AD717X_CHMAP_REG_AINNEG

#define AD717X_CHMAP_REG_AINNEG (   x)    (((x) & 0x1F) << 0)

◆ AD717X_CHMAP_REG_AINNEG_MSK

#define AD717X_CHMAP_REG_AINNEG_MSK   NO_OS_GENMASK(4,0)

◆ AD717X_CHMAP_REG_AINPOS

#define AD717X_CHMAP_REG_AINPOS (   x)    (((x) & 0x1F) << 5)

◆ AD717X_CHMAP_REG_AINPOS_MSK

#define AD717X_CHMAP_REG_AINPOS_MSK   NO_OS_GENMASK(9,5)

◆ AD717X_CHMAP_REG_CH_EN

#define AD717X_CHMAP_REG_CH_EN   (1 << 15)

◆ AD717X_CHMAP_REG_SETUP_SEL

#define AD717X_CHMAP_REG_SETUP_SEL (   x)    (((x) & 0x7) << 12)

◆ AD717X_CHMAP_REG_SETUP_SEL_MSK

#define AD717X_CHMAP_REG_SETUP_SEL_MSK   NO_OS_GENMASK(14,12)

◆ AD717X_COMM_REG

#define AD717X_COMM_REG   0x00

◆ AD717X_COMM_REG_RA

#define AD717X_COMM_REG_RA (   x)    ((x) & 0x3F)

◆ AD717X_COMM_REG_RD

#define AD717X_COMM_REG_RD   (1 << 6)

◆ AD717X_COMM_REG_WEN

#define AD717X_COMM_REG_WEN   (0 << 7)

◆ AD717X_COMM_REG_WR

#define AD717X_COMM_REG_WR   (0 << 6)

◆ AD717X_CONV_TIMEOUT

#define AD717X_CONV_TIMEOUT   10000

◆ AD717X_CRC8_POLYNOMIAL_REPRESENTATION

#define AD717X_CRC8_POLYNOMIAL_REPRESENTATION   0x07 /* x8 + x2 + x + 1 */

◆ AD717X_DATA_REG

#define AD717X_DATA_REG   0x04

◆ AD717X_FILT_CONF_REG_ENHFILT

#define AD717X_FILT_CONF_REG_ENHFILT (   x)    (((x) & 0x7) << 8)

◆ AD717X_FILT_CONF_REG_ENHFILTEN

#define AD717X_FILT_CONF_REG_ENHFILTEN   (1 << 11)

◆ AD717X_FILT_CONF_REG_ODR

#define AD717X_FILT_CONF_REG_ODR (   x)    (((x) & 0x1F) << 0)

◆ AD717X_FILT_CONF_REG_ORDER

#define AD717X_FILT_CONF_REG_ORDER (   x)    (((x) & 0x3) << 5)

◆ AD717X_FILT_CONF_REG_SINC3_MAP

#define AD717X_FILT_CONF_REG_SINC3_MAP   (1 << 15)

◆ AD717X_FILTCON0_REG

#define AD717X_FILTCON0_REG   0x28

◆ AD717X_FILTCON1_REG

#define AD717X_FILTCON1_REG   0x29

◆ AD717X_FILTCON2_REG

#define AD717X_FILTCON2_REG   0x2A

◆ AD717X_FILTCON3_REG

#define AD717X_FILTCON3_REG   0x2B

◆ AD717X_FILTCON4_REG

#define AD717X_FILTCON4_REG   0x2C

◆ AD717X_FILTCON5_REG

#define AD717X_FILTCON5_REG   0x2D

◆ AD717X_FILTCON6_REG

#define AD717X_FILTCON6_REG   0x2E

◆ AD717X_FILTCON7_REG

#define AD717X_FILTCON7_REG   0x2F

◆ AD717X_GAIN0_REG

#define AD717X_GAIN0_REG   0x38

◆ AD717X_GAIN1_REG

#define AD717X_GAIN1_REG   0x39

◆ AD717X_GAIN2_REG

#define AD717X_GAIN2_REG   0x3A

◆ AD717X_GAIN3_REG

#define AD717X_GAIN3_REG   0x3B

◆ AD717X_GAIN4_REG

#define AD717X_GAIN4_REG   0x3C

◆ AD717X_GAIN5_REG

#define AD717X_GAIN5_REG   0x3D

◆ AD717X_GAIN6_REG

#define AD717X_GAIN6_REG   0x3E

◆ AD717X_GAIN7_REG

#define AD717X_GAIN7_REG   0x3F

◆ AD717X_GPIOCON_REG

#define AD717X_GPIOCON_REG   0x06

◆ AD717X_GPIOCON_REG_DATA0

#define AD717X_GPIOCON_REG_DATA0   (1 << 0)

◆ AD717X_GPIOCON_REG_DATA1

#define AD717X_GPIOCON_REG_DATA1   (1 << 1)

◆ AD717X_GPIOCON_REG_ERR_DAT

#define AD717X_GPIOCON_REG_ERR_DAT   (1 << 8)

◆ AD717X_GPIOCON_REG_ERR_EN

#define AD717X_GPIOCON_REG_ERR_EN (   x)    (((x) & 0x3) << 9)

◆ AD717X_GPIOCON_REG_GP_DATA0

#define AD717X_GPIOCON_REG_GP_DATA0   (1 << 0)

◆ AD717X_GPIOCON_REG_GP_DATA1

#define AD717X_GPIOCON_REG_GP_DATA1   (1 << 1)

◆ AD717X_GPIOCON_REG_GP_DATA2

#define AD717X_GPIOCON_REG_GP_DATA2   (1 << 6)

◆ AD717X_GPIOCON_REG_GP_DATA3

#define AD717X_GPIOCON_REG_GP_DATA3   (1 << 7)

◆ AD717X_GPIOCON_REG_IP_EN0

#define AD717X_GPIOCON_REG_IP_EN0   (1 << 4)

◆ AD717X_GPIOCON_REG_IP_EN1

#define AD717X_GPIOCON_REG_IP_EN1   (1 << 5)

◆ AD717X_GPIOCON_REG_MUX_IO

#define AD717X_GPIOCON_REG_MUX_IO   (1 << 12)

◆ AD717X_GPIOCON_REG_OP_EN0

#define AD717X_GPIOCON_REG_OP_EN0   (1 << 2)

◆ AD717X_GPIOCON_REG_OP_EN1

#define AD717X_GPIOCON_REG_OP_EN1   (1 << 3)

◆ AD717X_GPIOCON_REG_OP_EN2_3

#define AD717X_GPIOCON_REG_OP_EN2_3   (1 << 13)

◆ AD717X_GPIOCON_REG_PDSW

#define AD717X_GPIOCON_REG_PDSW   (1 << 14)

◆ AD717X_GPIOCON_REG_SYNC_EN

#define AD717X_GPIOCON_REG_SYNC_EN   (1 << 11)

◆ AD717X_ID_REG

#define AD717X_ID_REG   0x07

◆ AD717X_ID_REG_MASK

#define AD717X_ID_REG_MASK   0xFFF0

◆ AD717X_IFMODE_REG

#define AD717X_IFMODE_REG   0x02

◆ AD717X_IFMODE_REG_ALT_SYNC

#define AD717X_IFMODE_REG_ALT_SYNC   (1 << 12)

◆ AD717X_IFMODE_REG_CONT_READ

#define AD717X_IFMODE_REG_CONT_READ   (1 << 7)

◆ AD717X_IFMODE_REG_CRC_EN

#define AD717X_IFMODE_REG_CRC_EN   (0x02 << 2)

◆ AD717X_IFMODE_REG_CRC_STAT

#define AD717X_IFMODE_REG_CRC_STAT (   x)    (((x) & AD717X_IFMODE_REG_CRC_EN) == AD717X_IFMODE_REG_CRC_EN)

◆ AD717X_IFMODE_REG_DATA_STAT

#define AD717X_IFMODE_REG_DATA_STAT   (1 << 6)

◆ AD717X_IFMODE_REG_DATA_WL16

#define AD717X_IFMODE_REG_DATA_WL16   (1 << 0)

◆ AD717X_IFMODE_REG_DOUT_RESET

#define AD717X_IFMODE_REG_DOUT_RESET   (1 << 8)

◆ AD717X_IFMODE_REG_HIDE_DELAY

#define AD717X_IFMODE_REG_HIDE_DELAY   (1 << 10)

◆ AD717X_IFMODE_REG_IOSTRENGTH

#define AD717X_IFMODE_REG_IOSTRENGTH   (1 << 11)

◆ AD717X_IFMODE_REG_REG_CHECK

#define AD717X_IFMODE_REG_REG_CHECK   (1 << 5)

◆ AD717X_IFMODE_REG_XOR_EN

#define AD717X_IFMODE_REG_XOR_EN   (0x01 << 2)

◆ AD717X_IFMODE_REG_XOR_STAT

#define AD717X_IFMODE_REG_XOR_STAT (   x)    (((x) & AD717X_IFMODE_REG_XOR_EN) == AD717X_IFMODE_REG_XOR_EN)

◆ AD717x_MAX_CHANNELS

#define AD717x_MAX_CHANNELS   16

◆ AD717x_MAX_SETUPS

#define AD717x_MAX_SETUPS   8

◆ AD717x_ODR_MSK

#define AD717x_ODR_MSK   NO_OS_GENMASK(4,0)

◆ AD717X_OFFSET0_REG

#define AD717X_OFFSET0_REG   0x30

◆ AD717X_OFFSET1_REG

#define AD717X_OFFSET1_REG   0x31

◆ AD717X_OFFSET2_REG

#define AD717X_OFFSET2_REG   0x32

◆ AD717X_OFFSET3_REG

#define AD717X_OFFSET3_REG   0x33

◆ AD717X_OFFSET4_REG

#define AD717X_OFFSET4_REG   0x34

◆ AD717X_OFFSET5_REG

#define AD717X_OFFSET5_REG   0x35

◆ AD717X_OFFSET6_REG

#define AD717X_OFFSET6_REG   0x36

◆ AD717X_OFFSET7_REG

#define AD717X_OFFSET7_REG   0x37

◆ AD717X_REGCHECK_REG

#define AD717X_REGCHECK_REG   0x03

◆ AD717X_SETUP_CONF_REG_AIN_BUF

#define AD717X_SETUP_CONF_REG_AIN_BUF (   x)    (((x) & 0x3) << 8)

◆ AD717X_SETUP_CONF_REG_AINBUF_N

#define AD717X_SETUP_CONF_REG_AINBUF_N   (1 << 8)

◆ AD717X_SETUP_CONF_REG_AINBUF_P

#define AD717X_SETUP_CONF_REG_AINBUF_P   (1 << 9)

◆ AD717X_SETUP_CONF_REG_BI_UNIPOLAR

#define AD717X_SETUP_CONF_REG_BI_UNIPOLAR   (1 << 12)

◆ AD717X_SETUP_CONF_REG_BUFCHOPMAX

#define AD717X_SETUP_CONF_REG_BUFCHOPMAX   (1 << 6)

◆ AD717X_SETUP_CONF_REG_BURNOUT_EN

#define AD717X_SETUP_CONF_REG_BURNOUT_EN   (1 << 7)

◆ AD717X_SETUP_CONF_REG_REF_BUF

#define AD717X_SETUP_CONF_REG_REF_BUF (   x)    (((x) & 0x3) << 10)

◆ AD717X_SETUP_CONF_REG_REF_SEL

#define AD717X_SETUP_CONF_REG_REF_SEL (   x)    (((x) & 0x3) << 4)

◆ AD717X_SETUP_CONF_REG_REF_SEL_MSK

#define AD717X_SETUP_CONF_REG_REF_SEL_MSK   NO_OS_GENMASK(5,4)

◆ AD717X_SETUP_CONF_REG_REFBUF_N

#define AD717X_SETUP_CONF_REG_REFBUF_N   (1 << 10)

◆ AD717X_SETUP_CONF_REG_REFBUF_P

#define AD717X_SETUP_CONF_REG_REFBUF_P   (1 << 11)

◆ AD717X_SETUPCON0_REG

#define AD717X_SETUPCON0_REG   0x20

◆ AD717X_SETUPCON1_REG

#define AD717X_SETUPCON1_REG   0x21

◆ AD717X_SETUPCON2_REG

#define AD717X_SETUPCON2_REG   0x22

◆ AD717X_SETUPCON3_REG

#define AD717X_SETUPCON3_REG   0x23

◆ AD717X_SETUPCON4_REG

#define AD717X_SETUPCON4_REG   0x24

◆ AD717X_SETUPCON5_REG

#define AD717X_SETUPCON5_REG   0x25

◆ AD717X_SETUPCON6_REG

#define AD717X_SETUPCON6_REG   0x26

◆ AD717X_SETUPCON7_REG

#define AD717X_SETUPCON7_REG   0x27

◆ AD717X_STATUS_REG

#define AD717X_STATUS_REG   0x00

◆ AD717X_STATUS_REG_ADC_ERR

#define AD717X_STATUS_REG_ADC_ERR   (1 << 6)

◆ AD717X_STATUS_REG_CH

#define AD717X_STATUS_REG_CH (   x)    ((x) & 0x0F)

◆ AD717X_STATUS_REG_CRC_ERR

#define AD717X_STATUS_REG_CRC_ERR   (1 << 5)

◆ AD717X_STATUS_REG_RDY

#define AD717X_STATUS_REG_RDY   (1 << 7)

◆ AD717X_STATUS_REG_REG_ERR

#define AD717X_STATUS_REG_REG_ERR   (1 << 4)

Enumeration Type Documentation

◆ ad717x_analog_input

Enumerator
AIN0 
AIN1 
AIN2 
AIN3 
AIN4 
TEMP_SENSOR_P 
TEMP_SENSOR_M 
AVDD_AVSS_P 
AVDD_AVSS_M 
REF_P 
REF_M 

◆ ad717x_analog_input_pairs

Enumerator
VIN0_VIN1 
VIN0_VINCOM 
VIN1_VIN0 
VIN1_VINCOM 
VIN2_VIN3 
VIN2_VINCOM 
VIN3_VIN2 
VIN3_VINCOM 
VIN4_VIN5 
VIN4_VINCOM 
VIN5_VIN4 
VIN5_VINCOM 
VIN6_VIN7 
VIN6_VINCOM 
VIN7_VIN6 
VIN7_VINCOM 
IIN3P_IIN3M 
IIN2P_IIN2M 
IIN1P_IIN1M 

◆ ad717x_crc_mode

Enumerator
AD717X_DISABLE 
AD717X_USE_CRC 
AD717X_USE_XOR 

◆ ad717x_device_type

Enumerator
ID_AD4111 
ID_AD4112 
ID_AD4114 
ID_AD4115 
ID_AD7172_2 
ID_AD7172_4 
ID_AD7173_8 
ID_AD7175_2 
ID_AD7175_8 
ID_AD7176_2 
ID_AD7177_2 

◆ ad717x_enhfilt

Enumerator
sps27_db47_ms36p7 
sps25_db62_ms40 
sps20_db86_ms50 
sps16p6_db82_ms60 

◆ ad717x_mode

Enumerator
CONTINUOUS 
SINGLE 
STANDBY 
POWER_DOWN 
INTERNAL_OFFSET_CALIB 
INTERNAL_GAIN_CALIB 
SYS_OFFSET_CALIB 
SYS_GAIN_CALIB 

◆ ad717x_odr

enum ad717x_odr
Enumerator
sps_31250_a 
sps31250_b 
sps_31250_c 
sps_31250_d 
sps31250_e 
sps_31250_f 
sps_15625 
sps_10417 
sps_5208 
sps_2957 
sps_1007 
sps_503 
sps_381 
sps_200 
sps_100 
sps_59 
sps_49 
sps_20 
sps_16 
sps_10 
sps_5 
sps_2p5 
sps_1p25 

◆ ad717x_order

Enumerator
sinc5_sinc1 
sinc3 

◆ ad717x_reference_source

Enumerator
EXTERNAL_REF 
INTERNAL_REF 
AVDD_AVSS 

Function Documentation

◆ ad717x_assign_setup()

int ad717x_assign_setup ( ad717x_dev device,
uint8_t  channel_id,
uint8_t  setup 
)

Assign Setup to Channel.

Parameters
device- AD717x Device Descriptor
channel_id- Channel ID (number)
setup- Setup ID (number)
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ AD717X_ComputeCRC8()

uint8_t AD717X_ComputeCRC8 ( uint8_t *  pBuf,
uint8_t  bufSize 
)

Computes the CRC checksum for a data buffer.

Computes the CRC checksum for a data buffer.

Parameters
pBuf- Data buffer
bufSize- Data buffer size in bytes
Returns
Returns the computed CRC checksum.
Here is the caller graph for this function:

◆ AD717X_ComputeDataregSize()

int32_t AD717X_ComputeDataregSize ( ad717x_dev device)

Computes data register read size to account for bit number and status read.

Computes data register read size to account for bit number and status read.

Parameters
device- The handler of the instance of the driver.
Returns
0in case of success or negative code in case of failure.
Here is the caller graph for this function:

◆ AD717X_ComputeXOR8()

uint8_t AD717X_ComputeXOR8 ( uint8_t *  pBuf,
uint8_t  bufSize 
)

Computes the XOR checksum for a data buffer.

Computes the XOR checksum for a data buffer.

Parameters
pBuf- Data buffer
bufSize- Data buffer size in bytes
Returns
Returns the computed XOR checksum.
Here is the caller graph for this function:

◆ ad717x_configure_device_odr()

int32_t ad717x_configure_device_odr ( ad717x_dev dev,
uint8_t  filtcon_id,
uint8_t  odr_sel 
)

Configure ODR for the device.

Parameters
dev- The AD717x Device descriptor
filtcon_id- Filter Configuration Register ID (Number)
odr_sel- ODR[4:0] bitfield value as a decimal
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ ad717x_connect_analog_input()

int ad717x_connect_analog_input ( ad717x_dev device,
uint8_t  channel_id,
union ad717x_analog_inputs  analog_input 
)

Set Analog Inputs to channel.

Parameters
device- AD717x Device Descriptor
channel_id- Channel whose Analog input is to be configured
analog_input- Analog Inputs to the Channel
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ ad717x_enable_buffers()

int ad717x_enable_buffers ( ad717x_dev device,
bool  inbuf_en,
bool  refbuf_en,
uint8_t  setup_id 
)

◆ AD717X_GetReg()

ad717x_st_reg* AD717X_GetReg ( ad717x_dev device,
uint8_t  reg_address 
)

Searches through the list of registers of the driver instance and retrieves a pointer to the register that matches the given address.

Retrieves a pointer to the register that matches the given address

Parameters
device- The handler of the instance of the driver.
reg_address- The address to be used to find the register.
Returns
A pointer to the register if found or 0.
Here is the caller graph for this function:

◆ AD717X_Init()

int32_t AD717X_Init ( ad717x_dev **  device,
ad717x_init_param  init_param 
)

Initializes the AD717X.

Initializes the AD717X.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
Returns 0 for success or negative error code.

◆ AD717X_ReadData()

int32_t AD717X_ReadData ( ad717x_dev device,
int32_t *  pData 
)

Reads the conversion result from the device.

Reads the conversion result from the device.

Parameters
device- The handler of the instance of the driver.
pData- Pointer to store the read data.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function:

◆ AD717X_ReadRegister()

int32_t AD717X_ReadRegister ( ad717x_dev device,
uint8_t  addr 
)

Reads the value of the specified register.

Reads the value of the specified register.

Parameters
device- The handler of the instance of the driver.
addr- The address of the register to be read. The value will be stored inside the register structure that holds info about this register.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function:

◆ AD717X_remove()

int32_t AD717X_remove ( ad717x_dev dev)

Free the resources allocated by AD717X_Init().

Free the resources allocated by AD717X_Init().

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

◆ AD717X_Reset()

int32_t AD717X_Reset ( ad717x_dev device)

Resets the device.

Resets the device.

Parameters
device- The handler of the instance of the driver.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function:

◆ ad717x_set_adc_mode()

int ad717x_set_adc_mode ( ad717x_dev device,
enum ad717x_mode  adc_mode 
)

Set ADC Mode.

Parameters
device- AD717x Device Descriptor
adc_mode- ADC Mode to be configured
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ ad717x_set_channel_status()

int ad717x_set_channel_status ( ad717x_dev device,
uint8_t  channel_id,
bool  channel_status 
)

Set channel status - Enable/Disable.

Parameters
device- AD717x Device descriptor.
channel_id- Channel ID (number) of the channel whose status is to be set.
channel_status- Required status of the channel-True in case of Enable and False in case of Disable
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ ad717x_set_polarity()

int ad717x_set_polarity ( ad717x_dev device,
bool  bipolar,
uint8_t  setup_id 
)

Set Polarity.

Parameters
device- AD717x Device Descriptor
bipolar- Polarity Select:True in case of Bipolar, False in case of Unipolar
setup_id- Setup ID (number)
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ ad717x_set_reference_source()

int ad717x_set_reference_source ( ad717x_dev device,
enum ad717x_reference_source  ref_source,
uint8_t  setup_id 
)

Select the reference source.

Parameters
device- AD717x Device Descriptor
ref_source- Reference source
setup_id- Setup ID (Number)
Returns
Returns 0 for success or negative error code in case of failure.
Here is the caller graph for this function:

◆ ad717x_single_read()

int ad717x_single_read ( ad717x_dev device,
uint8_t  id,
int32_t *  adc_raw_data 
)

Perform Single Conversion.

Parameters
device- AD717x Device Descriptor
id- Channel ID (number) requested
adc_raw_dataADC Raw Value
Returns
Returns 0 for success or negative error code in case of failure.

◆ AD717X_UpdateCRCSetting()

int32_t AD717X_UpdateCRCSetting ( ad717x_dev device)

Updates the CRC settings.

Updates the CRC settings.

Parameters
device- The handler of the instance of the driver.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function:

◆ AD717X_WaitForReady()

int32_t AD717X_WaitForReady ( ad717x_dev device,
uint32_t  timeout 
)

Waits until a new conversion result is available.

Waits until a new conversion result is available.

Parameters
device- The handler of the instance of the driver.
timeout- Count representing the number of polls to be done until the function returns if no new data is available.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function:

◆ AD717X_WriteRegister()

int32_t AD717X_WriteRegister ( ad717x_dev device,
uint8_t  addr 
)

Writes the value of the specified register.

Writes the value of the specified register.

Parameters
device- The handler of the instance of the driver.
addr- The address of the register to be written with the value stored inside the register structure that holds info about this register.
Returns
Returns 0 for success or negative error code.
Here is the caller graph for this function: