21 #ifndef COSA_DS18B20_HH 22 #define COSA_DS18B20_HH 127 __attribute__((always_inline))
142 __attribute__((always_inline))
153 __attribute__((always_inline))
155 if (
m_rom[0] == 0)
return (0);
166 __attribute__((always_inline))
193 uint8_t resolution = 12,
194 bool parasite =
false);
256 } __attribute__((packed));
294 __attribute__((always_inline))
int16_t temperature() const
scratchpad_t m_scratchpad
DS18B20(OWI *pin, const char *name=NULL)
int16_t temperature
Temperature reading (9-12 bits).
static void print(IOStream &outs, int16_t temp)
friend IOStream & operator<<(IOStream &outs, OWI &owi)
int8_t low_trigger
Low temperature trigger.
void get_trigger(int8_t &low, int8_t &high) const
static const uint8_t CONFIG_MAX
bool read_scratchpad(bool flag=true)
DS18B20(OWI *pin, const uint8_t *rom, const char *name=NULL)
uint8_t resolution() const
int8_t high_trigger
High temperature trigger.
uint8_t configuration
Configuration; resolution, alarm.
static const uint16_t MIN_COPY_PULLUP
Driver(OWI *pin, const char *name=NULL)
bool connect(uint8_t family, uint8_t index)
void set_trigger(int8_t low, int8_t high)
static const uint16_t MAX_CONVERSION_TIME