Skip to content

Commit

Permalink
RT118x clock initialization (#185)
Browse files Browse the repository at this point in the history
* Clock configuration for RT118x

* Add clock init call to the bsp

* Remove hard-dependency on `defmt`
  • Loading branch information
glaeqen authored Jan 15, 2025
1 parent d5ce8e9 commit 0e274f4
Show file tree
Hide file tree
Showing 4 changed files with 1,976 additions and 11 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ license = { workspace = true }
edition = { workspace = true }
version = "0.6.0"

[dependencies.cortex-m]
version = "0.7"

[dependencies.cfg-if]
version = "1.0"

Expand Down Expand Up @@ -154,7 +157,6 @@ codegen-units = 256
######################################

[dev-dependencies]
cortex-m = "0.7"
imxrt-rt = { workspace = true }
menu = "0.3.2"
rtic = { version = "2.0", features = ["thumbv7-backend"] }
Expand Down
29 changes: 24 additions & 5 deletions board/src/imxrt1180evk-cm33.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,31 @@ pub struct Specifics {

impl Specifics {
pub(crate) fn new(_: &mut crate::Common) -> Self {
let iomuxc = unsafe { ral::iomuxc::IOMUXC::instance() };
let iomuxc_aon = unsafe { ral::iomuxc_aon::IOMUXC_AON::instance() };
let pads = imxrt_hal::iomuxc::into_pads(iomuxc, iomuxc_aon);
let ral::Instances {
IOMUXC,
IOMUXC_AON,
RGPIO4,
mut ANADIG_OSC,
mut ANADIG_PLL,
mut ANADIG_PMU,
mut CCM,
mut DCDC,
mut PHY_LDO,
..
} = unsafe { ral::Instances::instances() };

let gpio4 = unsafe { ral::rgpio::RGPIO4::instance() };
let mut gpio4 = imxrt_hal::rgpio::Port::new(gpio4);
imxrt_hal::ccm::init(
&mut ANADIG_OSC,
&mut ANADIG_PLL,
&mut ANADIG_PMU,
&mut CCM,
&mut DCDC,
&mut PHY_LDO,
);

let pads = imxrt_hal::iomuxc::into_pads(IOMUXC, IOMUXC_AON);

let mut gpio4 = imxrt_hal::rgpio::Port::new(RGPIO4);
let led = gpio4.output(pads.gpio_ad.p27);

Specifics { led }
Expand Down
Loading

0 comments on commit 0e274f4

Please # to comment.