avr-classes
|
#include <outputshiftregisterport.h>
Public Member Functions | |
OutputShiftRegisterPort (OutputShiftRegister *shiftRegister, bool autoFlush=true) | |
bool | getAutoFlush (void) const |
void | setAutoFlush (bool state) |
virtual void | setValue (uint8_t value, uint8_t mask=0xff) override |
void | flush (void) |
Protected Attributes | |
OutputShiftRegister *const | m_shiftRegister |
Class that implements an OutputPort using a shift register. It uses the OutputShiftRegister interface that defines only a data and clock line, thus there will be always 8 bits transported (instead of clearing the register and making use of leading zeros). You can define OutputPortPin instances on top of the OutputPort which will work just like regular OutputPins, just a bit slower. When having the property autoFlush set, each write access to the OutputShiftRegisterPort will directly be transferred to the associated device. If autoFlush is not set, multiple write actions can be accumulated before transferring them to the device explicitly using the flush() method.
|
inline |
Constructor.
shiftRegister | Pointer to OutputShiftRegister instance to be used as output device. |
autoFlush | Value of autoFlush property, defaulting to true. |
|
inline |
Excplicitly transferrs internal value to the associated device.
|
inline |
Getter for current value of autoFlush property.
|
inline |
Setter for value of autoFlush property.
state | New value for autoFlush property, true means that autoFlush is active. |
|
inlineoverridevirtual |
Setter for 8 bit OutputPort value. Depending on the state of the autoFlush property this directly triggers a writing operation to the associated device (autoFlush = true), or updates the internal value only (autoFlush = false). When autoFlush is inactive, the value must be transferred explicitly using flush().
value | Value to be set. |
mask | Mask with pins to manipulate according to value. |
Implements OutputPort.
|
protected |
Pointer to OutputShiftRegister instance to be used as output device.