avr-classes
Public Member Functions | List of all members
OutputShiftRegisterPortWithLatch Class Reference

#include <outputshiftregisterportwithlatch.h>

Inheritance diagram for OutputShiftRegisterPortWithLatch:
OutputShiftRegisterPort OutputPort

Public Member Functions

 OutputShiftRegisterPortWithLatch (OutputShiftRegisterWithLatch *shiftRegister, bool autoFlush=true, bool autoLatch=true)
 
bool getAutoLatch (void) const
 
void setAutoLatch (bool state)
 
void flush (void)
 
void latch (void)
 
- Public Member Functions inherited from OutputShiftRegisterPort
 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)
 

Additional Inherited Members

- Protected Attributes inherited from OutputShiftRegisterPort
OutputShiftRegister *const m_shiftRegister
 

Detailed Description

Class that implements an OutputPort using a shift register featuring an output latch. It uses the OutputShiftRegisterWithLatch interface that defines only a data, clock and output latch line, thus there will be always 8 bits transported (instead of clearing the register and making use of leading zeros). See OutputShiftRegisterPort for a description of the autoFlush property. Additionally OutputShiftRegisterPortWithLatch defines a autoLatch property that works similar: if set to true, the output latch will be triggered automatically with each data transfer to the device (either bei setValue() or by flush()). Otherwise an explicit call to latch() is required to make the new data appear at the device's outputs.

Constructor & Destructor Documentation

◆ OutputShiftRegisterPortWithLatch()

OutputShiftRegisterPortWithLatch::OutputShiftRegisterPortWithLatch ( OutputShiftRegisterWithLatch shiftRegister,
bool  autoFlush = true,
bool  autoLatch = true 
)
inline

Constructor.

Parameters
shiftRegisterPointer to OutputShiftRegister instance to be used as output device.
autoFlushValue of autoFlush property, defaulting to true.
autoLatchValue of autoLatch property, defaulting to true.

Member Function Documentation

◆ flush()

void OutputShiftRegisterPortWithLatch::flush ( void  )
inline

Excplicitly transferrs internal value to the associated device.

◆ getAutoLatch()

bool OutputShiftRegisterPortWithLatch::getAutoLatch ( void  ) const
inline

Getter for current value of autoLatch property.

Returns
Current value of autoLatch property.

◆ latch()

void OutputShiftRegisterPortWithLatch::latch ( void  )
inline

Excplicitly triggers output latch of the associated device.

◆ setAutoLatch()

void OutputShiftRegisterPortWithLatch::setAutoLatch ( bool  state)
inline

Setter for value of autoLatch property.

Parameters
stateNew value for autoLatch property, true means that autoLatch is active.