frclib-core 0.2.4

A collection of utilities to be used across the FRC in rust ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12


/// Checks if the specified port is available for digital use.
/// Has a sensible default implementation but can be overriden if needed.
#[allow(clippy::missing_errors_doc)]
pub fn inside_pwm_range(port: u8, value: f64) -> Result<(), GPIOError> {
    if (0.0..=1.0).contains(&value) {
        Ok(())
    } else {
        Err(GPIOError::ValueOutOfRange(value, GPIOPortType::PWM, port))
    }
}