SPI improvements / Clock passing update

1. Using `impl Into<Hertz>` instead of Hertz now to increase
   usability for users
2. Update for SPI API to increase usability
This commit is contained in:
2021-11-21 20:14:56 +01:00
parent e5dba61d6c
commit 4feb74e4a6
5 changed files with 71 additions and 26 deletions

View File

@ -40,9 +40,9 @@ pub enum FilterClkSel {
/// 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: Hertz) {
pub fn set_sys_clock(freq: impl Into<Hertz>) {
interrupt::free(|cs| {
SYS_CLOCK.borrow(cs).set(freq).ok();
SYS_CLOCK.borrow(cs).set(freq.into()).ok();
})
}