feat: onewire and ds18b20 driver

This commit is contained in:
2024-11-28 02:35:59 +08:00
parent 31482c9a70
commit 8edaf36a1a
9 changed files with 141 additions and 105 deletions

30
lib/onewire/onewire.h Normal file
View File

@ -0,0 +1,30 @@
//
// Created by 5ANK41 on 2024/11/28.
//
#ifndef ONEWIRE_H
#define ONEWIRE_H
#include <8052.h>
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
#define ONE_WIRE_P P3_7
uchar OneWire_init(void);
void OneWire_writeBit(uchar _bit);
void OneWire_writeByte(uchar _byte);
uchar OneWire_readBit(void);
uchar OneWire_readByte(void);
#endif //ONEWIRE_H