diff options
| author | Raul Alimbekov <[email protected]> | 2025-12-16 09:05:22 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-16 09:05:22 +0300 |
| commit | c9a04b4b732b7a3b696eb8223664c1a7942b1875 (patch) | |
| tree | 6dbe5c02e66eed8d8762f13f95afd24f8db2b38c /embassy-nxp/src/lib.rs | |
| parent | cde24a3ef1117653ba5ed4184102b33f745782fb (diff) | |
| parent | 5ae6e060ec1c90561719aabdc29d5b6e7b8b0a82 (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'embassy-nxp/src/lib.rs')
| -rw-r--r-- | embassy-nxp/src/lib.rs | 26 |
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. |
| 4 | pub(crate) mod fmt; | 5 | pub(crate) mod fmt; |
| @@ -9,8 +10,15 @@ pub mod gpio; | |||
| 9 | #[cfg(feature = "lpc55-core0")] | 10 | #[cfg(feature = "lpc55-core0")] |
| 10 | pub mod pint; | 11 | pub mod pint; |
| 11 | #[cfg(feature = "lpc55-core0")] | 12 | #[cfg(feature = "lpc55-core0")] |
| 13 | pub mod pwm; | ||
| 14 | #[cfg(feature = "lpc55-core0")] | ||
| 15 | pub mod sct; | ||
| 16 | #[cfg(feature = "lpc55-core0")] | ||
| 12 | pub mod usart; | 17 | pub mod usart; |
| 13 | 18 | ||
| 19 | #[cfg(rt1xxx)] | ||
| 20 | mod 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")] |
| 23 | mod chip; | 31 | mod chip; |
| 24 | 32 | ||
| 25 | // TODO: Remove when this module is implemented for other chips | 33 | pub use chip::{Peripherals, interrupt, peripherals}; |
| 26 | #[cfg(feature = "lpc55-core0")] | 34 | pub use embassy_hal_internal::{Peri, PeripheralType}; |
| 27 | pub use chip::interrupt; | ||
| 28 | #[cfg(feature = "unstable-pac")] | 35 | #[cfg(feature = "unstable-pac")] |
| 29 | pub use chip::pac; | 36 | pub use nxp_pac as pac; |
| 30 | #[cfg(not(feature = "unstable-pac"))] | 37 | #[cfg(not(feature = "unstable-pac"))] |
| 31 | pub(crate) use chip::pac; | 38 | pub(crate) use nxp_pac as pac; |
| 32 | pub use chip::{peripherals, Peripherals}; | ||
| 33 | pub 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(); |
