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