ADS1246/7/8 24bit ADC converter for Temperature Sensors class

Embed: (wiki syntax)

« Back to documentation index

ADS1248 Class Reference

ADS1248 Class Reference

ADS1248 class. More...

#include <ADS1248.h>

Public Types

enum  reg
 

register name list of ADS1248

More...
enum  cmd
 

commande list of ADS1248

More...

Public Member Functions

 ADS1248 (SPI &spi, PinName cs, PinName rdy, PinName start=NC)
 Create ADS1248 instance.
void start (bool en)
 Access to output start pin.
void waitReady (void)
 Wait ADS1248 to be ready (pooling method)
void sleep (bool en)
 Sleep cmd of ADS1248 (ask waitReady)
void sync (void)
 Synchronisation cmd of ADS1248.
void reset (void)
 Reset cmd of ADS1248.
int read (void)
 Read data when conversion was finished (ask waitReady)
 operator int ()
 Ask read.
unsigned char readReg (unsigned char reg)
 Read ADS1248 register.
void readReg (unsigned char reg, unsigned char *buff, int len)
 Read ADS1248 registers.
void writeReg (unsigned char reg, unsigned char val)
 Write ADS1248 register.
void writeReg (unsigned char reg, const unsigned char *buff, int len)
 Write ADS1248 registers.
void systemOffsetCal (void)
 System Offset Calibration cmd of ADS1248 (ask waitReady)
void systemGainCal (void)
 System Gain Calibration cmd of ADS1248 (ask waitReady)
void selfOffsetCal (void)
 Self Offset Calibration cmd of ADS1248 (ask waitReady)

Detailed Description

ADS1248 class.

Used for read ADS1248/7/6 Temperature ADC

Definition at line 9 of file ADS1248.h.


Member Enumeration Documentation

enum cmd

commande list of ADS1248

Definition at line 41 of file ADS1248.h.

enum reg

register name list of ADS1248

Definition at line 22 of file ADS1248.h.


Constructor & Destructor Documentation

ADS1248 ( SPI &  spi,
PinName  cs,
PinName  rdy,
PinName  start = NC 
)

Create ADS1248 instance.

Parameters:
SPISPI bus to use
cspin to connect at CS input
rdypin connect at !rdy output
startpin connect at start inpout (pullup if unused)

Definition at line 8 of file ADS1248.cpp.


Member Function Documentation

operator int (  )

Ask read.

Returns:
24bit data 2's complement

Definition at line 77 of file ADS1248.cpp.

int read ( void   )

Read data when conversion was finished (ask waitReady)

Returns:
24bit data 2's complement

Definition at line 60 of file ADS1248.cpp.

unsigned char readReg ( unsigned char  reg )

Read ADS1248 register.

Parameters:
regis register address
Returns:
register value

Definition at line 95 of file ADS1248.cpp.

void readReg ( unsigned char  reg,
unsigned char *  buff,
int  len 
)

Read ADS1248 registers.

Parameters:
regis first register address
buffpointer on buffer to write
lenlenght of data to read

Definition at line 82 of file ADS1248.cpp.

void reset ( void   )

Reset cmd of ADS1248.

Definition at line 49 of file ADS1248.cpp.

void selfOffsetCal ( void   )

Self Offset Calibration cmd of ADS1248 (ask waitReady)

Definition at line 138 of file ADS1248.cpp.

void sleep ( bool  en )

Sleep cmd of ADS1248 (ask waitReady)

Parameters:
enfor wakeup or sleep

Definition at line 29 of file ADS1248.cpp.

void start ( bool  en )

Access to output start pin.

Parameters:
enstart pin state

Definition at line 20 of file ADS1248.cpp.

void sync ( void   )

Synchronisation cmd of ADS1248.

Definition at line 39 of file ADS1248.cpp.

void systemGainCal ( void   )

System Gain Calibration cmd of ADS1248 (ask waitReady)

Definition at line 128 of file ADS1248.cpp.

void systemOffsetCal ( void   )

System Offset Calibration cmd of ADS1248 (ask waitReady)

Definition at line 118 of file ADS1248.cpp.

void waitReady ( void   )

Wait ADS1248 to be ready (pooling method)

Definition at line 24 of file ADS1248.cpp.

void writeReg ( unsigned char  reg,
const unsigned char *  buff,
int  len 
)

Write ADS1248 registers.

Parameters:
regis first register address
buffpointer on buffer to read
lenlenght of data to write

Definition at line 101 of file ADS1248.cpp.

void writeReg ( unsigned char  reg,
unsigned char  val 
)

Write ADS1248 register.

Parameters:
regis register address
valvalue to write

Definition at line 114 of file ADS1248.cpp.