FreeNOS
|
Broadcom (2835) GPIO controller implementation. More...
#include <BroadcomGPIO.h>
Public Types | |
enum | Mode { Input = 0, Output = 1, Function0 = 4, Function1 = 5, Function2 = 6, Function3 = 7, Function4 = 3, Function5 = 2 } |
Pin modes. More... | |
enum | Result { Success, NotFound, IOError } |
Result code. More... | |
Public Member Functions | |
BroadcomGPIO () | |
Constructor. More... | |
virtual Result | initialize () |
Initialize the Controller. More... | |
virtual Result | setAltFunction (Size pin, uint function) |
Set alternate function. More... | |
Private Types | |
enum | Registers { FunctionSelect0 = 0 } |
Hardware registers. More... | |
Private Attributes | |
Arch::IO | m_io |
I/O instance. More... | |
Static Private Attributes | |
static const Address | GPIOBase = 0x200000 |
Broadcom (2835) GPIO controller implementation.
Definition at line 38 of file BroadcomGPIO.h.
enum BroadcomGPIO::Mode |
Pin modes.
Enumerator | |
---|---|
Input | |
Output | |
Function0 | |
Function1 | |
Function2 | |
Function3 | |
Function4 | |
Function5 |
Definition at line 57 of file BroadcomGPIO.h.
|
private |
enum BroadcomGPIO::Result |
BroadcomGPIO::BroadcomGPIO | ( | ) |
Constructor.
Definition at line 21 of file BroadcomGPIO.cpp.
|
virtual |
Initialize the Controller.
Definition at line 25 of file BroadcomGPIO.cpp.
References Memory::Device, GPIOBase, IOError, m_io, IO::map(), PAGESIZE, Memory::Readable, IO::Success, Success, Memory::User, and Memory::Writable.
|
virtual |
Set alternate function.
pin | Pin number to set. |
function | Alternate function number to set. |
Definition at line 35 of file BroadcomGPIO.cpp.
References FunctionSelect0, m_io, ARMIO::set(), and Success.
|
staticprivate |
Definition at line 42 of file BroadcomGPIO.h.
Referenced by initialize().
|
private |
I/O instance.
Definition at line 106 of file BroadcomGPIO.h.
Referenced by initialize(), and setAltFunction().