[−][src]Crate c2_mmap_gpio
This crate exposes GPIO interface of ODROID-C2 SBC for programmatic use in Rust.
Only revision 2 of the board is supported by this crate. I don't have an access to other devices. If you happen to have one and want to use this library,
you can fork it and replace certain parts of it. You may need to modify RegistersOffsets
, base address inside Device
struct and change PinId
enum as needed.
If you happen to do it, contributions are more than welcome!
Basic abstractions for GPIO pins (InputPin
, OutputPin
) implements relevant embedded_hal
abstractions so this crate can be used with driver implementations using embedded_hal
generic traits.
Code has been tested on ODROID-C2 rev2 device using Ubuntu 18.04 LTS operating system.
This project is in a very early stage of development and is done by embedded systems amateur. Complete rewrites of abstractions are possible!
Structs
Device | The main abstraction for Odroid C2's device. |
InputPin | Abstraction over GPIO pin set to input (reading) direction. |
OutputPin | Abstraction over GPIO pin set to output (writing) direction. |
Enums
DeviceError | Enum representing possible failures when initializing the device. |
OdroidC2Error | Main error type for this crate. |
PinError | Enum representing possible failures when working with abstract GPIO pins. |
PinId | Mapping from physical position of GPIO pins on the ODROID-C2 to internal identifiers of GPIO pins in memory. |
Value | Enum representing the state of a given pin. |
Type Definitions
OdroidResult |