📄 1-wire.h
字号:
#include <reg51x.h>
/*hxc last change time 2006.x.x x:x*/
/*hxc last check time 2006.4.14 16:46*/
#define searchid_command 0XF0
#define readid_command 0X33
#define matchingid_command 0X55
#define allid_command 0XCC
#define ifsearchid_command 0xEC
sbit wire_pin = P3^5;
sbit wire_power_cmos=P3^4;
bit WIRE_id_read(uchar searchor_if);//read one ROM_ID,right ret 1,error ret 0
bit WIRE_reset(void); //reset OK ret '0'
WIRE_tx_8(unsigned char Txbyte);//write wire 8 bit
unsigned char WIRE_rx_8(void);//read wire 8 bit
WIRE_tx_1(bit Txbit); //write wire one bit
bit WIRE_rx_1(void); //read wire one bit
unsigned char WIER_crc(unsigned char *crc_array,unsigned char i2);
//ok ret 0 array *crc_array CRC check ,chach byte is i2 pcs
void DELAY_X(int xs); //delay=16*xs+8us last long time 524ms
void DELAY_nh( int xs1, int xs2); //delay time =xs1*xs2*15+xs1*18 last long 4.5 hour
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -