I am trying to create a generic library interface for a piece of hardware that can use several GPIO pins, but I can't seem to figure out how to define them to pack into a struct for handling them. I have several output pins defined as such:
let dp = arduino_uno::Peripherals::take().unwrap(); let mut pins = arduino_uno::Pins::new(dp.PORTB, dp.PORTC, dp.PORTD); let mut en_pin = pins.d7.into_output(&mut pins.ddr); let mut rs_pin = pins.d6.into_output(&mut pins.ddr); let mut rw_pin = pins.d5.into_output(&mut pins.ddr);
Now I'd like to drop them in a struct and allow them to be chosen as needed for each project. The pins en, rs, and rw won't necessarily always be d7, d6, and d5. However, I can't seem to figure out the correct type to store them as.