diff options
Diffstat (limited to 'embassy-nxp/src/lib.rs')
| -rw-r--r-- | embassy-nxp/src/lib.rs | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/embassy-nxp/src/lib.rs b/embassy-nxp/src/lib.rs new file mode 100644 index 000000000..80fdecb2e --- /dev/null +++ b/embassy-nxp/src/lib.rs | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | #![no_std] | ||
| 2 | |||
| 3 | pub mod gpio; | ||
| 4 | mod pac_utils; | ||
| 5 | pub mod pint; | ||
| 6 | |||
| 7 | pub use embassy_hal_internal::{into_ref, Peripheral, PeripheralRef}; | ||
| 8 | pub use lpc55_pac as pac; | ||
| 9 | |||
| 10 | /// Initialize the `embassy-nxp` HAL with the provided configuration. | ||
| 11 | /// | ||
| 12 | /// This returns the peripheral singletons that can be used for creating drivers. | ||
| 13 | /// | ||
| 14 | /// This should only be called once and at startup, otherwise it panics. | ||
| 15 | pub fn init(_config: config::Config) -> Peripherals { | ||
| 16 | gpio::init(); | ||
| 17 | pint::init(); | ||
| 18 | |||
| 19 | crate::Peripherals::take() | ||
| 20 | } | ||
| 21 | |||
| 22 | embassy_hal_internal::peripherals! { | ||
| 23 | // External pins. These are not only GPIOs, they are multi-purpose pins and can be used by other | ||
| 24 | // peripheral types (e.g. I2C). | ||
| 25 | PIO0_0, | ||
| 26 | PIO0_1, | ||
| 27 | PIO0_2, | ||
| 28 | PIO0_3, | ||
| 29 | PIO0_4, | ||
| 30 | PIO0_5, | ||
| 31 | PIO0_6, | ||
| 32 | PIO0_7, | ||
| 33 | PIO0_8, | ||
| 34 | PIO0_9, | ||
| 35 | PIO0_10, | ||
| 36 | PIO0_11, | ||
| 37 | PIO0_12, | ||
| 38 | PIO0_13, | ||
| 39 | PIO0_14, | ||
| 40 | PIO0_15, | ||
| 41 | PIO0_16, | ||
| 42 | PIO0_17, | ||
| 43 | PIO0_18, | ||
| 44 | PIO0_19, | ||
| 45 | PIO0_20, | ||
| 46 | PIO0_21, | ||
| 47 | PIO0_22, | ||
| 48 | PIO0_23, | ||
| 49 | PIO0_24, | ||
| 50 | PIO0_25, | ||
| 51 | PIO0_26, | ||
| 52 | PIO0_27, | ||
| 53 | PIO0_28, | ||
| 54 | PIO0_29, | ||
| 55 | PIO0_30, | ||
| 56 | PIO0_31, | ||
| 57 | PIO1_0, | ||
| 58 | PIO1_1, | ||
| 59 | PIO1_2, | ||
| 60 | PIO1_3, | ||
| 61 | PIO1_4, | ||
| 62 | PIO1_5, | ||
| 63 | PIO1_6, | ||
| 64 | PIO1_7, | ||
| 65 | PIO1_8, | ||
| 66 | PIO1_9, | ||
| 67 | PIO1_10, | ||
| 68 | PIO1_11, | ||
| 69 | PIO1_12, | ||
| 70 | PIO1_13, | ||
| 71 | PIO1_14, | ||
| 72 | PIO1_15, | ||
| 73 | PIO1_16, | ||
| 74 | PIO1_17, | ||
| 75 | PIO1_18, | ||
| 76 | PIO1_19, | ||
| 77 | PIO1_20, | ||
| 78 | PIO1_21, | ||
| 79 | PIO1_22, | ||
| 80 | PIO1_23, | ||
| 81 | PIO1_24, | ||
| 82 | PIO1_25, | ||
| 83 | PIO1_26, | ||
| 84 | PIO1_27, | ||
| 85 | PIO1_28, | ||
| 86 | PIO1_29, | ||
| 87 | PIO1_30, | ||
| 88 | PIO1_31, | ||
| 89 | } | ||
| 90 | |||
| 91 | /// HAL configuration for the NXP board. | ||
| 92 | pub mod config { | ||
| 93 | #[derive(Default)] | ||
| 94 | pub struct Config {} | ||
| 95 | } | ||
