Remove usage of old PAC

Formatting
This commit is contained in:
Corey Schuhen 2024-03-07 08:11:10 +10:00
parent 65b38cf755
commit 9ba379fb9e
2 changed files with 2 additions and 14 deletions

View File

@ -29,8 +29,6 @@ mod frame;
mod id; mod id;
#[allow(clippy::all)] // generated code #[allow(clippy::all)] // generated code
mod pac;
use core::cmp::{Ord, Ordering}; use core::cmp::{Ord, Ordering};
use core::convert::{Infallible, TryInto}; use core::convert::{Infallible, TryInto};
use core::marker::PhantomData; use core::marker::PhantomData;
@ -38,10 +36,8 @@ use core::mem;
pub use id::{ExtendedId, Id, StandardId}; pub use id::{ExtendedId, Id, StandardId};
use self::pac::generic::*;
use crate::can::bx::filter::MasterFilters; use crate::can::bx::filter::MasterFilters;
pub use crate::can::bx::frame::{Data, Frame, FramePriority}; pub use crate::can::bx::frame::{Data, Frame, FramePriority};
pub use crate::can::bx::pac::can::RegisterBlock; // To make the PAC extraction build
/// A bxCAN peripheral instance. /// A bxCAN peripheral instance.
/// ///
@ -56,10 +52,7 @@ pub use crate::can::bx::pac::can::RegisterBlock; // To make the PAC extraction b
/// register block. /// register block.
/// * `REGISTERS` is a pointer to that peripheral's register block and can be safely accessed for as /// * `REGISTERS` is a pointer to that peripheral's register block and can be safely accessed for as
/// long as ownership or a borrow of the implementing type is present. /// long as ownership or a borrow of the implementing type is present.
pub unsafe trait Instance { pub unsafe trait Instance {}
/// Pointer to the instance's register block.
const REGISTERS: *mut RegisterBlock;
}
/// A bxCAN instance that owns filter banks. /// A bxCAN instance that owns filter banks.
/// ///

View File

@ -509,8 +509,6 @@ pub(crate) mod sealed {
} }
pub trait Instance { pub trait Instance {
const REGISTERS: *mut crate::can::bx::RegisterBlock;
fn regs() -> crate::pac::can::Can; fn regs() -> crate::pac::can::Can;
fn state() -> &'static State; fn state() -> &'static State;
} }
@ -531,14 +529,11 @@ pub trait Instance: sealed::Instance + RccPeripheral + 'static {
/// BXCAN instance newtype. /// BXCAN instance newtype.
pub struct BxcanInstance<'a, T>(PeripheralRef<'a, T>); pub struct BxcanInstance<'a, T>(PeripheralRef<'a, T>);
unsafe impl<'d, T: Instance> crate::can::bx::Instance for BxcanInstance<'d, T> { unsafe impl<'d, T: Instance> crate::can::bx::Instance for BxcanInstance<'d, T> {}
const REGISTERS: *mut crate::can::bx::RegisterBlock = T::REGISTERS;
}
foreach_peripheral!( foreach_peripheral!(
(can, $inst:ident) => { (can, $inst:ident) => {
impl sealed::Instance for peripherals::$inst { impl sealed::Instance for peripherals::$inst {
const REGISTERS: *mut crate::can::bx::RegisterBlock = crate::pac::$inst.as_ptr() as *mut _;
fn regs() -> crate::pac::can::Can { fn regs() -> crate::pac::can::Can {
crate::pac::$inst crate::pac::$inst