Trait opentitanlib::io::gpio::GpioMonitoring
source · pub trait GpioMonitoring {
// Required methods
fn get_clock_nature(&self) -> Result<ClockNature>;
fn monitoring_start(
&self,
pins: &[&dyn GpioPin]
) -> Result<MonitoringStartResponse>;
fn monitoring_read(
&self,
pins: &[&dyn GpioPin],
continue_monitoring: bool
) -> Result<MonitoringReadResponse>;
}
Expand description
A trait implemented by transports which support advanced edge-detection on GPIO pins. This trait allows monitoring a set of pins, and getting a stream of “events” (rising and falling edges with timestamps) for any change among the set.
Required Methods§
fn get_clock_nature(&self) -> Result<ClockNature>
sourcefn monitoring_start(
&self,
pins: &[&dyn GpioPin]
) -> Result<MonitoringStartResponse>
fn monitoring_start( &self, pins: &[&dyn GpioPin] ) -> Result<MonitoringStartResponse>
Set up edge trigger detection on the given set of pins, transport will buffer the list internally, return the initial level of each of the given pins.
sourcefn monitoring_read(
&self,
pins: &[&dyn GpioPin],
continue_monitoring: bool
) -> Result<MonitoringReadResponse>
fn monitoring_read( &self, pins: &[&dyn GpioPin], continue_monitoring: bool ) -> Result<MonitoringReadResponse>
Retrieve list of events detected thus far, optionally stopping the possibly expensive edge
detection. Buffer overrun will be reported as an Err
, and result in the stopping of the
edge detection irrespective of the parameter value.