123456789101112131415161718 |
- #ifndef __DS18B20_H__
- #define __DS18B20_H__
- #include <iocc2530.h>
- #include "OnBoard.h"
- #define DS18B20_PIN P1_6 //温度传感器引脚
- #define DS18B20_PORT P1DIR
- #define DS18B20_NUM GPIO_6
- //引脚配置为输出;
- #define DS18B20_PIN_OUT() { DS18B20_PORT |= DS18B20_NUM; asm("NOP"); }
- //引脚配置为输入;
- #define DS18B20_PIN_IN() { DS18B20_PORT &= ~DS18B20_NUM; asm("NOP"); }
- unsigned char ReadDs18B20(void);
- float floatReadDs18B20(void);
- #endif
|