bxcan: namechange "bxcan_v1" -> "can_bxcan"
This commit is contained in:
parent
dc6b7f3cba
commit
191a589820
@ -68,7 +68,7 @@ pub(crate) mod sealed {
|
|||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
pub trait Instance {
|
pub trait Instance {
|
||||||
fn regs() -> &'static crate::pac::bxcan::Can;
|
fn regs() -> &'static crate::pac::can::Can;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait RxPin<T: Instance>: Pin {
|
pub trait RxPin<T: Instance>: Pin {
|
||||||
@ -85,9 +85,9 @@ pub trait RxPin<T: Instance>: sealed::RxPin<T> {}
|
|||||||
pub trait TxPin<T: Instance>: sealed::TxPin<T> {}
|
pub trait TxPin<T: Instance>: sealed::TxPin<T> {}
|
||||||
|
|
||||||
crate::pac::peripherals!(
|
crate::pac::peripherals!(
|
||||||
(bxcan, $inst:ident) => {
|
(can, $inst:ident) => {
|
||||||
impl sealed::Instance for peripherals::$inst {
|
impl sealed::Instance for peripherals::$inst {
|
||||||
fn regs() -> &'static crate::pac::bxcan::Can {
|
fn regs() -> &'static crate::pac::can::Can {
|
||||||
&crate::pac::$inst
|
&crate::pac::$inst
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -98,26 +98,21 @@ crate::pac::peripherals!(
|
|||||||
const REGISTERS: *mut bxcan::RegisterBlock = crate::pac::$inst.0 as *mut _;
|
const REGISTERS: *mut bxcan::RegisterBlock = crate::pac::$inst.0 as *mut _;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// (bxcan, CAN) => {
|
|
||||||
// unsafe impl bxcan::FilterOwner for Can<peripherals::CAN> {
|
|
||||||
// const NUM_FILTER_BANKS: u8 = 14;
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
);
|
);
|
||||||
|
|
||||||
crate::pac::peripherals!(
|
crate::pac::peripherals!(
|
||||||
// TODO: rename CAN to CAN1 on yaml level??
|
// TODO: rename CAN to CAN1 on yaml level??
|
||||||
(bxcan, CAN) => {
|
(can, CAN) => {
|
||||||
unsafe impl bxcan::FilterOwner for peripherals::CAN {
|
unsafe impl bxcan::FilterOwner for peripherals::CAN {
|
||||||
const NUM_FILTER_BANKS: u8 = 14;
|
const NUM_FILTER_BANKS: u8 = 14;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(bxcan, CAN1) => {
|
(can, CAN1) => {
|
||||||
unsafe impl bxcan::FilterOwner for peripherals::CAN1 {
|
unsafe impl bxcan::FilterOwner for peripherals::CAN1 {
|
||||||
const NUM_FILTER_BANKS: u8 = 14;
|
const NUM_FILTER_BANKS: u8 = 14;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
(bxcan, CAN2) => {
|
(can, CAN2) => {
|
||||||
// TODO: when CAN2 existis, we have 28 filter banks
|
// TODO: when CAN2 existis, we have 28 filter banks
|
||||||
unsafe impl bxcan::MasterInstance for peripherals::CAN1 {}
|
unsafe impl bxcan::MasterInstance for peripherals::CAN1 {}
|
||||||
};
|
};
|
||||||
@ -136,10 +131,10 @@ macro_rules! impl_pin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
crate::pac::peripheral_pins!(
|
crate::pac::peripheral_pins!(
|
||||||
($inst:ident, bxcan, CAN, $pin:ident, TX, $af:expr) => {
|
($inst:ident, can, CAN, $pin:ident, TX, $af:expr) => {
|
||||||
impl_pin!($inst, $pin, TxPin, $af);
|
impl_pin!($inst, $pin, TxPin, $af);
|
||||||
};
|
};
|
||||||
($inst:ident, bxcan, CAN, $pin:ident, RX, $af:expr) => {
|
($inst:ident, can, CAN, $pin:ident, RX, $af:expr) => {
|
||||||
impl_pin!($inst, $pin, RxPin, $af);
|
impl_pin!($inst, $pin, RxPin, $af);
|
||||||
};
|
};
|
||||||
);
|
);
|
5
embassy-stm32/src/can/mod.rs
Normal file
5
embassy-stm32/src/can/mod.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#![macro_use]
|
||||||
|
|
||||||
|
#[cfg_attr(can_bxcan, path = "bxcan.rs")]
|
||||||
|
mod _version;
|
||||||
|
pub use _version::*;
|
@ -27,8 +27,8 @@ mod time_driver;
|
|||||||
|
|
||||||
#[cfg(adc)]
|
#[cfg(adc)]
|
||||||
pub mod adc;
|
pub mod adc;
|
||||||
#[cfg(bxcan)]
|
#[cfg(can)]
|
||||||
pub mod bxcan;
|
pub mod can;
|
||||||
#[cfg(dac)]
|
#[cfg(dac)]
|
||||||
pub mod dac;
|
pub mod dac;
|
||||||
#[cfg(dbgmcu)]
|
#[cfg(dbgmcu)]
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
mod example_common;
|
mod example_common;
|
||||||
|
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use embassy_stm32::bxcan::{Can, Frame, StandardId};
|
use embassy_stm32::can::{Can, Frame, StandardId};
|
||||||
use embassy_stm32::dbgmcu::Dbgmcu;
|
use embassy_stm32::dbgmcu::Dbgmcu;
|
||||||
use example_common::*;
|
use example_common::*;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user