Manuel Caballero / ADS111X
Embed: (wiki syntax)

« Back to documentation index

ADS111X Class Reference

ADS111X Class Reference

Example: More...

#include <ADS111X.h>

Public Types

enum  ADS111X_addresses_t { ADS111X_ADDRESS_GND = ( 0b1001000 << 1U ), ADS111X_ADDRESS_VDD = ( 0b1001001 << 1U ), ADS111X_ADDRESS_SDA = ( 0b1001010 << 1U ), ADS111X_ADDRESS_SCL = ( 0b1001011 << 1U ) }
 

DEFAULT ADDRESSES.

More...
enum  ADS111X_register_map_t {
  ADS111X_CONVERSION = 0x00, ADS111X_CONFIG = 0x01, ADS111X_LO_THRESH = 0x02, ADS111X_HI_THRESH = 0x03,
  ADS111X_RESET_COMMAND = 0x06
}
 

REGISTER MAP.

More...
enum  ADS111X_device_t { DEVICE_ADS1113 = 0x00, DEVICE_ADS1114 = 0x01, DEVICE_ADS1115 = 0x02 }
 

DEVICE.

More...
enum  ADS111X_config_os_t { CONFIG_OS_MASK = ( 1U << 15U ), CONFIG_OS_BUSY = ( 1U << 15U ), CONFIG_OS_NOT_BUSY = ( 0U << 15U ) }
 

CONFIG REGISTER.

More...
enum  ADS111X_config_mux_t {
  CONFIG_MUX_MASK = ( 0b111 << 12U ), CONFIG_MUX_AINP_AIN0_AND_AINN_AIN1 = ( 0b000 << 12U ), CONFIG_MUX_AINP_AIN0_AND_AINN_AIN3 = ( 0b001 << 12U ), CONFIG_MUX_AINP_AIN1_AND_AINN_AIN3 = ( 0b010 << 12U ),
  CONFIG_MUX_AINP_AIN2_AND_AINN_AIN3 = ( 0b011 << 12U ), CONFIG_MUX_AINP_AIN0_AND_AINN_GND = ( 0b100 << 12U ), CONFIG_MUX_AINP_AIN1_AND_AINN_GND = ( 0b101 << 12U ), CONFIG_MUX_AINP_AIN2_AND_AINN_GND = ( 0b110 << 12U ),
  CONFIG_MUX_AINP_AIN3_AND_AINN_GND = ( 0b111 << 12U )
}
enum  ADS111X_config_pga_t {
  CONFIG_PGA_MASK = ( 0b111 << 9U ), CONFIG_PGA_FSR_6_144_V = ( 0b000 << 9U ), CONFIG_PGA_FSR_4_096_V = ( 0b001 << 9U ), CONFIG_PGA_FSR_2_048_V = ( 0b010 << 9U ),
  CONFIG_PGA_FSR_1_024_V = ( 0b011 << 9U ), CONFIG_PGA_FSR_0_512_V = ( 0b100 << 9U ), CONFIG_PGA_FSR_0_256_V = ( 0b101 << 9U )
}
enum  ADS111X_config_mode_t { CONFIG_MODE_MASK = ( 1U << 8U ), CONFIG_MODE_CONTINUOUS_CONVERSION = ( 0U << 8U ), CONFIG_MODE_SINGLE_SHOT = ( 1U << 8U ) }
enum  ADS111X_config_dr_t {
  CONFIG_DR_MASK = ( 0b111 << 5U ), CONFIG_DR_8_SPS = ( 0b000 << 5U ), CONFIG_DR_16_SPS = ( 0b001 << 5U ), CONFIG_DR_32_SPS = ( 0b010 << 5U ),
  CONFIG_DR_64_SPS = ( 0b011 << 5U ), CONFIG_DR_128_SPS = ( 0b100 << 5U ), CONFIG_DR_250_SPS = ( 0b101 << 5U ), CONFIG_DR_475_SPS = ( 0b110 << 5U ),
  CONFIG_DR_860_SPS = ( 0b111 << 5U )
}
enum  ADS111X_config_comp_mode_t { CONFIG_COMP_MODE_MASK = ( 1U << 4U ), CONFIG_COMP_MODE_TRADITIONAL_COMPARATOR = ( 0U << 4U ), CONFIG_COMP_MODE_WINDOW_COMPARATOR = ( 1U << 4U ) }
enum  ADS111X_config_comp_pol_t { CONFIG_COMP_POL_MASK = ( 1U << 3U ), CONFIG_COMP_POL_ACTIVE_LOW = ( 0U << 3U ), CONFIG_COMP_POL_ACTIVE_HIGH = ( 1U << 3U ) }
enum  ADS111X_config_comp_lat_t { CONFIG_COMP_LAT_MASK = ( 1U << 2U ), CONFIG_COMP_LAT_NONLATCHING_COMPARATOR = ( 0U << 2U ), CONFIG_COMP_LAT_LATCHING_COMPARATOR = ( 1U << 2U ) }
enum  ADS111X_config_comp_que_t {
  CONFIG_COMP_QUE_MASK = ( 0b11 << 0U ), CONFIG_COMP_QUE_ASSERT_AFTER_ONE_CONVERSION = ( 0b00 << 0U ), CONFIG_COMP_QUE_ASSERT_AFTER_TWO_CONVERSION = ( 0b01 << 0U ), CONFIG_COMP_QUE_ASSERT_AFTER_FOUR_CONVERSION = ( 0b10 << 0U ),
  CONFIG_COMP_QUE_DISABLED = ( 0b11 << 0U )
}
enum  ADS111X_lo_thresh_t { LO_THRESH_MASK = 0xFFFF }
 

LO_THRESH REGISTER.

More...
enum  ADS111X_hi_thresh_t { HI_THRESH_MASK = 0xFFFF }
 

HI_THRESH REGISTER.

More...
enum  ADS111X_status_t {
  ADS111X_SUCCESS = 0U, ADS111X_FAILURE = 1U, ADS111X_DEVICE_NOT_SUPPORTED = 2U, ADS111X_VALUE_OUT_OF_RANGE = 3U,
  ADS111X_DATA_CORRUPTED = 4U, I2C_SUCCESS = 0U
}
 

INTERNAL CONSTANTS.

More...

Public Member Functions

 ADS111X (PinName sda, PinName scl, uint32_t addr, uint32_t freq, ADS111X_device_t device)
 Create an ADS111X object connected to the specified I2C pins.
 ~ADS111X ()
 Delete ADS111X object.
ADS111X_status_t ADS111X_SoftReset (void)
 It triggers a softreset.
ADS111X_status_t ADS111X_GetRawConversion (ADS111X_conversion_t *myRawD)
 It gets the raw conversion value.
ADS111X_status_t ADS111X_GetConversion (ADS111X_data_t *myD)
 It gets the conversion value.
ADS111X_status_t ADS111X_StartSingleConversion (void)
 It starts a new single conversion.
ADS111X_status_t ADS111X_GetOS (ADS111X_config_t *myADS111X)
 It checks if the device is not currently performing a conversion.
ADS111X_status_t ADS111X_SetMux (ADS111X_data_t myADS111X)
 It sets input multiplexer configuration ( ADS1015 only ).
ADS111X_status_t ADS111X_GetMux (ADS111X_data_t *myADS111X)
 It gets input multiplexer configuration ( ADS1015 only ).
ADS111X_status_t ADS111X_SetGain (ADS111X_data_t myPGA)
 It sets programmable gain amplifier ( not ADS1013 ).
ADS111X_status_t ADS111X_GetGain (ADS111X_data_t *myPGA)
 It gets programmable gain amplifier ( not ADS1013 ).
ADS111X_status_t ADS111X_SetMode (ADS111X_config_t myMode)
 It sets the device operating mode.
ADS111X_status_t ADS111X_GetMode (ADS111X_config_t *myMode)
 It gets the device operating mode.
ADS111X_status_t ADS111X_SetDataRate (ADS111X_config_t myDR)
 It sets the data rate.
