|
LightHub 4.6.0
Open-source smart home controller firmware
|
1-Wire temperature sensing for thermostats. More...
#include <DallasTemperature.h>#include "aJSON.h"#include <Wire.h>#include <DS2482_OneWire.h>Go to the source code of this file.
Macros | |
| #define | SW_AUX0 0x40 |
| #define | SW_AUX1 0x80 |
| #define | SW_STAT0 0x4 |
| #define | SW_STAT1 0x8 |
| #define | SW_OUT0 0x20 |
| #define | SW_OUT1 0x10 |
| #define | SW_MASK 0xF |
| #define | SW_INMASK 0xFC |
| #define | SW_FIND 1 |
| #define | SW_DOUBLECHECK 2 |
| #define | SW_PULSE0 4 |
| #define | SW_PULSE1 8 |
| #define | SW_PULSE_P0 0x10 |
| #define | SW_PULSE_P1 0x20 |
| #define | SW_CHANGED_P0 0x40 |
| #define | SW_CHANGED_P1 0x80 |
| #define | SW_PULSE0_R 0x100 |
| #define | SW_PULSE1_R 0x200 |
| #define | t_max 20 |
| #define | TEMPERATURE_PRECISION 12 |
| #define | DS2482_100_I2C_TO_1W_BRIDGE |
Functions | |
| int | owUpdate () |
| Scans the 1-Wire bus and logs the devices it finds. | |
| int | owSetup () |
| Initializes the 1-Wire bus and the temperature sensors, and applies the configured resolution. | |
| void | owLoop () |
| Periodic poll: reads each configured sensor and publishes its temperature to the item's /val subtopic. | |
| void | setupOwIdle (void(*)()) |
| Registers an idle callback invoked between 1-Wire operations. | |
| void | owSearch () |
| Triggers a 1-Wire device search/update. | |
Variables | |
| aJsonObject * | owArr |
| 1-Wire sensor configuration array from the JSON config. | |
| OneWire * | oneWire |
| 1-Wire bus handle (DS2482 bridge or software pin driver). | |
| DallasTemperature * | sensors |
| DallasTemperature manager on top of the 1-Wire bus. | |
1-Wire temperature sensing for thermostats.
Reads DS18S20/DS18B20 digital thermometers (device type 0x28) through a DS2482-100 I2C-to-1-Wire bridge (or a software 1-Wire driver on a dedicated pin). Each configured sensor is polled periodically and its temperature is published to the item's /val subtopic.
| #define DS2482_100_I2C_TO_1W_BRIDGE |
| #define SW_AUX0 0x40 |
| #define SW_AUX1 0x80 |
| #define SW_CHANGED_P0 0x40 |
| #define SW_CHANGED_P1 0x80 |
| #define SW_DOUBLECHECK 2 |
| #define SW_FIND 1 |
| #define SW_INMASK 0xFC |
| #define SW_MASK 0xF |
| #define SW_OUT0 0x20 |
| #define SW_OUT1 0x10 |
| #define SW_PULSE0 4 |
| #define SW_PULSE0_R 0x100 |
| #define SW_PULSE1 8 |
| #define SW_PULSE1_R 0x200 |
| #define SW_PULSE_P0 0x10 |
| #define SW_PULSE_P1 0x20 |
| #define SW_STAT0 0x4 |
| #define SW_STAT1 0x8 |
| #define t_max 20 |
| #define TEMPERATURE_PRECISION 12 |
| void owLoop | ( | ) |
Periodic poll: reads each configured sensor and publishes its temperature to the item's /val subtopic.
| void owSearch | ( | ) |
Triggers a 1-Wire device search/update.
| int owSetup | ( | ) |
Initializes the 1-Wire bus and the temperature sensors, and applies the configured resolution.
| int owUpdate | ( | ) |
Scans the 1-Wire bus and logs the devices it finds.
| void setupOwIdle | ( | void(* | ptr )() | ) |
Registers an idle callback invoked between 1-Wire operations.
| ptr | Function to call while the bus is idle. |
|
extern |
1-Wire bus handle (DS2482 bridge or software pin driver).
|
extern |
1-Wire sensor configuration array from the JSON config.
|
extern |
DallasTemperature manager on top of the 1-Wire bus.