embassy_stm32_plus/traits/can/
can2.rs

1use embassy_stm32::can::Can;
2use embassy_stm32::peripherals::CAN2;
3use crate::builder::can::can2::{Can2Builder, Can2Rx, Can2Tx};
4
5/// can2 trait
6pub trait Can2Trait {
7    /// build bx_can instance, more see [Can2Builder::build]
8    fn build(self, tx: Can2Tx, rx: Can2Rx) -> Can<'static>;
9}
10
11/// CAN2 support can2 trait
12impl Can2Trait for CAN2 {
13    #[inline]
14    fn build(self, tx: Can2Tx, rx: Can2Rx) -> Can<'static> {
15        Can2Builder::new(self, tx, rx).build()
16    }
17}