ADS111X_status_t ADS111X_GetDataRate (ADS111X_config_t *myDR)
 It gets the data rate.
ADS111X_status_t ADS111X_SetComparator (ADS111X_data_t myCOMP)
 It sets the comparator configuration.
ADS111X_status_t ADS111X_GetComparator (ADS111X_data_t *myCOMP)
 It gets the comparator configuration.
ADS111X_status_t ADS111X_SetLowThresholdValue (ADS111X_thresh_t myLoThres)
 It sets the low threshold value.
ADS111X_status_t ADS111X_GetLowThresholdValue (ADS111X_thresh_t *myLoThres)
 It gets the low threshold value.
ADS111X_status_t ADS111X_SetHighThresholdValue (ADS111X_thresh_t myHiThres)
 It sets the high threshold value.
ADS111X_status_t ADS111X_GetHighThresholdValue (ADS111X_thresh_t *myHiThres)
 It gets the high threshold value.

Detailed Description

Example:

#include "mbed.h"
#include "ADS111X.h"

ADS111X myADS111X ( I2C_SDA, I2C_SCL, ADS111X::ADS111X_ADDRESS_GND , 100000, ADS111X::DEVICE_ADS1115  );   // I2C_SDA | I2C_SCL | DEVICE_ADS1115
Serial pc         ( USBTX, USBRX );                                             // tx, rx

DigitalOut  myled   ( LED1 );
Ticker      newAction;


//@brief Constants.


//@brief Variables.
volatile uint32_t myState;                                                      // State that indicates when to perform a new sample


//@brief   FUNCTION PROTOTYPES
void    changeDATA     ( void );


//@brief FUNCTION FOR APPLICATION MAIN ENTRY.
int main()
{
    ADS111X::ADS111X_status_t aux;
    ADS111X::ADS111X_data_t   myADS111X_Data;

    pc.baud ( 115200 );

    myled   =   1;
    wait(3);
    myled   =   0;

    // Perform a softreset
    aux  =   myADS111X.ADS111X_SoftReset  ();
    wait_ms ( 500U );

    // Input multiplexor configuration ( channels ): AINp = AIN0 | AINn = GND
    myADS111X_Data.config.mux  =   ADS111X::CONFIG_MUX_AINP_AIN0_AND_AINN_GND ;
    aux  =   myADS111X.ADS111X_SetMux  ( myADS111X_Data );

    // Gain: ±4.096V
    myADS111X_Data.config.pga  =   ADS111X::CONFIG_PGA_FSR_4_096_V ;
    aux  =   myADS111X.ADS111X_SetGain  ( myADS111X_Data );

    // Mode: Single-shot
    myADS111X_Data.config.mode  =   ADS111X::CONFIG_MODE_SINGLE_SHOT ;
    aux  =   myADS111X.ADS111X_SetMode  ( myADS111X_Data.config );

    // Data rate: 1600 SPS
    myADS111X_Data.config.dr  =   ADS111X::CONFIG_DR_128_SPS ;
    aux  =   myADS111X.ADS111X_SetDataRate  ( myADS111X_Data.config );

    // Comparator: Disabled
    myADS111X_Data.config.comp_que  =   ADS111X::CONFIG_COMP_QUE_DISABLED ;
    aux  =   myADS111X.ADS111X_SetComparator  ( myADS111X_Data );

    myState  =   0UL;                                                           // Reset the variable
    newAction.attach( &changeDATA, 1U );                                        // the address of the function to be attached ( changeDATA ) and the interval ( 1s )

    // Let the callbacks take care of everything
    while(1) {
        sleep();

        if ( myState == 1UL ) {
            myled = 1U;

            // Trigger a new conversion
            aux  =   myADS111X.ADS111X_StartSingleConversion ();

            // Wait until the conversion is completed
            do {
                aux  =   myADS111X.ADS111X_GetOS ( &myADS111X_Data.config );
            } while( ( myADS111X_Data.config.os & ADS111X::CONFIG_OS_MASK  ) == ADS111X::CONFIG_OS_BUSY  );  // [TODO] Too dangerous! the uC may get stuck here
            // [WORKAROUND] Insert a counter.
            // Get the result
            aux  =   myADS111X.ADS111X_GetConversion ( &myADS111X_Data );

            // Send data through the UART
            pc.printf ( "V: %d mV\r\n", (int32_t)( 1000 * myADS111X_Data.conversion.conversion ) );


            // Reset the variables
            myState  =   0UL;
            myled    =   0U;
        }
    }
}


// @brief       changeDATA ( void  )
//
// @details     It changes myState variable
//
// @param[in]    N/A
//
// @param[out]   N/A.
//
// @return       N/A.
//
// @author      Manuel Caballero
// @date        18/June/2020
// @version     18/June/2020   The ORIGIN
// @pre         N/A
// @warning     N/A.
void changeDATA ( void )
{
    myState  =   1UL;
}

Library for the ADS111X Ultra-Small, Low-Power, I2C-Compatible, 860-SPS, 16-Bit ADCs With Internal Reference, Oscillator, and Programmable Comparator.

Definition at line 141 of file ADS111X.h.


Member Enumeration Documentation

DEFAULT ADDRESSES.

Enumerator:
ADS111X_ADDRESS_GND 

I2C slave address byte, ADDR = GND

ADS111X_ADDRESS_VDD 

I2C slave address byte, ADDR = VDD

ADS111X_ADDRESS_SDA 

I2C slave address byte, ADDR = SDA

ADS111X_ADDRESS_SCL 

I2C slave address byte, ADDR = SCL

Definition at line 147 of file ADS111X.h.

Enumerator:
CONFIG_COMP_LAT_MASK 

COMP_LAT mask

CONFIG_COMP_LAT_NONLATCHING_COMPARATOR 

Nonlatching comparator [ Default ]

CONFIG_COMP_LAT_LATCHING_COMPARATOR 

Latching comparator

Definition at line 275 of file ADS111X.h.

Enumerator:
CONFIG_COMP_MODE_MASK 

COMP_MODE mask

CONFIG_COMP_MODE_TRADITIONAL_COMPARATOR 

Traditional comparator [ Default ]

CONFIG_COMP_MODE_WINDOW_COMPARATOR 

Window comparator

Definition at line 255 of file ADS111X.h.

Enumerator:
CONFIG_COMP_POL_MASK 

COMP_POL mask

CONFIG_COMP_POL_ACTIVE_LOW 

Active low [ Default ]

CONFIG_COMP_POL_ACTIVE_HIGH 

Active high

Definition at line 265 of file ADS111X.h.

Enumerator:
CONFIG_COMP_QUE_MASK 

COMP_QUE mask

CONFIG_COMP_QUE_ASSERT_AFTER_ONE_CONVERSION 

Assert after one conversion

CONFIG_COMP_QUE_ASSERT_AFTER_TWO_CONVERSION 

Assert after two conversions

CONFIG_COMP_QUE_ASSERT_AFTER_FOUR_CONVERSION 

Assert after four conversions

CONFIG_COMP_QUE_DISABLED 

Disable comparator and set ALERT/RDY pin to high-impedance [ Default ]

Definition at line 285 of file ADS111X.h.

Enumerator:
CONFIG_DR_MASK 

DR mask

CONFIG_DR_8_SPS 

8 SPS

CONFIG_DR_16_SPS 

16 SPS

CONFIG_DR_32_SPS 

32 SPS

CONFIG_DR_64_SPS 

64 SPS

CONFIG_DR_128_SPS 

128 SPS [ Default ]

CONFIG_DR_250_SPS 

250 SPS

CONFIG_DR_475_SPS 

475 SPS

CONFIG_DR_860_SPS 

860 SPS

Definition at line 239 of file ADS111X.h.

Enumerator:
CONFIG_MODE_MASK 

MODE mask

CONFIG_MODE_CONTINUOUS_CONVERSION 

Continuous-conversion mode

