pub struct TwaiTx<'d, Dm: DriverMode> { /* private fields */ }
unstable
only.Expand description
Interface to the TWAI transmitter part.
Implementations§
Source§impl TwaiTx<'_, Async>
impl TwaiTx<'_, Async>
Sourcepub async fn transmit_async(
&mut self,
frame: &EspTwaiFrame,
) -> Result<(), EspTwaiError>
pub async fn transmit_async( &mut self, frame: &EspTwaiFrame, ) -> Result<(), EspTwaiError>
Transmits an EspTwaiFrame
asynchronously over the TWAI bus.
The transmission is aborted if the future is dropped. The technical reference manual does not specifiy if aborting the transmission also stops it, in case it is activly transmitting. Therefor it could be the case that even though the future is dropped, the frame was sent anyways.
Source§impl<Dm> TwaiTx<'_, Dm>where
Dm: DriverMode,
impl<Dm> TwaiTx<'_, Dm>where
Dm: DriverMode,
Sourcepub fn transmit(&mut self, frame: &EspTwaiFrame) -> Result<(), EspTwaiError>
pub fn transmit(&mut self, frame: &EspTwaiFrame) -> Result<(), EspTwaiError>
Transmit a frame.
Because of how the TWAI registers are set up, we have to do some assembly of bytes. Note that these registers serve a filter configuration role when the device is in configuration mode so patching the svd files to improve this may be non-trivial.
NOTE: TODO: This may not work if using the self reception/self test functionality. See notes 1 and 2 in the “Frame Identifier” section of the reference manual.