ds18b20.h 456 B

123456789101112131415161718
  1. #ifndef __DS18B20_H__
  2. #define __DS18B20_H__
  3. #include <iocc2530.h>
  4. #include "OnBoard.h"
  5. #define DS18B20_PIN P1_6 //温度传感器引脚
  6. #define DS18B20_PORT P1DIR
  7. #define DS18B20_NUM GPIO_6
  8. //引脚配置为输出;
  9. #define DS18B20_PIN_OUT() { DS18B20_PORT |= DS18B20_NUM; asm("NOP"); }
  10. //引脚配置为输入;
  11. #define DS18B20_PIN_IN() { DS18B20_PORT &= ~DS18B20_NUM; asm("NOP"); }
  12. unsigned char ReadDs18B20(void);
  13. float floatReadDs18B20(void);
  14. #endif