CONFIG_MODE_SINGLE_SHOT 

Single-shot mode or power-down state [ Default ]

Definition at line 229 of file ADS111X.h.

Enumerator:
CONFIG_MUX_MASK 

MUX mask

CONFIG_MUX_AINP_AIN0_AND_AINN_AIN1 

AINP = AIN0 and AINN = AIN1 [ Default ]

CONFIG_MUX_AINP_AIN0_AND_AINN_AIN3 

AINP = AIN0 and AINN = AIN3

CONFIG_MUX_AINP_AIN1_AND_AINN_AIN3 

AINP = AIN1 and AINN = AIN3

CONFIG_MUX_AINP_AIN2_AND_AINN_AIN3 

AINP = AIN2 and AINN = AIN3

CONFIG_MUX_AINP_AIN0_AND_AINN_GND 

AINP = AIN0 and AINN = GND

CONFIG_MUX_AINP_AIN1_AND_AINN_GND 

AINP = AIN1 and AINN = GND

CONFIG_MUX_AINP_AIN2_AND_AINN_GND 

AINP = AIN2 and AINN = GND

CONFIG_MUX_AINP_AIN3_AND_AINN_GND 

AINP = AIN3 and AINN = GND

Definition at line 199 of file ADS111X.h.

CONFIG REGISTER.

( Default: 0x8583 ) NOTE: The 16-bit Config register is used to control the operating mode, input selection, data rate, full-scale range, and comparator modes.

Enumerator:
CONFIG_OS_MASK 

OS mask

CONFIG_OS_BUSY 

Device is not currently performing a conversion/Start a single conversion (when in power-down state) [Default]

CONFIG_OS_NOT_BUSY 

Device is currently performing a conversion

Definition at line 189 of file ADS111X.h.

Enumerator:
CONFIG_PGA_MASK 

PGA mask

CONFIG_PGA_FSR_6_144_V 

FSR = ±6.144 V

CONFIG_PGA_FSR_4_096_V 

FSR = ±4.096 V

CONFIG_PGA_FSR_2_048_V 

FSR = ±2.048 V [ Default ]

CONFIG_PGA_FSR_1_024_V 

FSR = ±1.024 V

CONFIG_PGA_FSR_0_512_V 

FSR = ±0.512 V

CONFIG_PGA_FSR_0_256_V 

FSR = ±0.256 V

Definition at line 215 of file ADS111X.h.

DEVICE.

NOTE: The user MUST define which device to use: ADS1013, ADS1014 or ADS1015.

Enumerator:
DEVICE_ADS1113 

Device: ADS1113

DEVICE_ADS1114 

Device: ADS1114

DEVICE_ADS1115 

Device: ADS1115

Definition at line 173 of file ADS111X.h.

HI_THRESH REGISTER.

( Default: 0x7FFF )

Enumerator:
HI_THRESH_MASK 

HI_THRESH mask

Definition at line 313 of file ADS111X.h.

LO_THRESH REGISTER.

( Default: 0x8000 )

Enumerator:
LO_THRESH_MASK 

LO_THRESH mask

Definition at line 301 of file ADS111X.h.

REGISTER MAP.

Enumerator:
ADS111X_CONVERSION 

Conversion register

ADS111X_CONFIG 

Config register

ADS111X_LO_THRESH 

Lo threshold register

ADS111X_HI_THRESH 

Hi threshold register

ADS111X_RESET_COMMAND 

Reset command ( with a general call )

Definition at line 159 of file ADS111X.h.

INTERNAL CONSTANTS.

Enumerator:
ADS111X_SUCCESS 

I2C communication success

ADS111X_FAILURE 

I2C communication failure

ADS111X_DEVICE_NOT_SUPPORTED 

Device not supported

ADS111X_VALUE_OUT_OF_RANGE 

Value aout of range

ADS111X_DATA_CORRUPTED 

D and lo/hi threshold data

I2C_SUCCESS 

I2C communication was fine

Definition at line 369 of file ADS111X.h.


Constructor & Destructor Documentation

