]> rtime.felk.cvut.cz Git - sysless.git/blob - arch/arm/mach-lpc23xx/libs/1-wire/ds18s20.h
lpc23xx library - updated 1 wire driver and driver for ds18S20. It still needs some...
[sysless.git] / arch / arm / mach-lpc23xx / libs / 1-wire / ds18s20.h
1 #ifndef __DS18S20_H
2 #define __DS18S20_H
3
4 #include <types.h>
5
6 #define DEVICE_OK                       0
7 #define DEVICE_NOT_FOUND                1
8 #define DEVICE_CRC_FAIL                 2
9 #define DEVICE_SHORT_CIRCUIT            3       // kdyz je zkrat na lince (prectou se samy nuly)
10
11
12 struct ds18s20_dev 
13 {
14         uint8_t port;           // 0 for P0, 1 for P1 ...
15         uint8_t pin_read;
16         uint8_t pin_write;
17         int16_t temp;
18 };      
19
20
21
22 uint8_t read_temp(struct ds18s20_dev * dev);
23
24 #endif //__DS18S20_H