ADS1231 General Purpose library to deal with ADS1231 AD Converter

Embed: (wiki syntax)

« Back to documentation index

ADS1231_GP Class Reference

ADS1231_GP Class Reference

ADS1231_GP Class. More...

#include <ADS1231_GP.h>

Public Member Functions

 ADS1231_GP (PinName doutPin, PinName clkPin, PinName pdwnPin)
 Creates an instance.
void setPower (unsigned int p)
 Sets power ON or OFF to ADS1231.
unsigned int dataAvailable (void)
 Checks if data is available to be read.
unsigned int readValue (void)
 Reads a value from ADS1231 output.

Detailed Description

ADS1231_GP Class.

Author:
Fernando Cosentino

Definition at line 21 of file ADS1231_GP.h.


Constructor & Destructor Documentation

ADS1231_GP ( PinName  doutPin,
PinName  clkPin,
PinName  pdwnPin 
)

Creates an instance.

This version does not support speed changes (speed must be hard-wired or controlled externally).

Parameters:
doutPinPin connected to data out (!DRDY/DOUT) from ADS1231
clkPinPin connected to serial clock (SCLK) to ADS1231
pdwnPinPin connected to power down (!PDWN) to ADS1231

Definition at line 11 of file ADS1231_GP.cpp.


Member Function Documentation

unsigned int dataAvailable ( void   )

Checks if data is available to be read.

Returns:
1 if ADS1231 is ON and data is available, 0 otherwise.

Definition at line 19 of file ADS1231_GP.cpp.

unsigned int readValue ( void   )

Reads a value from ADS1231 output.

You must first ensure there is data available using dataAvailable().

Returns:
Raw data read as unsigned int

Definition at line 25 of file ADS1231_GP.cpp.

void setPower ( unsigned int  p )

Sets power ON or OFF to ADS1231.

Parameters:
pBoolean indicating power down. 1=OFF, 0=ON

Definition at line 15 of file ADS1231_GP.cpp.