MCPcopy Index your code
hub / github.com/endbasic/endbasic / get_chip

Method get_chip

rpi/src/gpio.rs:49–54  ·  view source on GitHub ↗

Gets access to the default GPIO chip and lazily opens it if not yet open.

(&mut self)

Source from the content-addressed store, hash-verified

47impl 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
57impl Pins for RppalPins {

Callers 1

setupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected