📄 ds182x.h
字号:
#ifndef _DEV_BOARD_DS182X_H
#define _DEV_BOARD_DS182X_H
#include <string.h>
#ifndef __IMAGECRAFT__
#include <avr/io.h>
#include <avr/pgmspace.h>
#endif
#include <sys/atom.h>
#include <stdio.h>
#include "types.h"
#define DQ PORTA1 /* 1-wire thermometer is connected to PA0 */
#define DS_PORT PORTA
#define DS_PIN PINA
#define DS_DDR DDRA
#define MAX_SEARCH 20 /* max # of attempts to find devices on a 1-wire bus */
#define MAX_CHIP 5
#define MULTI_DEVICE 1 /* set 1 if you have more than one device on a 1-wire bus
* set 0 if you have only one device on a 1-wire bus
*/
#define DS_DEBUG 0 /* set 1 to display debugging information
* set 0 to suppress debugging information
*/
#ifndef _NOP
#define _NOP() asm volatile ("nop\n\t"::)
#endif
void TM_Convert_temperature(u_char idx, u_int *temp, u_int *frac);
u_int TM_Read_temperature(u_char idx);
void TM_Sample_temperature(u_char idx);
u_char TM_Init(void);
void TM_Scan(void);
/*
* Auxilliary routines
*
* - normally used only internally
* - can be used e.g. if device inventory required
*/
u_char TM_Search_next(u_char *ptr);
u_char TM_Search_rom(u_char *ptr);
u_char TM_Read_rom(u_char *ptr);
void TM_Delay(u_char cnt);
u_char TM_Crc(u_char crc, u_char inp);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -