pub struct TemperatureSensor<'d> { /* private fields */ }Expand description
Temperature sensor driver
Implementations§
Source§impl<'d> TemperatureSensor<'d>
impl<'d> TemperatureSensor<'d>
Sourcepub fn new(peripheral: TSENS<'d>, config: Config) -> Result<Self, ConfigError>
pub fn new(peripheral: TSENS<'d>, config: Config) -> Result<Self, ConfigError>
Creates a new temperature sensor instance with the given configuration.
The sensor is automatically powered up.
Sourcepub fn power_down(&self)
pub fn power_down(&self)
Powers down the temperature sensor to save power.
Sourcepub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
Changes the temperature sensor configuration.
Sourcepub fn get_temperature(&self) -> Temperature
pub fn get_temperature(&self) -> Temperature
Returns the raw temperature value.
Trait Implementations§
Auto Trait Implementations§
impl<'d> !UnwindSafe for TemperatureSensor<'d>
impl<'d> Freeze for TemperatureSensor<'d>
impl<'d> RefUnwindSafe for TemperatureSensor<'d>
impl<'d> Send for TemperatureSensor<'d>
impl<'d> Sync for TemperatureSensor<'d>
impl<'d> Unpin for TemperatureSensor<'d>
impl<'d> UnsafeUnpin for TemperatureSensor<'d>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more