Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Types | Static Public Member Functions | List of all members
bmptk::hardware::port_in Struct Reference

input port interface More...

#include <ports.h>

Inheritance diagram for bmptk::hardware::port_in:
bmptk::hardware::port_buffer_in< channel > bmptk::hardware::port_in_from_pins<>

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
 

Detailed Description

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.

Definition at line 50 of file ports.h.

Member Function Documentation

static unsigned int bmptk::hardware::port_in::get ( )
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 void bmptk::hardware::port_in::init ( )
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.


The documentation for this struct was generated from the following file: