pub struct TemperatureSensor<'d> { /* private fields */ }
Available on crate feature
unstable
only.Expand description
Temperature sensor driver
Implementations§
Source§impl<'d> TemperatureSensor<'d>
impl<'d> TemperatureSensor<'d>
Sourcepub fn new(
peripheral: impl Peripheral<P = TSENS> + 'd,
config: Config,
) -> Result<Self, ConfigError>
pub fn new( peripheral: impl Peripheral<P = TSENS> + 'd, config: Config, ) -> Result<Self, ConfigError>
Create a new temperature sensor instance with configuration The sensor will be automatically powered up
Sourcepub fn power_down(&self)
pub fn power_down(&self)
Power down the temperature sensor - useful if you want to save power
Sourcepub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
pub fn apply_config(&mut self, config: &Config) -> Result<(), ConfigError>
Change the temperature sensor configuration
Sourcepub fn get_temperature(&self) -> Temperature
pub fn get_temperature(&self) -> Temperature
Get the raw temperature value