Merge pull request #163 from bobmcwhirter/syscfg_pac_const

Rework `pac` re-exporting, canonicalize syscfg path, use it plus SYSC…
This commit is contained in:
Dario Nieuwenhuis 2021-05-05 19:50:12 +02:00 committed by GitHub
commit 111dad613a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -15,8 +15,7 @@ use crate::interrupt;
use crate::pac; use crate::pac;
use crate::peripherals; use crate::peripherals;
// TODO hardcoding peripheral addrs until we figure out how these are handled in the metapac const SYSCFG: pac::syscfg::Syscfg = pac::syscfg::Syscfg(crate::chip::SYSCFG_BASE as *mut _);
const SYSCFG: pac::syscfg_f4::Syscfg = pac::syscfg_f4::Syscfg(0x40013800 as *mut _);
const EXTI: pac::exti::Exti = pac::exti::Exti(crate::chip::EXTI_BASE as *mut _); const EXTI: pac::exti::Exti = pac::exti::Exti(crate::chip::EXTI_BASE as *mut _);
const EXTI_COUNT: usize = 16; const EXTI_COUNT: usize = 16;

View File

@ -10,7 +10,18 @@
pub mod fmt; pub mod fmt;
use embassy::interrupt::{Interrupt, InterruptExt}; use embassy::interrupt::{Interrupt, InterruptExt};
pub(crate) use stm32_metapac as pac; //pub(crate) use stm32_metapac as pac;
pub(crate) mod pac {
pub use stm32_metapac::*;
#[cfg(any(feature = "_syscfg_f4"))]
pub use stm32_metapac::syscfg_f4 as syscfg;
#[cfg(any(feature = "_syscfg_l4"))]
pub use stm32_metapac::syscfg_l4 as syscfg;
}
#[macro_use] #[macro_use]
pub mod exti; pub mod exti;