Bare Metal Programming Tool Kit
|
input port interface More...
#include <ports.h>
Public Types | |
enum | { type = type_port_in } |
identify this type as a type_port_in | |
enum | { features = has_none } |
this type has no additional fatures | |
Static Public Member Functions | |
static void | init () |
initialize the port as input | |
static int | n_pins () |
the number of pins in the port, can be 0..32. | |
static unsigned int | get () |
get the current values of the pins in the port | |
input port interface
This class defines the interface of an input port, which consists (at least conceptually) of 0..32 input pins (each as defined by the pin_in interface).
This class is to be used as parent class for classes that provide the port_in interface.
|
static |
get the current values of the pins in the port
This method returns the current level on the pins that make up the port, encoded in the bits in the returned value. The value pin of pin N is returned in the Nth bit.
When the level is a logic one (high voltage, Vdd) the bit in the returned value is 1, otherwise (logic zero, low level, Vss) the bit is 0.
The init() method must be called first.
|
static |
initialize the port as input
This method initializes all pins of the port as input pins. This might involve configuring the pins as gpio, and disabling analog or other special functions.