Arduino-OWI
One-Wire Interface (OWI) library for Arduino
|
#include <DS18B20.h>
Classes | |
struct | scratchpad_t |
Public Member Functions | |
DS18B20 (OWI &owi, uint8_t *rom=NULL) | |
void | resolution (uint8_t bits) |
void | set_trigger (int8_t low, int8_t high) |
float | temperature () const |
uint8_t | resolution () const |
void | get_trigger (int8_t &low, int8_t &high) const |
bool | convert_request (bool broadcast=false) |
uint16_t | conversion_time () |
bool | convert_ready () |
bool | convert_await () |
bool | read_scratchpad (bool match=true) |
bool | write_scratchpad (bool match=true) |
bool | copy_scratchpad (bool match=true) |
bool | recall (bool match=true) |
void | rom (const uint8_t *rom) |
uint8_t * | rom () |
void | rom_P (const uint8_t *rom) |
Static Public Attributes | |
static const uint8_t | FAMILY_CODE = 0x28 |
static const uint16_t | MAX_CONVERSION_TIME = 750 |
Protected Types | |
enum | { CONVERT_T = 0x44, READ_SCRATCHPAD = 0xBE, WRITE_SCRATCHPAD = 0x4E, COPY_SCRATCHPAD = 0x48, RECALL_E = 0xB8, READ_POWER_SUPPLY = 0xB4 } |
Protected Attributes | |
scratchpad_t | m_scratchpad |
uint16_t | m_start |
bool | m_converting |
OWI & | m_owi |
uint8_t | m_rom [ROM_MAX] |
Static Protected Attributes | |
static const uint8_t | CONFIG_MAX = 3 |
Driver for the DS18B20 Programmable Resolution 1-Write Digital Thermometer.
|
protected |
DS18B20 Function Commands (Table 3, pp. 12).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Read the contents of the scratchpad to local memory. Call convert_ready(), convert_await() or delay with amount from conversion_time() before reading. Call with match parameter false if used with search_rom().
[in] | match | rom code (default true). |
|
inline |
|
inline |
Set conversion resolution from 9..12 bits. Use write_scratchpad() and copy_scratchpad() to update device.
[in] | bits | resolution. |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inline |
Set alarm trigger values; low and high threshold values. Use write_scratchpad() and copy_scratchpad() to update device.
[in] | low | threshold. |
[in] | high | threshold. |
|
inline |
Get the latest temperature reading from the scratchpad copy. Call convert_request(), convert_await() and read_scratchpad() before accessing the scratchpad.
|
inline |
|
staticprotected |
|
static |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protected |
|
protected |
Watchdog millis on convert_request().
|
static |