00001 #ifndef __sht15_h 00002 #define __sht15_h defined 00003 #include "pic_utils.h" 00004 #include "config.h" 00005 00006 // Include the following in your config.h: 00007 /* 00008 // - - - - - - - - - - - 00009 // sht15 defines 00010 // - - - - - - - - - - - 00011 00012 #define sht15_sck_port PORTA 00013 #define sht15_sck_pin 1 00014 #define sht15_sda_port PORTA 00015 #define sht15_sda_pin 0 00016 00017 // - - - - - - - - - - - 00018 */ 00019 00020 void sht15_boot_up(void); 00021 00022 void sht15_start(void); 00023 void sht15_read(void); 00024 uns16 sht15_read_humidity(void); 00025 uns16 sht15_read_temperature(void); 00026 void sht15_send_byte(uns8 sht15_command); 00027 uns16 sht15_read_byte16(void); 00028 uns16 sht15_fix_humidity_h(uns16 sensor_out); 00029 int16 sht15_fix_temperature_h(uns16 sensor_out); 00030 uns16 sht15_fix_humidity_l(uns8 sensor_out); 00031 00032 #ifndef sht15_sck_port 00033 #error "sht15_sck_port not defined in config.h" 00034 #endif 00035 #ifndef sht15_sda_port 00036 #error "sht15_sda_port not defined in config.h" 00037 #endif 00038 #ifndef sht15_sck_pin 00039 #error "sht15_sck_pin not defined in config.h" 00040 #endif 00041 #ifndef sht15_sda_pin 00042 #error "sht15_sda_pin not defined in config.h" 00043 #endif 00044 00045 00046 00047 #endif