自己整理的ADS1118的寄存器,跟io430.统一风格

#ifndef __ADS1118REG_H
#define __ADS1118REG_H
/******************************
 *	Author:Cris.Q
 * 	Funtion:ADS1118's register-information
 * 	Email:*
 *****************************/

/* ADS1118 Control Bits */
//This bit is used to start a single conversion.
//SS can only be written when in power-down state and has no effect when a conversion is ongoing.
/*0=No effect;1=Start a single conversion (when in power-down state) */
#define ADS1118SsC   		(0x8000)
#define ADS1118SsCNO   		(0x0000)

//These bits configure the input multiplexer.
/* AINP is AIN0 and AINN is AIN1 (default) */
#define ADS1118INP0N1   	(0x0000)
#define ADS1118INP0N3		(0x1000)
#define ADS1118INP1N3		(0x2000)
#define ADS1118INP2N3		(0x3000)
#define ADS1118INP0NGND 	(0x4000)
#define ADS1118INP1NGND		(0x5000)
#define ADS1118INP2NGND		(0x6000)
#define ADS1118INP3NGND		(0x7000)

//These bits configure the programmable gain amplifier.
#define ADS1118FS6144   	(0x0000) /* FS is ±6.144 V*/
#define ADS1118FS4096   	(0x0200)
#define ADS1118FS2048		(0x0400)
#define ADS1118FS1024		(0x0600)
#define ADS1118FS0512		(0x0800)
#define ADS1118FS0256_0		(0x0A00)
#define ADS1118FS0256_1		(0x0C00)
#define ADS1118FS0256_2		(0x0E00)

//This bit controls the ADS1118 operating mode.
//0 = Continuous conversion mode
//1 = single-shot and Power-down mode (default)
#define ADS1118MODECc         (0x0000)
#define ADS1118MODESs         (0x0100)

//These bits control the data rate setting.
#define ADS1118SPS8           (0x0000)
#define ADS1118SPS16          (0x0020)
#define ADS1118SPS32          (0x0040)
#define ADS1118SPS64          (0x0060)
#define ADS1118SPS128         (0x0080)
#define ADS1118SPS250         (0x00A0)
#define ADS1118SPS475         (0x00C0)
#define ADS1118SPS860         (0x00E0)

//This bit configures the ADC to convert temperature or input signals.
#define ADS1118MODEADC         (0x0000)
#define ADS1118MODETemp        (0x0010)

//PULL_UP_EN: Pull-up enable
//0 = Pull-up resistor disabled on DOUT/DRDY pin
//1 = Pull-up resistor enabled on DOUT/DRDY pin (default)
#define ADS1118PUDIS           (0x0000)
#define ADS1118PUEN            (0x0008)

//Last 3 bits must be '011'
#define ADS1118_REG_BACE       (0x0003)

#endif

你可能感兴趣的:(单片机,AD芯片)