core/thermometer/ds18b20.h File Reference
Go to the source code of this file.
Detailed Description
Interface for DS18B20 1-wire thermometer driver.
Definition in file ds18b20.h.
Function Documentation
Initialize the DS18B20.
- Returns:
- true on success, false otherwise.
Definition at line 255 of file ds18b20.c.
int ds18b20_read |
( |
void * |
p_dst, |
|
|
uint32_t |
dst_size | |
|
) |
| | |
Read the temperature from the DS18B20.
This function is used by the device driver.
- Parameters:
-
| p_dst | Address to write data to. |
| dst_size | Number of bytes to read. |
- Returns:
- Number of bytes read on success, -1 otherwise.
Definition at line 318 of file ds18b20.c.
bool_t ds18b20_read_serial |
( |
uint8_t * |
p_serial |
) |
|
Read the serial number of a DS18B20.
- Parameters:
-
| p_serial | Address to write serial to (8 bytes expected). |
- Returns:
- true on success, false otherwise.
Definition at line 371 of file ds18b20.c.
float ds18b20_read_temperature |
( |
void |
|
) |
|
Read the temperature measured by the DS18B20.
- Returns:
- Temperature in degrees Celsius on success, -100 otherwise.
Definition at line 289 of file ds18b20.c.
int ds18b20_write |
( |
const uint8_t * |
p_src, |
|
|
uint32_t |
src_size | |
|
) |
| | |
Write the DS18B20.
This function is used by the device driver.
- Parameters:
-
| p_src | Pointer to data to write. |
| src_size | Number of bytes to write. |
- Returns:
- Number of bytes read on success, -1 otherwise.
Definition at line 355 of file ds18b20.c.
bool_t ds18b20_write_scratchpad |
( |
uint8_t |
th, |
|
|
uint8_t |
tl, |
|
|
uint8_t |
config | |
|
) |
| | |
Write the scratchpad of the DS18B20.
- Parameters:
-
| th | Value for Th register. |
| tl | Value for Tl register. |
| config | Value for configuration register. |
- Returns:
- true on success, false otherwise.
Definition at line 269 of file ds18b20.c.