From #39 (comment).
It is currently not possible to write a generic function in downstream code which calls read_multiple() with matching trait bounds. The problem is that some of the traits used by read_multiple() are internal to port-expander. We should find a way to fix this.
Motivating example which currently does not work:
fn poll_external_io<'a, PD, MUTEX, MODE: port_expander::mode::HasInput>(
motion_sensor: &mut MotionSensor,
estop_gpio: &port_expander::Pin<'a, MODE, MUTEX>,
sensor_gpio: &port_expander::Pin<'a, MODE, MUTEX>,
) where
PD: port_expander::PortDriver,
MUTEX: port_expander::PortMutex<Port = PD>,
{
let read = port_expander::read_multiple([estop_gpio, sensor_gpio]);
todo!()
}