Enum blinkt::GPIOError
[−]
[src]
pub enum GPIOError { InvalidPin(u8), UnknownMode(u8), UnknownSoC, DevGPIOMemNotFound, DevGPIOMemPermissionDenied, DevGPIOMemIOError(Error), DevGPIOMemMapFailed, DevMemNotFound, DevMemPermissionDenied, DevMemIOError(Error), DevMemMapFailed, PermissionDenied, 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 SoC.
Based on the output of /proc/cpuinfo
, it wasn't possible to identify the Raspberry Pi's SoC.
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
.
PermissionDenied
Permission denied when opening both /dev/gpiomem
and /dev/mem
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.
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
.
NotInitialized
GPIO isn't initialized.
You should normally only see this error when you call a method after
running cleanup()
.
Trait Implementations
impl Display for Error
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Error for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
The lower-level cause of this error, if any. Read more