We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 939c017 commit 35ec39cCopy full SHA for 35ec39c
1 file changed
nrf-hal-common/src/temp.rs
@@ -20,6 +20,19 @@ impl Temp {
20
/// Starts a new measurement and blocks until completion.
21
///
22
/// If a measurement was already started, it will be canceled.
23
+ ///
24
+ /// Returns the measured temperature in °C.
25
26
+ /// Note: This return type is [fixed::types::I30F2]. It
27
+ /// can be converted into [f32] or [f64] (or other numeric types)
28
+ /// via the `to_num()` method.
29
30
+ /// # Examples
31
32
+ /// ```no_run
33
+ /// let mut temp = Temp::new(board.TEMP);
34
+ /// let deg_c: f32 = temp.measure().to_num();
35
+ /// ```
36
pub fn measure(&mut self) -> I30F2 {
37
self.stop_measurement();
38
self.start_measurement();
0 commit comments