Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals

TI ADS7828 I2C A/D Converter Driver (ads7828.c)
[Drivers (for external hardware)]


Detailed Description

 #include "ads7828.h" 
Overview
This library provides high-level functions for accessing the Texas Instruments ADS7828 I2C A/D Converter.
The basic specs of the ADS7828 are:


Defines

#define ADS7828_I2C_ADDR   0x90
#define ADS7828_CMD_PD0   0x04
#define ADS7828_CMD_PD1   0x08
#define ADS7828_CMD_C0   0x10
#define ADS7828_CMD_C1   0x20
#define ADS7828_CMD_C2   0x40
#define ADS7828_CMD_SD   0x80
#define ADS7828_CMD_CH0   0x00
#define ADS7828_CMD_CH1   0x04
#define ADS7828_CMD_CH2   0x01
#define ADS7828_CMD_CH3   0x05
#define ADS7828_CMD_CH4   0x02
#define ADS7828_CMD_CH5   0x06
#define ADS7828_CMD_CH6   0x03
#define ADS7828_CMD_CH7   0x07
#define ADS7828_CMD_PDMODE0   0x00
#define ADS7828_CMD_PDMODE1   0x04
#define ADS7828_CMD_PDMODE2   0x08
#define ADS7828_CMD_PDMODE3   0x0C

Functions

u08 ads7828Init (u08 i2cAddr)
void ads7828SetReference (u08 ref)
u16 ads7828Convert (u08 i2cAddr, u08 channel)
 Begin single-ended conversion on given logical channel#, and return result.
u16 ads7828ConvertDiff (u08 i2cAddr, u08 channel)
 Begin differential conversion on given channel pair, and return result.
u16 ads7828ConvertRaw (u08 i2cAddr, u08 channel)
 Begin conversion on given raw channel#, and return result.


Function Documentation

u08 ads7828Init u08  i2cAddr  ) 
 

Initialize the ADS7828 chip. Returns: TRUE if successful, FALSE if unsuccessful (chip not present).

Definition at line 34 of file ads7828.c.

void ads7828SetReference u08  ref  ) 
 

Set the voltage reference to use for A/D conversion.

  • ref = 0 => External reference voltage on Ref pin.
  • ref = 1 => Internal 2.5V reference voltage (Ref pin left open).

Definition at line 81 of file ads7828.c.


Generated on Mon Aug 22 04:29:29 2005 for Procyon AVRlib by  doxygen 1.4.2