cleaned up dependencies
This commit is contained in:
@ -13,26 +13,10 @@ categories = ["aerospace", "embedded", "no-std", "hardware-support"]
|
||||
[dependencies]
|
||||
cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
|
||||
cortex-m-rt = "0.7"
|
||||
nb = "1"
|
||||
paste = "1"
|
||||
vorago-shared-periphs = { git = "https://egit.irs.uni-stuttgart.de/rust/vorago-shared-periphs.git", features = ["vor1x"] }
|
||||
embedded-hal = "1"
|
||||
embedded-hal-async = "1"
|
||||
embedded-hal-nb = "1"
|
||||
embedded-io = "0.6"
|
||||
embedded-io-async = "0.6"
|
||||
vorago-shared-periphs = { path = "../../vorago-shared-periphs", features = ["vor1x"] }
|
||||
fugit = "0.3"
|
||||
typenum = "1"
|
||||
critical-section = "1"
|
||||
delegate = ">=0.12, <=0.13"
|
||||
heapless = "0.8"
|
||||
static_cell = "2"
|
||||
thiserror = { version = "2", default-features = false }
|
||||
void = { version = "1", default-features = false }
|
||||
once_cell = { version = "1", default-features = false }
|
||||
va108xx = { version = "0.5", default-features = false, features = ["critical-section", "defmt"] }
|
||||
embassy-sync = "0.6"
|
||||
|
||||
defmt = { version = "0.3", optional = true }
|
||||
|
||||
[target.'cfg(all(target_arch = "arm", target_os = "none"))'.dependencies]
|
||||
@ -43,7 +27,7 @@ portable-atomic = "1"
|
||||
[features]
|
||||
default = ["rt"]
|
||||
rt = ["va108xx/rt"]
|
||||
defmt = ["dep:defmt", "fugit/defmt", "embedded-hal/defmt-03", "vorago-shared-periphs/defmt"]
|
||||
defmt = ["dep:defmt", "vorago-shared-periphs/defmt"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
|
@ -1,29 +1,9 @@
|
||||
//! # API for clock related functionality
|
||||
//!
|
||||
//! This also includes functionality to enable the peripheral clocks
|
||||
use crate::time::Hertz;
|
||||
use cortex_m::interrupt::{self, Mutex};
|
||||
use once_cell::unsync::OnceCell;
|
||||
|
||||
pub use vorago_shared_periphs::gpio::FilterClkSel;
|
||||
pub use vorago_shared_periphs::sysconfig::{disable_peripheral_clock, enable_peripheral_clock};
|
||||
|
||||
static SYS_CLOCK: Mutex<OnceCell<Hertz>> = Mutex::new(OnceCell::new());
|
||||
|
||||
/// The Vorago in powered by an external clock which might have different frequencies.
|
||||
/// The clock can be set here so it can be used by other software components as well.
|
||||
/// The clock can be set exactly once
|
||||
pub fn set_sys_clock(freq: impl Into<Hertz>) {
|
||||
interrupt::free(|cs| {
|
||||
SYS_CLOCK.borrow(cs).set(freq.into()).ok();
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns the configured system clock
|
||||
pub fn get_sys_clock() -> Option<Hertz> {
|
||||
interrupt::free(|cs| SYS_CLOCK.borrow(cs).get().copied())
|
||||
}
|
||||
|
||||
pub fn set_clk_div_register(syscfg: &mut va108xx::Sysconfig, clk_sel: FilterClkSel, div: u32) {
|
||||
match clk_sel {
|
||||
FilterClkSel::SysClk => (),
|
||||
|
Reference in New Issue
Block a user