aboutsummaryrefslogtreecommitdiff
path: root/embassy-nxp/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nxp/src/lib.rs')
-rw-r--r--embassy-nxp/src/lib.rs26
1 files changed, 17 insertions, 9 deletions
diff --git a/embassy-nxp/src/lib.rs b/embassy-nxp/src/lib.rs
index f0f0afb6c..4c3dbebb9 100644
--- a/embassy-nxp/src/lib.rs
+++ b/embassy-nxp/src/lib.rs
@@ -1,4 +1,5 @@
1#![no_std] 1#![no_std]
2#![allow(unsafe_op_in_unsafe_fn)]
2 3
3// This mod MUST go first, so that the others see its macros. 4// This mod MUST go first, so that the others see its macros.
4pub(crate) mod fmt; 5pub(crate) mod fmt;
@@ -9,8 +10,15 @@ pub mod gpio;
9#[cfg(feature = "lpc55-core0")] 10#[cfg(feature = "lpc55-core0")]
10pub mod pint; 11pub mod pint;
11#[cfg(feature = "lpc55-core0")] 12#[cfg(feature = "lpc55-core0")]
13pub mod pwm;
14#[cfg(feature = "lpc55-core0")]
15pub mod sct;
16#[cfg(feature = "lpc55-core0")]
12pub mod usart; 17pub mod usart;
13 18
19#[cfg(rt1xxx)]
20mod iomuxc;
21
14#[cfg(feature = "_time_driver")] 22#[cfg(feature = "_time_driver")]
15#[cfg_attr(feature = "time-driver-pit", path = "time_driver/pit.rs")] 23#[cfg_attr(feature = "time-driver-pit", path = "time_driver/pit.rs")]
16#[cfg_attr(feature = "time-driver-rtc", path = "time_driver/rtc.rs")] 24#[cfg_attr(feature = "time-driver-rtc", path = "time_driver/rtc.rs")]
@@ -22,15 +30,12 @@ mod time_driver;
22#[cfg_attr(feature = "mimxrt1062", path = "chips/mimxrt1062.rs")] 30#[cfg_attr(feature = "mimxrt1062", path = "chips/mimxrt1062.rs")]
23mod chip; 31mod chip;
24 32
25// TODO: Remove when this module is implemented for other chips 33pub use chip::{Peripherals, interrupt, peripherals};
26#[cfg(feature = "lpc55-core0")] 34pub use embassy_hal_internal::{Peri, PeripheralType};
27pub use chip::interrupt;
28#[cfg(feature = "unstable-pac")] 35#[cfg(feature = "unstable-pac")]
29pub use chip::pac; 36pub use nxp_pac as pac;
30#[cfg(not(feature = "unstable-pac"))] 37#[cfg(not(feature = "unstable-pac"))]
31pub(crate) use chip::pac; 38pub(crate) use nxp_pac as pac;
32pub use chip::{peripherals, Peripherals};
33pub use embassy_hal_internal::{Peri, PeripheralType};
34 39
35/// Macro to bind interrupts to handlers. 40/// Macro to bind interrupts to handlers.
36/// (Copied from `embassy-rp`) 41/// (Copied from `embassy-rp`)
@@ -67,7 +72,7 @@ macro_rules! bind_interrupts {
67 72
68 $( 73 $(
69 #[allow(non_snake_case)] 74 #[allow(non_snake_case)]
70 #[no_mangle] 75 #[unsafe(no_mangle)]
71 $(#[cfg($cond_irq)])? 76 $(#[cfg($cond_irq)])?
72 unsafe extern "C" fn $irq() { 77 unsafe extern "C" fn $irq() {
73 unsafe { 78 unsafe {
@@ -153,7 +158,10 @@ pub fn init(_config: config::Config) -> Peripherals {
153 gpio::init(); 158 gpio::init();
154 159
155 #[cfg(feature = "lpc55-core0")] 160 #[cfg(feature = "lpc55-core0")]
156 pint::init(); 161 {
162 pint::init();
163 pwm::Pwm::reset();
164 }
157 165
158 #[cfg(feature = "_time_driver")] 166 #[cfg(feature = "_time_driver")]
159 time_driver::init(); 167 time_driver::init();