pub struct Buzzer<I2C> { /* private fields */ }Expand description
Implementations§
Source§impl<I2C, E> Buzzer<I2C>where
I2C: I2c<Error = E>,
impl<I2C, E> Buzzer<I2C>where
I2C: I2c<Error = E>,
Sourcepub const MIN_FREQUENCY: u16 = 180
pub const MIN_FREQUENCY: u16 = 180
Minimum supported frequency in Hz.
Sourcepub fn new_with_address(i2c: I2C, address: u8) -> Result<Self, E>
pub fn new_with_address(i2c: I2C, address: u8) -> Result<Self, E>
Create a new Buzzer instance with a custom address.
Sourcepub fn tone_continuous(&mut self, frequency: u16) -> Result<(), E>
pub fn tone_continuous(&mut self, frequency: u16) -> Result<(), E>
Play a tone indefinitely until stopped.
Auto Trait Implementations§
impl<I2C> Freeze for Buzzer<I2C>where
I2C: Freeze,
impl<I2C> RefUnwindSafe for Buzzer<I2C>where
I2C: RefUnwindSafe,
impl<I2C> Send for Buzzer<I2C>where
I2C: Send,
impl<I2C> Sync for Buzzer<I2C>where
I2C: Sync,
impl<I2C> Unpin for Buzzer<I2C>where
I2C: Unpin,
impl<I2C> UnwindSafe for Buzzer<I2C>where
I2C: UnwindSafe,
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