Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
List of all members
bmptk::hardware::tee<> Class Template Reference

one out_pin that represents any number of pin_out's More...

#include <pins.h>

Inheritance diagram for bmptk::hardware::tee<>:
bmptk::hardware::pin_out bmptk::hardware::pin_out

Additional Inherited Members

- Public Types inherited from bmptk::hardware::pin_out
enum  { type = type_pin_out }
 identify this type as a type_pin_out
 
enum  { features = has_none }
 this type has no additional fatures
 
- Static Public Member Functions inherited from bmptk::hardware::pin_out
static void init ()
 initialize the pin as output
 
static void set (bool x)
 set the current level on the pin
 

Detailed Description

template<typename...>
class bmptk::hardware::tee<>

one out_pin that represents any number of pin_out's

This class template is used to construct a single out_pin class from any number of specified downstream out_pin classes, or from all pins in an out_port. Calling init() or set() on the tee class causes the corresponding method to be called for all downstream out_pin classes (or for the underlying out_port). Hence the effect is that one out_pin can represent a bunch of out_pin's, as if they were fitted together using tee fittings.

A tee with zero parameters is a kind of dummy point: you can cann init() and set() on it, but to no effect at all.

The typename template arguments must be classes that are descendants of pin_out, or a single class that is a decendant of port_out.

Example (examples/db103/wiggle/main.cpp):

// show a 'wiggle' pattern (= alternating 0xAAA and 0x555) on 12 LEDs
#include "bmptk.h"
bmptk::target::gpio_0_4,
bmptk::hardware::invert< bmptk::target::gpio_0_5 >,
bmptk::target::gpio_0_6,
bmptk::hardware::invert< bmptk::target::gpio_0_7 >,
bmptk::target::gpio_1_0,
bmptk::hardware::invert< bmptk::target::gpio_1_1 >,
bmptk::target::gpio_1_2,
bmptk::hardware::invert< bmptk::target::gpio_1_3 >,
bmptk::target::gpio_1_4,
bmptk::hardware::invert< bmptk::target::gpio_1_5 >,
bmptk::target::gpio_1_8,
> leds;
int main( void ){
bmptk::hardware::blink< leds >();
}

Definition at line 782 of file pins.h.


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