Struct esp_idf_hal::can::AsyncCanDriver

source ·
pub struct AsyncCanDriver<'d, T>
where T: BorrowMut<CanDriver<'d>>,
{ /* private fields */ }

Implementations§

source§

impl<'d> AsyncCanDriver<'d, CanDriver<'d>>

source

pub fn new( can: impl Peripheral<P = CAN> + 'd, tx: impl Peripheral<P = impl OutputPin> + 'd, rx: impl Peripheral<P = impl InputPin> + 'd, config: &Config, ) -> Result<Self, EspError>

source§

impl<'d, T> AsyncCanDriver<'d, T>
where T: BorrowMut<CanDriver<'d>>,

source

pub fn wrap(driver: T) -> Result<Self, EspError>

source

pub fn wrap_custom( driver: T, priority: Option<u8>, pin_to_core: Option<Core>, ) -> Result<Self, EspError>

source

pub fn driver(&self) -> &CanDriver<'d>

source

pub fn driver_mut(&mut self) -> &mut CanDriver<'d>

source

pub fn start(&mut self) -> Result<(), EspError>

source

pub fn stop(&mut self) -> Result<(), EspError>

source

pub async fn transmit(&self, frame: &Frame) -> Result<(), EspError>

source

pub async fn receive(&self) -> Result<Frame, EspError>

source

pub async fn read_alerts(&self) -> Result<EnumSet<Alert>, EspError>

Trait Implementations§

source§

impl<'d, T> Drop for AsyncCanDriver<'d, T>
where T: BorrowMut<CanDriver<'d>>,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'d, T> Freeze for AsyncCanDriver<'d, T>
where T: Freeze,

§

impl<'d, T> RefUnwindSafe for AsyncCanDriver<'d, T>
where T: RefUnwindSafe,

§

impl<'d, T> !Send for AsyncCanDriver<'d, T>

§

impl<'d, T> !Sync for AsyncCanDriver<'d, T>

§

impl<'d, T> Unpin for AsyncCanDriver<'d, T>
where T: Unpin,

§

impl<'d, T> UnwindSafe for AsyncCanDriver<'d, T>
where T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.