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§

source

fn read_sound_pressure(&self) -> Result<(), ErrorCode>

Read the sound pressure level

source

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.

source

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.

source

fn set_client(&self, client: &'a dyn SoundPressureClient)

Set the client

Implementors§