[−][src]Struct matrix_rhal::gpio::Gpio
Controls the GPIO pins on a MATRIX device.
Methods
impl<'a> Gpio<'a>
[src]
impl<'a> Gpio<'a>
[src]
pub fn get_state(&self, pin: u8) -> bool
[src]
Returns the current digital value of a MATRIX GPIO pin (0->15).
pub fn get_states(&self) -> [bool; 16]
[src]
Returns the current digital value of every MATRIX GPIO pin (0->15)
impl<'a> Gpio<'a>
[src]
pub fn set_config<T>(&self, pin: u8, config: T) -> Result<(), Error> where
T: PinConfig,
[src]
T: PinConfig,
Configure a specific pin's mode, function, state, etc..
pub fn set_configs<T>(&self, pins: &[u8], config: T) -> Result<(), Error> where
T: PinConfig,
[src]
T: PinConfig,
Configure multiple pins' mode, function, state, etc..
pub fn set_prescaler(&self, bank: usize, prescaler: u16) -> Result<(), Error>
[src]
Set the prescaler value for a specific bank
pub fn set_pwm(
&self,
pin: u8,
frequency: f32,
percentage: f32
) -> Result<(), Error>
[src]
&self,
pin: u8,
frequency: f32,
percentage: f32
) -> Result<(), Error>
Set the Pulse Width Modulation output for a pin.
pub fn set_servo_angle(
&self,
pin: u8,
angle: u32,
min_pulse_ms: f32
) -> Result<(), Error>
[src]
&self,
pin: u8,
angle: u32,
min_pulse_ms: f32
) -> Result<(), Error>
Abstraction over set_pwm
to easily control a servo.
min_pulse_ms
accepts values from 0
to 1.5
. Inputs outside this range will be set to the closest valid number.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for Gpio<'a>
impl<'a> Send for Gpio<'a>
impl<'a> Sync for Gpio<'a>
impl<'a> Unpin for Gpio<'a>
impl<'a> UnwindSafe for Gpio<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,