Function highest_freq_in
pub const fn highest_freq_in(
range: RangeInclusive<Rate<u32, 1000, 1>>,
) -> Frequency
Available on crate feature
spi
only.Expand description
Returns the highest SPI frequency available on the MCU that fits into the requested range.
§Examples
Assuming the MCU is only able to do up to 8 MHz:
let freq = const { highest_freq_in(Kilohertz::kHz(200)..=Kilohertz::MHz(16)) };
assert_eq!(freq, hal::spi::main::Frequency::F(Kilohertz::MHz(8)));
§Panics
This function is only intended to be used in a const
context.
It panics if no suitable frequency can be found.