API
usbtemp.c File Reference
#include "usbtemp.h"
#include "windows.c"
Include dependency graph for usbtemp.c:

Go to the source code of this file.

Functions

void wait_1s (void)
 
int is_fd_valid (HANDLE fd)
 
static unsigned char lsb_crc8 (unsigned char *data_in, unsigned int len, const unsigned char generator)
 
char * DS18B20_errmsg (void)
 
static int DS18B20_start (HANDLE fd)
 
static int DS18B20_sp (HANDLE fd, unsigned char *sp)
 
int DS18B20_measure (HANDLE fd)
 
int DS18B20_setprecision (HANDLE fd, int precision)
 
int DS18B20_acquire (HANDLE fd, float *temperature)
 
int DS18B20_rom (HANDLE fd, unsigned char *rom)
 
HANDLE DS18B20_open (const char *serial_port)
 
void DS18B20_close (HANDLE fd)
 

Variables

int ut_errno
 
static char * ut_msgs []
 

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.

◆ DS18B20_sp()

static int DS18B20_sp ( HANDLE  fd,
unsigned char *  sp 
)
static

Definition at line 86 of file usbtemp.c.

Referenced by DS18B20_acquire(), and DS18B20_setprecision().

◆ DS18B20_start()

static int DS18B20_start ( HANDLE  fd)
static

Definition at line 73 of file usbtemp.c.

Referenced by DS18B20_measure(), DS18B20_setprecision(), and DS18B20_sp().

◆ is_fd_valid()

int is_fd_valid ( HANDLE  fd)

Definition at line 25 of file usbtemp.c.

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

◆ lsb_crc8()

static unsigned char lsb_crc8 ( unsigned char *  data_in,
unsigned int  len,
const unsigned char  generator 
)
static

Definition at line 46 of file usbtemp.c.

Referenced by DS18B20_rom(), and DS18B20_sp().

◆ wait_1s()

void wait_1s ( void  )

Definition at line 20 of file usbtemp.c.

Variable Documentation

◆ ut_errno

◆ ut_msgs

char* ut_msgs[]
static
Initial value:
= {
"",
"Error, could not get baudrate!",
"Error, could not set baudrate!",
"Error, serial port does not exist!",
"Error, you don't have rw permission to access serial port!",
"Error, failed to open serial port device!",
"Error, sensor not found!",
"Error, sensor CRC mismatch!",
"Warining, not expected sensor response!",
"Error, could not send data!"
}

Definition at line 33 of file usbtemp.c.

Referenced by DS18B20_errmsg().