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

20
lib/ds18b20/ds18b20.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef __TEMP_H
#define __TEMP_H
#ifndef uchar
#define uchar unsigned char
#endif
#ifndef uint
#define uint unsigned int
#endif
#define DS18B20_SKIP_ROM 0xCC
#define DS18B20_CONVERT_TEMP 0x44
#define DS18B20_READ_SCRATCHPAD 0xBE
void DS18B20_startConvert(void);
int DS18B20_readTemperature(void);
#endif