2016-02-18 17:42:50 +00:00
|
|
|
#ifndef DRIVER_DS18B20_H_
|
|
|
|
#define DRIVER_DS18B20_H_
|
|
|
|
|
|
|
|
typedef struct {
|
2016-02-23 05:18:50 +00:00
|
|
|
uint8_t id;
|
|
|
|
float value;
|
2016-02-18 17:42:50 +00:00
|
|
|
} ds_sensor_t;
|
|
|
|
|
|
|
|
// Scan all ds18b20 sensors on bus and return its amount.
|
|
|
|
// Result are saved in array of ds_sensor_t structure.
|
2016-02-23 05:18:50 +00:00
|
|
|
uint8_t ds18b20_read_all(uint8_t pin, ds_sensor_t *result);
|
2016-02-18 17:42:50 +00:00
|
|
|
|
|
|
|
// This method is just to demonstrate how to read
|
|
|
|
// temperature from single dallas chip.
|
2016-02-23 05:18:50 +00:00
|
|
|
float ds18b20_read_single(uint8_t pin);
|
2016-02-18 17:42:50 +00:00
|
|
|
|
|
|
|
#endif
|