kernel::hil::sensors

Trait 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§