pub trait SoundPressure<'a> {
fn read_sound_pressure(&self) -> Result<(), ErrorCode>;
fn enable(&self) -> Result<(), ErrorCode>;
fn disable(&self) -> Result<(), ErrorCode>;
fn set_client(&self, client: &'a dyn SoundPressureClient);
}
Expand description
Basic Interface for Sound Pressure
Required Methods
fn read_sound_pressure(&self) -> Result<(), ErrorCode>
fn read_sound_pressure(&self) -> Result<(), ErrorCode>
Read the sound pressure level
Enable
As this is usually a microphone, some boards require an explicit enable so that they can turn on an LED. This function enables that microphone and LED. Not calling this function may result in innacurate readings.
Disable
As this is usually a microphone, some boards require an explicit enable so that they can turn on an LED. This function turns off that microphone. Readings perfomed after this function call might return innacurate.
fn set_client(&self, client: &'a dyn SoundPressureClient)
fn set_client(&self, client: &'a dyn SoundPressureClient)
Set the client