Gets access to the default GPIO chip and lazily opens it if not yet open.
(&mut self)
| 47 | impl RppalPins { |
| 48 | /// Gets access to the default GPIO chip and lazily opens it if not yet open. |
| 49 | fn get_chip(&mut self) -> io::Result<&mut gpio::Gpio> { |
| 50 | if self.chip.is_none() { |
| 51 | self.chip = Some(gpio::Gpio::new().map_err(gpio_error_to_io_error)?); |
| 52 | } |
| 53 | Ok(self.chip.as_mut().unwrap()) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | impl Pins for RppalPins { |