BayEOS-Arduino
1.8.0_0.0.4
|
Public Member Functions | |
DS18B20 (uint8_t pin, uint8_t channel_offset=0, uint8_t ds18b20_channels=DS18B20_CHANNELS) | |
~DS18B20 () | |
void | t_conversion (void) |
const uint8_t * | search (void) |
uint8_t | checkSensors (void) |
uint8_t | getNextChannel (void) |
uint8_t | addSensor (const uint8_t *new_addr, uint8_t channel) |
uint8_t | getNextFreeChannel (void) |
uint8_t | getChannel (const uint8_t *addr) |
const uint8_t * | getChannelAddress (uint8_t channel) const |
uint8_t | deleteChannel (const uint8_t *addr) |
uint8_t | readChannel (uint8_t channel, float *f, uint8_t tries=1) |
uint8_t | readAddrFromEEPROM (uint8_t channel) |
uint8_t | setAllAddrFromEEPROM (void) |
int | setAllAddr (void) |
void | writeAddrToEEPROM (uint8_t channel) |
const String | addr2String (const uint8_t *addr) |
uint8_t | getNumberOfChannels (void) |
Additional Inherited Members | |
Protected Member Functions inherited from OneWire | |
OneWire (uint8_t pin) | |
uint8_t | reset (void) |
void | select (const uint8_t rom[8]) |
void | skip (void) |
void | write (uint8_t v, uint8_t power=0) |
void | write_bytes (const uint8_t *buf, uint16_t count, bool power=0) |
uint8_t | read (void) |
void | read_bytes (uint8_t *buf, uint16_t count) |
void | write_bit (uint8_t v) |
uint8_t | read_bit (void) |
void | depower (void) |
void | reset_search () |
void | target_search (uint8_t family_code) |
uint8_t | search (uint8_t *newAddr, bool search_mode=true) |
Static Protected Member Functions inherited from OneWire | |
static uint8_t | crc8 (const uint8_t *addr, uint8_t len) |
static bool | check_crc16 (const uint8_t *input, uint16_t len, const uint8_t *inverted_crc, uint16_t crc=0) |
static uint16_t | crc16 (const uint8_t *input, uint16_t len, uint16_t crc=0) |
DS18B20::DS18B20 | ( | uint8_t | pin, |
uint8_t | channel_offset = 0 , |
||
uint8_t | ds18b20_channels = DS18B20_CHANNELS |
||
) |
Constructor
Definition at line 4 of file DS18B20.cpp.
const String DS18B20::addr2String | ( | const uint8_t * | addr | ) |
Utility function for creating messages
Definition at line 167 of file DS18B20.cpp.
uint8_t DS18B20::addSensor | ( | const uint8_t * | new_addr, |
uint8_t | channel | ||
) |
adds sensor with given address and channel number
Definition at line 58 of file DS18B20.cpp.
uint8_t DS18B20::checkSensors | ( | void | ) |
checks all known addresses returns channel of first non responding device
Definition at line 40 of file DS18B20.cpp.
uint8_t DS18B20::deleteChannel | ( | const uint8_t * | addr | ) |
deletes given sensor address and frees channel returns freed channel number or zero on failure
Definition at line 143 of file DS18B20.cpp.
uint8_t DS18B20::getChannel | ( | const uint8_t * | addr | ) |
returns channel number of given address returns 0 when address is not found
Definition at line 156 of file DS18B20.cpp.
const uint8_t * DS18B20::getChannelAddress | ( | uint8_t | channel | ) | const |
returns a pointer to the address of a given channel number
Definition at line 152 of file DS18B20.cpp.
uint8_t DS18B20::getNextChannel | ( | void | ) |
Can be used to iterate through all aktive channels returns 0 when no channel is left
Definition at line 14 of file DS18B20.cpp.
uint8_t DS18B20::getNextFreeChannel | ( | void | ) |
returns number of first free channel. returns 0 when no free channel is left
Definition at line 136 of file DS18B20.cpp.
uint8_t DS18B20::getNumberOfChannels | ( | void | ) |
returns the number of allocated channels
Definition at line 176 of file DS18B20.cpp.
uint8_t DS18B20::readAddrFromEEPROM | ( | uint8_t | channel | ) |
Reads address from EEPROM returns 1 for a valid address returns 0 when there is no address in EEPROM for the given channel
Definition at line 66 of file DS18B20.cpp.
uint8_t DS18B20::readChannel | ( | uint8_t | channel, |
float * | f, | ||
uint8_t | tries = 1 |
||
) |
reads channel and puts the result in f return 0x0 on success 0x1 when there is no address for the channel 0x2 when there is data but not valid CRC8
Definition at line 115 of file DS18B20.cpp.
const uint8_t * DS18B20::search | ( | void | ) |
search for unknown Sensors returns pointer to new address
Definition at line 30 of file DS18B20.cpp.
int DS18B20::setAllAddr | ( | void | ) |
Performs search and registration of all Sensors present at OneWire-bus returns number of sensors added or removed
Definition at line 89 of file DS18B20.cpp.
uint8_t DS18B20::setAllAddrFromEEPROM | ( | void | ) |
Reads all addresses from EEPROM returns the number of addresses read from EEPROM typically used at startup of arduino (e.g. after running out of battery)
Definition at line 81 of file DS18B20.cpp.
void DS18B20::t_conversion | ( | void | ) |
starts temperature conversion
Definition at line 23 of file DS18B20.cpp.
void DS18B20::writeAddrToEEPROM | ( | uint8_t | channel | ) |
stores the address of given channel to EEPROM
Definition at line 106 of file DS18B20.cpp.