Struct capsules_extra::buzzer_pwm::PwmBuzzer
source · pub struct PwmBuzzer<'a, A: Alarm<'a>, P: PwmPin> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<'a, A: Alarm<'a>, P: PwmPin> Buzzer<'a> for PwmBuzzer<'a, A, P>
impl<'a, A: Alarm<'a>, P: PwmPin> Buzzer<'a> for PwmBuzzer<'a, A, P>
source§fn set_client(&self, client: &'a dyn BuzzerClient)
fn set_client(&self, client: &'a dyn BuzzerClient)
Set the client to be used for callbacks of the Buzzer
implementation.
source§fn buzz(&self, frequency_hz: usize, duration_ms: usize) -> Result<(), ErrorCode>
fn buzz(&self, frequency_hz: usize, duration_ms: usize) -> Result<(), ErrorCode>
Play a sound at a chosen frequency and for a chosen duration.
Once the buzzer finishes buzzing, the
buzzer_done()
callback
is called.
If it is called while the buzzer is playing, the buzzer command will be
overridden with the new frequency and duration values. Read moreAuto Trait Implementations§
impl<'a, A, P> !Freeze for PwmBuzzer<'a, A, P>
impl<'a, A, P> !RefUnwindSafe for PwmBuzzer<'a, A, P>
impl<'a, A, P> !Send for PwmBuzzer<'a, A, P>
impl<'a, A, P> !Sync for PwmBuzzer<'a, A, P>
impl<'a, A, P> Unpin for PwmBuzzer<'a, A, P>
impl<'a, A, P> !UnwindSafe for PwmBuzzer<'a, A, P>
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