BayEOSArduino Library
Public Member Functions | List of all members
DS18B20 Class Reference
Inheritance diagram for DS18B20:
Inheritance graph
[legend]
Collaboration diagram for DS18B20:
Collaboration graph
[legend]

Public Member Functions

 DS18B20 (uint8_t pin, uint8_t channel_offset=0, uint8_t ds18b20_channels=DS18B20_CHANNELS)
 
 ~DS18B20 ()
 
void t_conversion (void)
 
void setResolution (uint8_t newResolution)
 
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)
 

Constructor & Destructor Documentation

◆ DS18B20()

DS18B20::DS18B20 ( uint8_t  pin,
uint8_t  channel_offset = 0,
uint8_t  ds18b20_channels = DS18B20_CHANNELS 
)

Constructor

◆ ~DS18B20()

DS18B20::~DS18B20 ( )
inline

Destructor

Member Function Documentation

◆ addr2String()

const String DS18B20::addr2String ( const uint8_t *  addr)

Utility function for creating messages

◆ addSensor()

uint8_t DS18B20::addSensor ( const uint8_t *  new_addr,
uint8_t  channel 
)

adds sensor with given address and channel number

◆ checkSensors()

uint8_t DS18B20::checkSensors ( void  )

checks all known addresses returns channel of first non responding device

◆ deleteChannel()

uint8_t DS18B20::deleteChannel ( const uint8_t *  addr)

deletes given sensor address and frees channel returns freed channel number or zero on failure

◆ getChannel()

uint8_t DS18B20::getChannel ( const uint8_t *  addr)

returns channel number of given address returns 0 when address is not found

◆ getChannelAddress()

const uint8_t * DS18B20::getChannelAddress ( uint8_t  channel) const

returns a pointer to the address of a given channel number

◆ getNextChannel()

uint8_t DS18B20::getNextChannel ( void  )

Can be used to iterate through all aktive channels returns 0 when no channel is left

◆ getNextFreeChannel()

uint8_t DS18B20::getNextFreeChannel ( void  )

returns number of first free channel. returns 0 when no free channel is left

◆ getNumberOfChannels()

uint8_t DS18B20::getNumberOfChannels ( void  )

returns the number of allocated channels

◆ readAddrFromEEPROM()

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

◆ readChannel()

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

◆ search()

const uint8_t * DS18B20::search ( void  )

search for unknown Sensors returns pointer to new address

◆ setAllAddr()

int DS18B20::setAllAddr ( void  )

Performs search and registration of all Sensors present at OneWire-bus returns number of sensors added or removed

◆ setAllAddrFromEEPROM()

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)

◆ setResolution()

void DS18B20::setResolution ( uint8_t  newResolution)

Set resolution

◆ t_conversion()

void DS18B20::t_conversion ( void  )

starts temperature conversion

◆ writeAddrToEEPROM()

void DS18B20::writeAddrToEEPROM ( uint8_t  channel)

stores the address of given channel to EEPROM


The documentation for this class was generated from the following files: