API
usbtemp.h
Go to the documentation of this file.
1 #ifndef _USBTEMP
2 #define _USBTEMP
3 
4 #include "platform.h"
5 
6 #if WINDOWS
7  #define DEFAULT_SERIAL_PORT "COM3"
8 #else
9  #define DEFAULT_SERIAL_PORT "/dev/ttyUSB0"
10 #endif
11 
12 #define DS18X20_GENERATOR 0x8c
13 #define DS18X20_ROM_SIZE 8
14 #define DS18X20_SP_SIZE 9
15 #define DS18B20_SP_TH 2
16 #define DS18B20_SP_TL 3
17 #define DS18B20_SP_CONFIG 4
18 
19 #define DS18B20_SP_WRITE 0x4e
20 #define DS18B20_SP_SAVE 0x48
21 
22 char *DS18B20_errmsg(void);
23 HANDLE DS18B20_open(const char *);
25 int DS18B20_acquire(HANDLE, float *);
26 int DS18B20_rom(HANDLE, unsigned char *);
28 void DS18B20_close(HANDLE);
29 
30 void wait_1s(void);
31 int is_fd_valid(HANDLE);
32 
33 #endif
#define HANDLE
Definition: platform.h:8
int DS18B20_measure(HANDLE)
Definition: usbtemp.c:115
void wait_1s(void)
Definition: usbtemp.c:20
int DS18B20_rom(HANDLE, unsigned char *)
Definition: usbtemp.c:194
char * DS18B20_errmsg(void)
Definition: usbtemp.c:68
HANDLE DS18B20_open(const char *)
Definition: usbtemp.c:220
void DS18B20_close(HANDLE)
Definition: usbtemp.c:225
int DS18B20_setprecision(HANDLE, int)
Definition: usbtemp.c:127
int DS18B20_acquire(HANDLE, float *)
Definition: usbtemp.c:172
int is_fd_valid(HANDLE)
Definition: usbtemp.c:25