Struct rustpi_io::gpio::GPIO [] [src]

pub struct GPIO { /* fields omitted */ }

A software representation for a GPIO pin of the raspberry pi.

Methods

impl GPIO
[src]

[src]

Returns the configured pin of the GPIO struct.

[src]

Returns the configured mode of the GPIO struct.

[src]

Changes the mode of the pin and writes the corresponding value to the fitting direction file

[src]

Initializes the gpio. Exports the pin with the /sys/class/gpio/export file and calls the set_mode() function with the given mode. Returns an Error if the gpio was already exported earlier (inside or outside of the application)

[src]

Reads the current value of the pin in both Read and Write mode. Returns an Error if a value other than "1" or "0" is read

[src]

Sets the value of the gpio to HIGH or LOW Returns an Error if the GPIO::Mode is not Write

Trait Implementations

impl Drop for GPIO
[src]

Closes the gpio and write its pin number into /sys/class/gpio/unexport

[src]

Executes the destructor for this type. Read more