12-Bit, 8-Channel, ADC System Monitor w/ Temp Sensor, Internal/External Reference, & I2C Interface
Dependents: ADC128D818_HelloWorld
Diff: ADC128D818.h
- Revision:
- 1:5f9dbbbc34c5
- Parent:
- 0:9cc68ef524da
- Child:
- 2:f9a0518b352a
diff -r 9cc68ef524da -r 5f9dbbbc34c5 ADC128D818.h --- a/ADC128D818.h Tue Aug 27 11:38:38 2013 +0000 +++ b/ADC128D818.h Mon Sep 02 11:39:46 2013 +0000 @@ -1,4 +1,10 @@ - +/** + * @brief ADC128D818 12-Bit, 8-Channel, ADC System Monitor w/ Temp Sensor, Internal/External Reference, & I2C Interfac + * http://www.ti.com/product/adc128d818/ + * @date 02/09/2013 + * @author F.BLANC LAAS-CNRS + * http://homepages.laas.fr/fblanc/ + */ #ifndef ADC128D818_H @@ -48,6 +54,32 @@ ADC_CHANNEL_IN7 = 0x07, ADC_CHANNEL_TEMP = 0x07 }; + enum ADC_INT { + + ADC_INT_IN0 = (char)~(0x01 <<0), + ADC_INT_IN1 = (char)~(0x01 <<1), + ADC_INT_IN2 = (char)~(0x01 <<2), + ADC_INT_IN3 = (char)~(0x01 <<3), + ADC_INT_IN4 = (char)~(0x01 <<4), + ADC_INT_IN5 = (char)~(0x01 <<5), + ADC_INT_IN6 = (char)~(0x01 <<6), + ADC_INT_IN7 = (char)~(0x01 <<7), + ADC_INT_TEMP = (char)~(0x01 <<7), + ADC_INT_ALL = 0x00 + }; + enum ADC_ENABLE { + + ADC_ENABLE_IN0 = (char)~(0x01 <<0), + ADC_ENABLE_IN1 = (char)~(0x01 <<1), + ADC_ENABLE_IN2 = (char)~(0x01 <<2), + ADC_ENABLE_IN3 = (char)~(0x01 <<3), + ADC_ENABLE_IN4 = (char)~(0x01 <<4), + ADC_ENABLE_IN5 = (char)~(0x01 <<5), + ADC_ENABLE_IN6 = (char)~(0x01 <<6), + ADC_ENABLE_IN7 = (char)~(0x01 <<7), + ADC_ENABLE_TEMP = ~(0x01 <<7), + ADC_ENABLE_ALL = 0x00 + }; enum ADC_REG { ADC_REG_Configuration_Register = 0x00, ADC_REG_Interrupt_Status_Register = 0x01, @@ -106,7 +138,7 @@ int read_channel(char channel); char read_register(char Register); int init(char address, char mode, char vref, char rate, char mask_channel, char mask_int); - int init_limit(char channel, int limit, char high_low); + int init_limit(char channel, char limit, char high_low); void start(); void stop(); };