Bare Metal Programming Tool Kit
|
invert the polarity of a pin or port More...
#include <pins.h>
invert the polarity of a pin or port
This class template is used to create a pin or port class based on an underlying pin or port class. The created pin or port behaves the same as the underlying pin or port, except that any value written (set()) to the created pin or port is inverted (true becomes false, false becomes true) before it is written to the underlying pin or port, and any value that is read (get()) is likewise inverted before it is returned.
The typename template argument must be a pin or port class. The created pin or port is of the same flavour.
Example (examples/db103/wiggle/main.cpp):
This examples creates a display that alternatively lights the even and then the odd numbered LEDs. This is achieved by feeding the odd numbered LEDs the inverted signal.