Trait kernel::hil::sensors::SoundPressure
source · 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