Struct esp32_simple::clock::Timer
source · pub struct Timer<'a, T: Trigger> { /* private fields */ }Expand description
Represents a timer that can be used for various operations.
§Type Parameters
'a- Lifetime of the timer.T- The trigger type implementing theTriggertrait.
Implementations§
source§impl<'a, T: Trigger> Timer<'a, T>
impl<'a, T: Trigger> Timer<'a, T>
sourcepub fn configure_interrupt(
&mut self,
freq: u64,
notifier: Notifier<T>,
trigger: &'static T,
) -> Result<()>
pub fn configure_interrupt( &mut self, freq: u64, notifier: Notifier<T>, trigger: &'static T, ) -> Result<()>
sourcepub async fn delay(&mut self, freq: u64) -> Result<()>
pub async fn delay(&mut self, freq: u64) -> Result<()>
Delays execution for a period determined by the given frequency.
The delay duration is 1 / freq seconds (i.e., one period of the frequency).
§Arguments
freq- Frequency in Hz; the delay lasts one period of this frequency.
§Returns
Ok(()) when the delay completes.
§Errors
Returns an error if the delay cannot be performed.