pub struct I2cInterface {
config: I2cInterfaceConfig,
spin_sleeper: SpinSleeper,
}Expand description
Contains the configuration and the implementation for communication via I2C **. Sensor data is read periodically upon request via the channel and communicated back to the caller.
Fields§
§config: I2cInterfaceConfigconfiguration for I2C interface
spin_sleeper: SpinSleeperspin sleeper for waiting response of sensor unit
Trait Implementations§
Source§impl ProcessExternalRequestTrait for I2cInterface
impl ProcessExternalRequestTrait for I2cInterface
Source§fn process_external_request(
&mut self,
rx_from_signal_handler: &mut AquaReceiver<InternalCommand>,
_: Option<&mut AquaReceiver<InternalCommand>>,
) -> (bool, bool, bool)
fn process_external_request( &mut self, rx_from_signal_handler: &mut AquaReceiver<InternalCommand>, _: Option<&mut AquaReceiver<InternalCommand>>, ) -> (bool, bool, bool)
Checks for and processes new commands relevant to the I2cInterface module from external channels.
This is the specialized implementation of ProcessExternalRequestTrait for I2cInterface.
It delegates directly to process_external_request_without_messaging, indicating
that the I2cInterface module only processes commands from the signal handler
and ignores any input from a messaging channel.
§Arguments
rx_from_signal_handler- A reference to the receiver end of the channel for commands originating from the signal handler._- This parameter is ignored, as theI2cInterfacemodule does not process messages from a messaging channel.
§Returns
A tuple (bool, bool, bool) indicating the status of commands received:
- The first
boolistrueif aQuitcommand was received; otherwisefalse. - The second
boolis alwaysfalse(no “Start” commands processed). - The third
boolis alwaysfalse(no “Stop” commands processed).
Auto Trait Implementations§
impl Freeze for I2cInterface
impl RefUnwindSafe for I2cInterface
impl Send for I2cInterface
impl Sync for I2cInterface
impl Unpin for I2cInterface
impl UnwindSafe for I2cInterface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more