Enum blinkt::GPIOError
[−]
pub enum GPIOError { InvalidPin(u8), UnknownMode(u8), UnknownSoC, DevGPIOMemNotFound, DevGPIOMemPermissionDenied, DevGPIOMemIOError(Error), DevGPIOMemMapFailed, DevMemNotFound, DevMemPermissionDenied, DevMemIOError(Error), DevMemMapFailed, NotInitialized, }
Errors that can occur when accessing the GPIO peripheral.
Variants
InvalidPin(u8)
Invalid GPIO pin number.
The GPIO pin number is not accessible on this Raspberry Pi model.
UnknownMode(u8)
Unknown GPIO pin mode.
The GPIO pin is set to an unknown mode.
UnknownSoC
Unknown Raspberry Pi model or SoC.
Based on the output of /proc/cpuinfo
, it wasn't possible to identify the Raspberry Pi model.
DevGPIOMemNotFound
Unable to find /dev/gpiomem
in the filesystem.
Try upgrading to a more recent version of Raspbian (or
equivalent) that implements /dev/gpiomem
.
DevGPIOMemPermissionDenied
Permission denied when opening /dev/gpiomem
for read/write access.
Make sure the user has read and write access to /dev/gpiomem
.
Common causes are either incorrect file permissions on
/dev/gpiomem
, or the user isn't part of the gpio group.
DevGPIOMemIOError(Error)
/dev/gpiomem
IO error.
DevGPIOMemMapFailed
Unable to memory-map /dev/gpiomem
.
DevMemNotFound
Unable to find /dev/mem
in the filesystem.
DevMemPermissionDenied
Permission denied when opening /dev/mem
for read/write access.
Getting read and write access to /dev/mem
is typically
accomplished by executing the program as a privileged user through
sudo
. A better solution that doesn't require sudo
would be to
upgrade to a version of Raspbian that implements /dev/gpiomem
.
DevMemIOError(Error)
/dev/mem
IO error.
DevMemMapFailed
Unable to memory-map /dev/mem
.
NotInitialized
GPIO isn't initialized.
You should normally only see this error when you call a method after
running cleanup()
.