#ifndef SENSRO_18B20_H
#define SENSRO_18B20_H

#include "ioCC2430.h"
#include "hal_types.h"
//#include "hal.h"

//#define CL_DQ  P0_4=0
//#define SET_DQ P0_4=1 
//#define SET_OUT P0DIR|=0x10
//#define SET_IN  P0DIR&=~0x10
//#define IN_DQ  P0_4

#define CL_DQ  P0_2=0
#define SET_DQ P0_2=1 
#define SET_OUT P0DIR|=0x04
#define SET_IN  P0DIR&=~0x04
#define IN_DQ  P0_2


 //void Delay_1us(void); 
 void Delay_nus(uint16 n) ;
 void write_1820(unsigned char x) ; 
 BYTE match_rom(unsigned char *rom);
 void DataChange(unsigned char Temp_channel);

 unsigned char read_1820(void);  
 void init_1820(void) ; 
 void read_data(unsigned char *serial);
unsigned int read_data_value(void);

 void ds18b20_main(void);
#endif