pub struct VTemp;
Expand description
Internal temperature sensor (ADC Channel 16)
Implementations§
Source§impl VTemp
impl VTemp
Sourcepub fn enable(&mut self, adc: &mut Adc)
pub fn enable(&mut self, adc: &mut Adc)
Enable the internal temperature sense, this has a wake up time tSTART which can be found in your micro’s datasheet, you must wait at least that long after enabling before taking a reading. Remember to disable when not in use.
Sourcepub fn is_enabled(&self, adc: &Adc) -> bool
pub fn is_enabled(&self, adc: &Adc) -> bool
Checks if the temperature sensor is enabled, does not account for the tSTART time however.
Sourcepub fn read(adc: &mut Adc, delay: Option<&mut Delay>) -> i16
pub fn read(adc: &mut Adc, delay: Option<&mut Delay>) -> i16
Read the value of the internal temperature sensor and return the result in 10ths of a degree centigrade.
Given a delay reference it will attempt to restrict to the minimum delay needed to ensure a 10 us tSTART value. Otherwise it will approximate the required delay using ADC reads.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VTemp
impl RefUnwindSafe for VTemp
impl Send for VTemp
impl Sync for VTemp
impl Unpin for VTemp
impl UnwindSafe for VTemp
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