00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00029 #ifndef DS1621_H
00030 #define DS1621_H
00031
00032 #include "globals.h"
00033
00037 #define DS1621_ADDR 0x9e
00038
00042 #define DS1621_FLAG_DONE 7
00043
00047 #define DS1621_FLAG_1SHOT 0
00048
00049
00053 #define DS1621_CMD_START_CONVERT 0xee
00054
00058 #define DS1621_CMD_STOP_CONVERT 0x22
00059
00065 #define DS1621_CMD_READ_TEMP 0xaa
00066
00072 #define DS1621_CMD_ACCESS_CONFIG 0xac
00073
00079 #define DS1621_CMD_READ_COUNTER 0xa8
00080
00086 #define DS1621_CMD_READ_SLOPE 0xa9
00087
00088
00097 typedef signed char temp_t;
00098
00106 typedef u16 hires_temp_t;
00107
00114 void ds1621_do_conversion(void);
00115
00122 temp_t ds1621_gettemp(void);
00123
00129 u08 ds1621_getreg(u08 cmd);
00130
00143 hires_temp_t ds1621_hires_gettemp(void);
00144
00145 #endif