API
usbtemp.h File Reference
#include "platform.h"
Include dependency graph for usbtemp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFAULT_SERIAL_PORT   "/dev/ttyUSB0"
 
#define DS18X20_GENERATOR   0x8c
 
#define DS18X20_ROM_SIZE   8
 
#define DS18X20_SP_SIZE   9
 
#define DS18B20_SP_TH   2
 
#define DS18B20_SP_TL   3
 
#define DS18B20_SP_CONFIG   4
 
#define DS18B20_SP_WRITE   0x4e
 
#define DS18B20_SP_SAVE   0x48
 

Functions

char * DS18B20_errmsg (void)
 
HANDLE DS18B20_open (const char *)
 
int DS18B20_measure (HANDLE)
 
int DS18B20_acquire (HANDLE, float *)
 
int DS18B20_rom (HANDLE, unsigned char *)
 
int DS18B20_setprecision (HANDLE, int)
 
void DS18B20_close (HANDLE)
 
void wait_1s (void)
 
int is_fd_valid (HANDLE)
 

Macro Definition Documentation

◆ DEFAULT_SERIAL_PORT

#define DEFAULT_SERIAL_PORT   "/dev/ttyUSB0"

Definition at line 9 of file usbtemp.h.

◆ DS18B20_SP_CONFIG

#define DS18B20_SP_CONFIG   4

Definition at line 17 of file usbtemp.h.

◆ DS18B20_SP_SAVE

#define DS18B20_SP_SAVE   0x48

Definition at line 20 of file usbtemp.h.

◆ DS18B20_SP_TH

#define DS18B20_SP_TH   2

Definition at line 15 of file usbtemp.h.

◆ DS18B20_SP_TL

#define DS18B20_SP_TL   3

Definition at line 16 of file usbtemp.h.

◆ DS18B20_SP_WRITE

#define DS18B20_SP_WRITE   0x4e

Definition at line 19 of file usbtemp.h.

◆ DS18X20_GENERATOR

#define DS18X20_GENERATOR   0x8c

Definition at line 12 of file usbtemp.h.

◆ DS18X20_ROM_SIZE

#define DS18X20_ROM_SIZE   8

Definition at line 13 of file usbtemp.h.

◆ DS18X20_SP_SIZE

#define DS18X20_SP_SIZE   9

Definition at line 14 of file usbtemp.h.

Function Documentation

◆ DS18B20_acquire()

int DS18B20_acquire ( HANDLE  fd,
float *  temperature 
)

Definition at line 172 of file usbtemp.c.

Referenced by MagAOX::app::usbtempMon::appLogic().

◆ DS18B20_close()

void DS18B20_close ( HANDLE  fd)

◆ DS18B20_errmsg()

char* DS18B20_errmsg ( void  )

◆ DS18B20_measure()

int DS18B20_measure ( HANDLE  fd)

◆ DS18B20_open()

HANDLE DS18B20_open ( const char *  serial_port)

Definition at line 220 of file usbtemp.c.

Referenced by MagAOX::app::usbtempMon::checkConnections().

◆ DS18B20_rom()

int DS18B20_rom ( HANDLE  fd,
unsigned char *  rom 
)

Definition at line 194 of file usbtemp.c.

Referenced by MagAOX::app::usbtempMon::checkConnections().

◆ DS18B20_setprecision()

int DS18B20_setprecision ( HANDLE  fd,
int  precision 
)

Definition at line 127 of file usbtemp.c.

◆ is_fd_valid()

int is_fd_valid ( HANDLE  fd)

Definition at line 25 of file usbtemp.c.

Referenced by MagAOX::app::usbtempMon::checkConnections().

◆ wait_1s()

void wait_1s ( void  )

Definition at line 20 of file usbtemp.c.