pub trait SoundPressure<'a> {
// Required methods
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§
Sourcefn read_sound_pressure(&self) -> Result<(), ErrorCode>
fn read_sound_pressure(&self) -> Result<(), ErrorCode>
Read the sound pressure level
Sourcefn enable(&self) -> Result<(), ErrorCode>
fn enable(&self) -> Result<(), ErrorCode>
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.
Sourcefn disable(&self) -> Result<(), ErrorCode>
fn disable(&self) -> Result<(), ErrorCode>
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.
Sourcefn set_client(&self, client: &'a dyn SoundPressureClient)
fn set_client(&self, client: &'a dyn SoundPressureClient)
Set the client