Trait kernel::hil::can::ControllerClient

source ·
pub trait ControllerClient {
    // Required methods
    fn state_changed(&self, state: State);
    fn enabled(&self, status: Result<(), ErrorCode>);
    fn disabled(&self, status: Result<(), ErrorCode>);
}
Expand description

Client interface for capsules that implement the Controller trait.

Required Methods§

source

fn state_changed(&self, state: State)

The driver calls this function when the state of the CAN peripheral is changed.

§Arguments:
  • state - The current state of the peripheral
source

fn enabled(&self, status: Result<(), ErrorCode>)

The driver calls this function when the peripheral has been successfully enabled. The driver must call this function and state_changed also, but must wait for this function to be called. If an error occurs, the state_changed callback might not be able to report it.

§Arguments:
  • status
    • Ok() - The peripheral has been successfully enabled; the actual state is transmitted via state_changed callback
    • Err(ErrorCode) - The error that occurred during the enable process
source

fn disabled(&self, status: Result<(), ErrorCode>)

The driver calls this function when the peripheral has been successfully disabled. The driver must call this function and state_changed also, but must wait for this function to be called. If an error occurs, the state_changed callback might not be able to report it.

§Arguments:
  • status
    • Ok() - The peripheral has been successfully disabled; the actual state is transmitted via state_changed callback
    • Err(ErrorCode) - The error that occurred during the disable process

Implementors§