The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points.
static uint8_t ds18b20_command |
( |
uint8_t |
command, |
|
|
uint8_t * |
buf |
|
) |
| |
|
static |
Send command to 1 wire sensor.
- Parameters
-
command | command code |
*buf | argument buffer |
- Returns
- error code
Definition at line 128 of file ds18b20.h.
static uint8_t ds18b20_get_val |
( |
void * |
pctx, |
|
|
uint8_t * |
pdata |
|
) |
| |
|
static |
return temperature value
Definition at line 231 of file ds18b20.h.
static uint8_t ds18b20_read_temperature |
( |
ow_serial_t |
ser, |
|
|
int16_t * |
temp |
|
) |
| |
|
static |
Read the temperature value
- Parameters
-
ser | serial number of the device or 0 if skip addressing (in case if just one sensor is present) |
*temp | pointer that holds the singned integer temperature value. |
- Returns
- error code of conversion
Definition at line 180 of file ds18b20.h.
static void ds18b20_trigger |
( |
void * |
pctx, |
|
|
bool |
one_shot |
|
) |
| |
|
static |
start converion not implemented
Definition at line 226 of file ds18b20.h.
static uint8_t sensor_create_ds18b20 |
( |
void * |
pdata, |
|
|
bool |
raw |
|
) |
| |
|
static |
Create an instance of a ds18b20 sensor and initialize the sensor.
- Returns
- sizeof(ds18b20_ctx_t)
Definition at line 290 of file ds18b20.h.
DS18B20 context structure
Definition at line 109 of file ds18b20.h.
With the definition of the following macros, multiple ds18b20 sensors can be configured, per default the driver assumes just one (anonymous) sensor.
2 #define DS18B20_ADDR { 0xfc000005eab97828, \
This macros can either be manually in the apropriate board_xyz.h or they can added in the board.cfg file in the form:
1 sensors: ... ds18b20:0xfc000005eab97828,0x90000005eb460e28,0xc5000005ea2dc128
When using the second method, the macros appear in the generated board_cfg.h.
Definition at line 76 of file ds18b20.h.