📄 ds18b20.h
字号:
/*
****************************************************************************************************
* SSAC_A1
* Main Controller Board
* File name : ds18b20.h
* Use for : To detect temperature
* Summary : The include file
****************************************************************************************************
*/
#ifndef __DS18B20_H
#define __DS18B20_H
////////// Read the Laser ROM from from DS18b20 // Notice: Only for single device on 1-Wire Bus
// Input:
// * Value: the point for UID data storage
// Return:
// 0: Opt. false
// 1: Opt. OK
__monitor extern unsigned char DS18B20_Single_Read_ROM (unsigned char * Value);
//--------------------------------------------------------------------------------------------------
////////// Read the value of temperature from DS18b20
// Input:
// // * UID: which device with the UID will be read out
// * Value: will storage temperature.
// * (Value + 0): = 0x00 is above 0, = 0xFF is lower 0
// * (Value + 1): Int. of temperature value
// * (Value + 2): dot. of temperature value, 0x00 to 0x63 (0.00 to 0.99)
// Return:
// 0: Opt. false
// 1: Opt. OK
extern unsigned char DS18B20_Single_Read_Temperature (unsigned char * Value);
//--------------------------------------------------------------------------------------------------
////////// Only convert temperature without delay. Single
// Input:
// None
// Return:
// 0: Opt. false
// 1: Opt. OK
extern unsigned char DS18B20_Single_Only_Convert_Temperature (void);
//--------------------------------------------------------------------------------------------------
////////// Only read SCT data from DS18B20. Single
// Input:
//
// * Value: will storage temperature.
// * (Value + 0): = 0x00 is above 0, = 0xFF is lower 0
// * (Value + 1): Int. of temperature value
// * (Value + 2): dot. of temperature value, 0x00 to 0x63 (0.00 to 0.99)
// Return:
// 0: Opt. false
// 1: Opt. OK
extern unsigned char DS18B20_Single_Only_Read_Temperature (unsigned char * Value);
//--------------------------------------------------------------------------------------------------
////////// 以指定的ROM去读温度
// Input:
//
// * UID: ROM (8 bytes)
// * Value: will storage temperature.
// * (Value + 0): = 0x00 is above 0, = 0xFF is lower 0
// * (Value + 1): Int. of temperature value
// * (Value + 2): dot. of temperature value, 0x00 to 0x63 (0.00 to 0.99)
// Return:
// 0: Opt. false
// 1: Opt. OK
extern unsigned char DS18B20_UID_Read_Temperature (unsigned char * Value, unsigned char * UID);
#endif /* __DS18B20_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -