⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ds18b20.h

📁 倒车雷达的原理图与源码
💻 H
字号:
/*
***************************************************************************************************
* Copyright (C),2007
* Author        : YanZhongsan
* Email         : yanzhongsan@gmail.com
* Date          : 2007-10-17
* File name     : DS18B20.h
* Description   : DS1302 driver head file
* Version       : V 1.0
* Others:       This file is the driver of DS1302
***************************************************************************************************
*/
#ifndef DS18B20_H
#define DS18B20_H

#include "includes.h"

/****Function prototype description****/
UCHAR_8 DS18B20_reset(void);
UINT_16 DS18B20_read_byte(void);
UINT_16 DS18B20_get_tem(void);
void DS18B20_write_byte(UCHAR_8 val);
void TempCodeCover(UINT_16 temp);

/****I/O port rename****/
#define TEMP_LINE                   (1<<PB1)
#define TEMP_LINE_STATUS            (PINB & TEMP_LINE)
#define TEMP_LINE_IS_HIGH           (0x00!=(PINB & TEMP_LINE))
#define TEMP_LINE_IS_LOW            (0x00==(PINB & TEMP_LINE))

#define SET_TEMP_LINE_HIGH          PORTB |= TEMP_LINE
#define SET_TEMP_LINE_LOW           PORTB &= (~TEMP_LINE)

#define SET_TEMP_LINE_OUT           DDRB |= TEMP_LINE
#define SET_TEMP_LINE_IN            DDRB &= (~TEMP_LINE)

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -