Contiki 3.x
Functions
ds18b20.h File Reference

    Driver for the DS18B20 temperature sensor.
More...

#include "onewire.h"

Go to the source code of this file.

Functions

void ds18b20_init (void)
 Initialize the DS18B20 driver. More...
 
void ds18b20_convert_temperature (const ow_rom_code_t id)
 Tell a DS18B20 sensor to initiate a temperature conversion. More...
 
uint8_t ds18b20_read_scratchpad (const ow_rom_code_t id, uint8_t *dest)
 Read the scratchpad of a DS18B20 sensor. More...
 

Detailed Description

    Driver for the DS18B20 temperature sensor.
Author
Joakim Gebart joaki.nosp@m.m.ge.nosp@m.bart@.nosp@m.eist.nosp@m.ec.se

Definition in file ds18b20.h.

Function Documentation

void ds18b20_convert_temperature ( const ow_rom_code_t  id)

Tell a DS18B20 sensor to initiate a temperature conversion.

Parameters
idThe ROM code of the sensor, 0 for SKIP ROM.
Note
Parasite power is not supported yet!

Definition at line 64 of file ds18b20.c.

References ow_skip_or_match_rom(), and ow_write_bytes().

void ds18b20_init ( void  )

Initialize the DS18B20 driver.

Not much to do here yet.

Definition at line 53 of file ds18b20.c.

uint8_t ds18b20_read_scratchpad ( const ow_rom_code_t  id,
uint8_t *  dest 
)

Read the scratchpad of a DS18B20 sensor.

Parameters
idThe ROM code of the sensor, 0 for SKIP ROM.
destA destination buffer, must be at least 9 bytes long.
Returns
0 if the CRC is correct, non-zero otherwise.

Definition at line 85 of file ds18b20.c.

References ow_compute_crc(), ow_read_bytes(), ow_skip_or_match_rom(), and ow_write_bytes().