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

#include <shiftregister74hc164.h>

Inheritance diagram for ShiftRegister74HC164:
OutputShiftRegister IntegratedCircuit::hasClear IntegratedCircuit IntegratedCircuit::isClocked

Public Member Functions

 ShiftRegister74HC164 (OutputPin *pinDataA, OutputPin *pinDataB, OutputPin *pinClock, OutputPin *pinClear)
 
virtual void setData (bool value) override
 
void setDataA (bool value)
 
void setDataB (bool value)
 
virtual void clock (void) override
 
virtual void clear (void) override
 

Detailed Description

Implementation of the 74HC164 serial in/parallel out shift register with two data inputs, clock and clear function. Each input of the hardware device can be connected using a OutputPin instance. For functions that are not required it is safe to pass a null pointer.

Pinout of device:

+--v--+
A 1 | | 14 VCC
B 2 | | 13 QH
QA 3 | | 12 QG
QB 4 | | 11 QF
QC 5 | | 10 QE
QD 6 | | 9 /CLR
GND 7 | | 8 CLK
+-----+

Constructor & Destructor Documentation

◆ ShiftRegister74HC164()

ShiftRegister74HC164::ShiftRegister74HC164 ( OutputPin pinDataA,
OutputPin pinDataB,
OutputPin pinClock,
OutputPin pinClear 
)
inline

Constructor. Pins that are not used can be passed as null pointer.

Parameters
pinDataAPin to be used for Data A input.
pinDataBPin to be used for Data B input.
pinClockPin to be used for clocking data into device.
pinClearPin to be used to clear device.

Member Function Documentation

◆ clear()

virtual void ShiftRegister74HC164::clear ( void  )
inlineoverridevirtual

Toggle clear input.

Implements IntegratedCircuit::hasClear.

◆ clock()

virtual void ShiftRegister74HC164::clock ( void  )
inlineoverridevirtual

Toggle clock input.

Implements IntegratedCircuit::isClocked.

◆ setData()

virtual void ShiftRegister74HC164::setData ( bool  value)
inlineoverridevirtual

Sets data input of shift register to specified value.

Parameters
valueValue of data input, true for HIGH level and false for LOW level.

Implements OutputShiftRegister.

◆ setDataA()

void ShiftRegister74HC164::setDataA ( bool  value)
inline

Sets data A input to specified value.

Parameters
valueValue of data input, true for HIGH level and false for LOW level.

◆ setDataB()

void ShiftRegister74HC164::setDataB ( bool  value)
inline

Sets data B input to specified value.

Parameters
valueValue of data input, true for HIGH level and false for LOW level.