📄 sht.h
字号:
//----------------------------------------------------------------------------------
//
// Sensirion SHT1x Humidity Sensor Library
//
//----------------------------------------------------------------------------------
#ifndef __sht_h
#define __sht_h
#include "includes.h"
#ifndef XTAL
#define XTAL 7372800 // Processor clock
#endif
#define SHT_TEMPERATURE 0x03 // Measure temp - for ShtMeasure
#define SHT_HUMIDITY 0x05 // Measure humidity - for ShtMeasure
#define SHT_DDR DDRD // Port with clock and data pins
#define SHT_PORT PORTD // Port with clock and data pins
#define SHT_PIN PIND // Port with clock and data pins
#define SHT_CLOCK 7 // Pin used to output clock to SHT
#define SHT_DATA 6 // Pin used to read/output data from/to SHT
#define SHT_DELAY 25 // uS delay between clock rise/fall
#define STATUS_REG_W 0x06 // Command to read status register
#define STATUS_REG_R 0x07 // Command to write status register
//#define RESET 0x1e // Command for soft reset (not currently used)
void ShtInit(void);
void ShtReset(void);
s16 ShtMeasure(void);
void ShtCalculate(s16 *p_temperature, s16 *p_humidity);
s08 ShtReadStatus(u08 *p_value);
s08 ShtWriteStatus(u08 value);
u08 write_mode(u08 mode);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -