|
modm API documentation
|
Measurement resolution setting. More...
#include <modm/driver/temperature/ds18b20.hpp>
Public Types | |
| enum | Resolution : uint8_t { Bits9 = 0b0'00'11111, Bits10 = 0b0'01'11111, Bits11 = 0b0'10'11111, Bits12 = 0b0'11'11111 } |
Public Member Functions | |
| Ds18b20 (const uint8_t *rom) | |
| Constructor. More... | |
| bool | configure (Resolution resolution) |
| Configure measurement resolution. More... | |
| bool | isAvailable () |
| Check if the device is present. More... | |
| void | startConversion () |
| Start the conversion of this device. | |
| void | startConversions () |
| Start the conversion for all connected devices. More... | |
| bool | isConversionDone () |
| Check if the last conversion is complete. More... | |
| int16_t | readTemperature () |
| Read the current temperature in centi-degree. More... | |
Protected Member Functions | |
| bool | selectDevice () |
| Select the current device. | |
Protected Attributes | |
| uint8_t | identifier [8] |
Measurement resolution setting.
The maximum conversion time doubles for every additional bit: 9 bits: 93.75 ms 10 bits: 187.5 ms 11 bits: 375 ms 12 bits: 750 ms
| bool modm::ds18b20< OneWire >::configure | ( | Resolution | resolution | ) |
Configure measurement resolution.
Set the measurement resolution. Every additional bit doubles the measurement time.
true if a device is found, false if no device is available on the bus. | modm::ds18b20< OneWire >::Ds18b20 | ( | const uint8_t * | rom | ) |
Constructor.
Default resolution is 12-bit.
| rom | 8-byte unique ROM number of the device |
| bool modm::ds18b20< OneWire >::isAvailable | ( | ) |
Check if the device is present.
true if the device is found, false if the ROM number is not available on the bus. | bool modm::ds18b20< OneWire >::isConversionDone | ( | ) |
Check if the last conversion is complete.
true conversion complete, false conversion in progress. | int16_t modm::ds18b20< OneWire >::readTemperature | ( | ) |
Read the current temperature in centi-degree.
| void modm::ds18b20< OneWire >::startConversions | ( | ) |