77 const OneWireBus *
bus;
Structure containing information related to a single DS18B20 device connected via a 1-Wire bus...
Definition: ds18b20.h:72
Success.
Definition: ds18b20.h:49
A parameter or value is NULL.
Definition: ds18b20.h:53
bool use_crc
True if CRC checks are to be used when retrieving information from a device on the bus...
Definition: ds18b20.h:76
DS18B20_ERROR ds18b20_read_temp(const DS18B20_Info *ds18b20_info, float *value)
Read last temperature measurement from device.
Definition: ds18b20.c:523
void ds18b20_free(DS18B20_Info **ds18b20_info)
Delete an existing device info instance.
Definition: ds18b20.c:352
bool solo
True if device is intended to be the only one connected to the bus, otherwise false.
Definition: ds18b20.h:75
A One Wire Bus error occurred.
Definition: ds18b20.h:52
11-bit resolution, LSB bit 0 undefined
Definition: ds18b20.h:64
9-bit resolution, LSB bits 2,1,0 undefined
Definition: ds18b20.h:62
DS18B20_Info * ds18b20_malloc(void)
Construct a new device info instance. New instance should be initialised before calling other functio...
Definition: ds18b20.c:336
bool ds18b20_convert(const DS18B20_Info *ds18b20_info)
Start a temperature measurement conversion on a single device.
Definition: ds18b20.c:467
DS18B20_ERROR
Success and error codes.
Definition: ds18b20.h:46
12-bit resolution (default)
Definition: ds18b20.h:65
Invalid resolution.
Definition: ds18b20.h:61
An unknown error occurred, or the value was not set.
Definition: ds18b20.h:48
bool ds18b20_set_resolution(DS18B20_Info *ds18b20_info, DS18B20_RESOLUTION resolution)
Set temperature measurement resolution.
Definition: ds18b20.c:404
void ds18b20_convert_all(const OneWireBus *bus)
Start temperature conversion on all connected devices.
Definition: ds18b20.c:487
10-bit resolution, LSB bits 1,0 undefined
Definition: ds18b20.h:63
const OneWireBus * bus
Pointer to 1-Wire bus information relevant to this device.
Definition: ds18b20.h:77
DS18B20_ERROR ds18b20_check_for_parasite_power(const OneWireBus *bus, bool *present)
Check OneWire bus for presence of parasitic-powered devices.
Definition: ds18b20.c:579
DS18B20_RESOLUTION
Symbols for the supported temperature resolution of the device.
Definition: ds18b20.h:59
void ds18b20_init(DS18B20_Info *ds18b20_info, const OneWireBus *bus, OneWireBus_ROMCode rom_code)
Initialise a device info instance with the specified GPIO.
Definition: ds18b20.c:362
A device error occurred.
Definition: ds18b20.h:50
DS18B20_RESOLUTION ds18b20_read_resolution(DS18B20_Info *ds18b20_info)
Update and return the current temperature measurement resolution from the device. ...
Definition: ds18b20.c:443
float ds18b20_wait_for_conversion(const DS18B20_Info *ds18b20_info)
Wait for the maximum conversion time according to the current resolution of the device. In external power mode, the device or devices can signal when conversion has completed. In parasitic power mode, this is not possible, so a pre-calculated delay is performed.
Definition: ds18b20.c:503
void ds18b20_use_crc(DS18B20_Info *ds18b20_info, bool use_crc)
Enable or disable use of CRC checks on device communications.
Definition: ds18b20.c:395
DS18B20_ERROR ds18b20_convert_and_read_temp(const DS18B20_Info *ds18b20_info, float *value)
Convert, wait and read current temperature from device.
Definition: ds18b20.c:555
DS18B20_RESOLUTION resolution
Temperature measurement resolution per reading.
Definition: ds18b20.h:79
OneWireBus_ROMCode rom_code
The ROM code used to address this device on the bus.
Definition: ds18b20.h:78
OneWireBus_ROMCode ds18b20_read_rom(DS18B20_Info *ds18b20_info)
Read 64-bit ROM code from device - only works when there is a single device on the bus...
void ds18b20_init_solo(DS18B20_Info *ds18b20_info, const OneWireBus *bus)
Initialise a device info instance as a solo device on the bus.
Definition: ds18b20.c:378
A CRC error occurred.
Definition: ds18b20.h:51
bool init
True if struct has been initialised, otherwise false.
Definition: ds18b20.h:74