ADS111X ( PinName  sda,
PinName  scl,
uint32_t  addr,
uint32_t  freq,
ADS111X_device_t  device 
)

Create an ADS111X object connected to the specified I2C pins.

ADS111X.cpp.

Parameters:
sdaI2C data pin
sclI2C clock pin
addrI2C slave address
freqI2C frequency
deviceDevice to use: ADS1113, ADS1114 or ADS1115

Ultra-Small, Low-Power, I2C-Compatible, 860-SPS, 16-Bit ADCs With Internal Reference, Oscillator, and Programmable Comparator. Function file.

Returns:
N/A
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A.
Warning:
N/A
Precondition:
This code belongs to AqueronteBlog ( http://unbarquero.blogspot.com ).

Definition at line 20 of file ADS111X.cpp.

~ADS111X (  )

Delete ADS111X object.

Definition at line 29 of file ADS111X.cpp.


Member Function Documentation

ADS111X::ADS111X_status_t ADS111X_GetComparator ( ADS111X_data_t *  myCOMP )

It gets the comparator configuration.

ADS111X_GetComparator ( ADS111X_data_t* );.

It gets the comparator configuration.

Parameters:
[in]N/A.
[out]myCOMP,:Comparator Mode/Polarity/Latching/Queue and disable.
Returns:
Status of ADS111X_GetComparator.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
ADS1114 and ADS1115 only.

Definition at line 668 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetConversion ( ADS111X_data_t *  myD )

It gets the conversion value.

ADS111X_GetConversion ( ADS111X_data_t* );.

It gets the conversion value

Parameters:
[in]N/A.
[out]myD,:Conversion value.
Returns:
Status of ADS111X_GetConversion.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 964 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetDataRate ( ADS111X_config_t *  myDR )

It gets the data rate.

ADS111X_GetDataRate ( ADS111X_config_t* );.

It gets the data rate.

Parameters:
[in]N/A.
[out]myDR,:Data rate.
Returns:
Status of ADS111X_GetDataRate.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 556 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetGain ( ADS111X_data_t *  myPGA )

It gets programmable gain amplifier ( not ADS1013 ).

ADS111X_GetGain ( ADS111X_data_t* );.

It gets programmable gain amplifier.

Parameters:
[in]N/A.
[out]myPGA,:Programmable gain.
Returns:
Status of ADS111X_GetGain.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
Not ADS1113.

Definition at line 339 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetHighThresholdValue ( ADS111X_thresh_t *  myHiThres )

It gets the high threshold value.

ADS111X_GetHighThresholdValue ( ADS111X_thresh_t );.

It gets the high threshold value.

Parameters:
[in]N/A.
[out]myHiThres,:High threshold value.
Returns:
Status of ADS111X_GetHighThresholdValue.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 868 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetLowThresholdValue ( ADS111X_thresh_t *  myLoThres )

It gets the low threshold value.

ADS111X_GetLowThresholdValue ( ADS111X_thresh_t );.

It gets the low threshold value.

Parameters:
[in]N/A.
[out]myLoThres,:low threshold value.
Returns:
Status of ADS111X_GetLowThresholdValue.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 774 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetMode ( ADS111X_config_t *  myMode )

It gets the device operating mode.

ADS111X_GetMode ( ADS111X_config_t* );.

It gets the device operating mode.

Parameters:
[in]N/A
[out]myMode,:Continuous/Single-shot mode conversion.
Returns:
Status of ADS111X_GetMode.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 451 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetMux ( ADS111X_data_t *  myADS111X )

It gets input multiplexer configuration ( ADS1015 only ).

ADS111X_GetMux ( ADS111X_data_t* );.

It gets input multiplexer configuration.

Parameters:
[in]N/A.
[out]myADS111X,:Input multiplexer configuration..
Returns:
Status of ADS111X_GetMux.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
ADS1015 only.

Definition at line 220 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetOS ( ADS111X_config_t *  myADS111X )

It checks if the device is not currently performing a conversion.

ADS111X_GetOS ( ADS111X_config_t* );.

It checks if the device is not currently performing a conversion.

Parameters:
[in]N/A.
[out]myADS111X,:Operational status flag.
Returns:
Status of ADS111X_GetOS.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 108 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_GetRawConversion ( ADS111X_conversion_t *  myRawD )

It gets the raw conversion value.

ADS111X_GetRawConversion ( ADS111X_conversion_t* );.

It gets the raw conversion value

Parameters:
[in]N/A.
[out]myRawD,:Raw conversion value.
Returns:
Status of ADS111X_GetRawConversion.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 916 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetComparator ( ADS111X_data_t  myCOMP )

It sets the comparator configuration.

ADS111X_SetComparator ( ADS111X_data_t );.

It sets the comparator configuration.

Parameters:
[in]myCOMP,:Comparator Mode/Polarity/Latching/Queue and disable.
[out]N/A.
Returns:
Status of ADS111X_SetComparator.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
ADS1114 and ADS1115 only.

Definition at line 606 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetDataRate ( ADS111X_config_t  myDR )

It sets the data rate.

ADS111X_SetDataRate ( ADS111X_config_t );.

It sets the data rate.

Parameters:
[in]myDR,:Data rate.
[out]N/A.
Returns:
Status of ADS111X_SetDataRate.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 501 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetGain ( ADS111X_data_t  myPGA )

It sets programmable gain amplifier ( not ADS1013 ).

ADS111X_SetGain ( ADS111X_data_t );.

It sets programmable gain amplifier.

Parameters:
[in]myPGA,:Programmable gain.
[out]N/A.
Returns:
Status of ADS111X_SetGain.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
Not ADS1113.

Definition at line 277 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetHighThresholdValue ( ADS111X_thresh_t  myHiThres )

It sets the high threshold value.

ADS111X_SetHighThresholdValue ( ADS111X_thresh_t );.

It sets the high threshold value.

Parameters:
[in]myHiThres,:High threshold value.
[out]N/A.
Returns:
Status of ADS111X_SetHighThresholdValue.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 822 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetLowThresholdValue ( ADS111X_thresh_t  myLoThres )

It sets the low threshold value.

ADS111X_SetLowThresholdValue ( ADS111X_thresh_t );.

It sets the low threshold value.

Parameters:
[in]myLoThres,:low threshold value.
[out]N/A.
Returns:
Status of ADS111X_SetLowThresholdValue.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 729 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetMode ( ADS111X_config_t  myMode )

It sets the device operating mode.

ADS111X_SetMode ( ADS111X_config_t );.

It sets the device operating mode.

Parameters:
[in]myMode,:Continuous/Single-shot mode conversion.
[out]N/A.
Returns:
Status of ADS111X_SetMode.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 396 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SetMux ( ADS111X_data_t  myADS111X )

It sets input multiplexer configuration ( ADS1015 only ).

ADS111X_SetMux ( ADS111X_data_t );.

It sets input multiplexer configuration.

Parameters:
[in]myADS111X,:Input multiplexer configuration.
[out]N/A.
Returns:
Status of ADS111X_SetMux.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
ADS1115 only.

Definition at line 158 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_SoftReset ( void   )

It triggers a softreset.

ADS111X_SoftReset ( void );.

It triggers a softreset.

Parameters:
[in]N/A.
[out]N/A.
Returns:
Status of ADS111X_SoftReset.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
N/A
Warning:
N/A.

Definition at line 1057 of file ADS111X.cpp.

ADS111X::ADS111X_status_t ADS111X_StartSingleConversion ( void   )

It starts a new single conversion.

ADS111X_StartSingleConversion ( void );.

It starts a new single conversion.

Parameters:
[in]N/A.
[out]N/A.
Returns:
Status of ADS111X_StartSingleConversion.
Author:
Manuel Caballero
Date:
18/June/2020
Version:
18/June/2020 The ORIGIN
Precondition:
This function can only be used when in power-down state and has no effect when a conversion is ongoing.
Warning:
N/A.

Definition at line 54 of file ADS111X.cpp.