19 #ifndef OWI_DRIVER_DS18B20_H 20 #define OWI_DRIVER_DS18B20_H 72 if (bits < 9) bits = 9;
else if (bits > 12) bits = 12;
147 uint16_t ms = millis() -
m_start;
148 uint16_t conv_ms = (MAX_CONVERSION_TIME >> (12 -
resolution()));
149 if (conv_ms > ms)
return (conv_ms - ms);
243 } __attribute__((packed));
255 } __attribute__((packed));
Write data to scratchpad.
scratchpad_t m_scratchpad
static const uint8_t FAMILY_CODE
int16_t temperature
Temperature reading (9-12 bits).
int8_t low_trigger
Low temperature trigger.
bool recall(bool match=true)
void get_trigger(int8_t &low, int8_t &high) const
static const uint8_t CONFIG_MAX
Recall configuration data from EEPROM.
bool read_scratchpad(bool match=true)
bool convert_request(bool broadcast=false)
virtual void write(uint8_t value, uint8_t bits=CHARBITS)=0
bool copy_scratchpad(bool match=true)
void resolution(uint8_t bits)
Read scratchpad including crc byte.
Software::OWI< BOARD::D7 > owi
uint8_t resolution() const
Signal power supply mode.
int8_t high_trigger
High temperature trigger.
bool write_scratchpad(bool match=true)
uint8_t configuration
Configuration; resolution, alarm.
Copy configuration register to EEPROM.
bool match_rom(uint8_t *code)
void set_trigger(int8_t low, int8_t high)
float temperature() const
Initiate temperature conversion.
static const uint16_t MAX_CONVERSION_TIME
uint16_t conversion_time()
virtual uint8_t read(uint8_t bits=CHARBITS)=0
uint8_t reserved[3]
Reserved.
Device(OWI &owi, const uint8_t *rom=NULL)
DS18B20(OWI &owi, uint8_t *rom=NULL)