![]() |
Bare Metal Programming Tool Kit
|
template for a buffered 8-bit input port More...
#include <ports.h>
Public Types | |
typedef single_pin< 0 > | pin_0 |
pin 0, input_only | |
typedef single_pin< 1 > | pin_1 |
pin 1, input_only | |
typedef single_pin< 2 > | pin_2 |
pin 2, input_only | |
typedef single_pin< 3 > | pin_3 |
pin 3, input_only | |
typedef single_pin< 4 > | pin_4 |
pin 4,input_only | |
typedef single_pin< 5 > | pin_5 |
pin 5, input_only | |
typedef single_pin< 6 > | pin_6 |
pin 6, input_only | |
typedef single_pin< 7 > | pin_7 |
pin 7, input_only | |
![]() | |
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 () |
return the number of pins in this port (8) | |
static unsigned int | get () |
get the current values of the pins in the port | |
![]() | |
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 | |
template for a buffered 8-bit input port
This template must be instantiated with a port_bufferedinc_channel that implements the access to the chip that has the pins.
|
inlinestatic |
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. Note that after setting a pin low(0) the pin will in all probability read as 0, so this call only makes realy sense for pins set high (1) call.
|
inlinestatic |