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

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

Detailed Description

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


#define ADS7828_I2C_ADDR   0x90
 Base I2C address of ADS7828 devices.
#define ADS7828_CMD_PD0   0x04
 ADS7828 Power-down bit 0.
#define ADS7828_CMD_PD1   0x08
 ADS7828 Power-down bit 1.
#define ADS7828_CMD_C0   0x10
 ADS7828 Channel Select bit 0.
#define ADS7828_CMD_C1   0x20
 ADS7828 Channel Select bit 1.
#define ADS7828_CMD_C2   0x40
 ADS7828 Channel Select bit 2.
#define ADS7828_CMD_SD   0x80
 ADS7828 Single-ended/Differential Select bit.
#define ADS7828_CMD_CH0   0x00
 ADS7828 Convert Channel 0.
#define ADS7828_CMD_CH1   0x04
 ADS7828 Convert Channel 1.
#define ADS7828_CMD_CH2   0x01
 ADS7828 Convert Channel 2.
#define ADS7828_CMD_CH3   0x05
 ADS7828 Convert Channel 3.
#define ADS7828_CMD_CH4   0x02
 ADS7828 Convert Channel 4.
#define ADS7828_CMD_CH5   0x06
 ADS7828 Convert Channel 5.
#define ADS7828_CMD_CH6   0x03
 ADS7828 Convert Channel 6.
#define ADS7828_CMD_CH7   0x07
 ADS7828 Convert Channel 7.
#define ADS7828_CMD_PDMODE0   0x00
 ADS7828 Power-down Mode 0.
#define ADS7828_CMD_PDMODE1   0x04
 ADS7828 Power-down Mode 1.
#define ADS7828_CMD_PDMODE2   0x08
 ADS7828 Power-down Mode 2.
#define ADS7828_CMD_PDMODE3   0x0C
 ADS7828 Power-down Mode 3.


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 33 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 80 of file ads7828.c.

Generated on Sun Oct 29 03:41:09 2006 for Procyon AVRlib by  doxygen 1.4.2