onewire 1-wire ds18x20 ds2450 multi-channel

Dependents:   ibutton

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DS2450.h Source File

DS2450.h

00001 /* DS2450 specific values (see datasheet www.maxim-ic.com/datasheet/index.mvp/id/2921) */
00002 #ifndef _DS2450_
00003 #define _DS2450_
00004 #define DS2450_ID           0x20
00005 #define DS2450_READ_MEMORY  0xAA
00006 #define DS2450_WRITE_MEMORY 0x55
00007 #define DS2450_CONVERT      0x3C
00008 
00009 #define DS2450_SP_SIZE 13
00010 #define DS2450_PAGE0 0x00
00011 #define DS2450_PAGE1 0x08
00012 #define DS2450_PAGE2 0x10
00013 #define DS2450_PAGE3 0x18
00014 
00015 #define DS2450_ADCA 0x00 //channel A
00016 #define DS2450_ADCB 0x02 //channel B
00017 #define DS2450_ADCC 0x04 //channel C
00018 #define DS2450_ADCD 0x06 //channel D
00019 
00020 #define DS2450_IR_2V5          0x00 //input voltage range 2.55V
00021 #define DS2450_IR_5V1          0x01 //input voltage range 5.1V
00022 #define DS2450_AFH              0x20 //flag alarm value higher
00023 #define DS2450_AFL              0x10 //flag alarm value lower
00024 #define DS2450_AEH_ENABLE       0x08 //alarm value higher enable  
00025 #define DS2450_AEL_ENABLE       0x04 //alarm value lower enable
00026 
00027 #define DS2450_DISABLE_OUT  0x00 //disable ouput
00028 #define DS2450_ENABLE_OUT   0x80//enable ouput
00029 
00030 #define DS2450_16_BIT       0x00 //ADC 16bits enable ouput
00031 #define DS2450_15_BIT       0x0F //ADC 15bits enable ouput
00032 #define DS2450_12_BIT       0x0C //ADC 12bits enable ouput
00033 #define DS2450_8_BIT        0x08   //ADC 8bits enable ouput
00034 #define DS2450_1_BIT        0x01   //ADC 1bits enable ouput
00035 uint8_t DS2450_read_page(uint8_t id[], uint8_t adresse, uint8_t *val);
00036 uint8_t DS2450_read_page(uint8_t n,uint8_t id[], uint8_t adresse, uint8_t *val);
00037 uint8_t DS2450_convert(uint8_t id[], uint8_t input_select_mask,uint8_t read_out_control);
00038 uint8_t DS2450_convert(uint8_t n,uint8_t id[], uint8_t input_select_mask,uint8_t read_out_control);
00039 uint8_t DS2450_read_ADC(uint8_t id[], uint16_t adc[]);
00040 uint8_t DS2450_read_ADC(uint8_t n,uint8_t id[], uint16_t adc[]);
00041 uint8_t DS2450_start_and_read_ADC(uint8_t id[], uint16_t adc[]);
00042 uint8_t DS2450_start_and_read_ADC(uint8_t n,uint8_t id[], uint16_t adc[]);
00043 uint8_t DS2450_configure_channel_ADC(uint8_t id[],uint8_t channel,uint8_t conflsb,uint8_t confmsb);
00044 uint8_t DS2450_configure_channel_ADC(uint8_t n,uint8_t id[],uint8_t channel,uint8_t conflsb,uint8_t confmsb);
00045 uint8_t DS2450_configure_page(uint8_t id[], uint8_t adresse,uint8_t configpage[]);
00046 uint8_t DS2450_configure_page(uint8_t n,uint8_t id[], uint8_t adresse,uint8_t configpage[]);
00047 #endif