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_out Struct Reference

output port interface More...

#include <ports.h>

Inheritance diagram for bmptk::hardware::port_out:
bmptk::hardware::port_buffer_out< channel > bmptk::hardware::port_out_from_pins<> bmptk::hardware::port_buffer_out< hc595_channel< channel > > bmptk::chips::hc595< channel >

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
 

Detailed Description

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.

Definition at line 91 of file ports.h.

Member Function Documentation

static void bmptk::hardware::port_out::init ( )
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 void bmptk::hardware::port_out::set ( unsigned int  d)
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.


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