Digital Shift Registers.
More...
Digital Shift Registers.
◆ Pins
The following pins correspond to the hardware connections to the 595.
- Note
- TODO: This should probably be switched to using a pin config structure similar to other drivers
Enumerator |
---|
PIN_LATCH | |
PIN_CLK | LATCH corresonds to Pin 12 "RCLK"
|
PIN_DATA | CLK corresponds to Pin 11 "SRCLK"
|
NUM_PINS | DATA corresponds to Pin 14 "SER"
|
◆ Init()
void daisy::ShiftRegister595::Init |
( |
Pin * | pin_cfg, |
|
|
size_t | num_daisy_chained = 1 ) |
Initializes the GPIO, and data for the ShiftRegister
- Parameters
-
pin_cfg | is an array of Pin corresponding the the Pins enum above. |
num_daisy_chained | (default = 1) is the number of 595 devices daisy chained together. |
◆ Set()
void daisy::ShiftRegister595::Set |
( |
uint8_t | idx, |
|
|
bool | state ) |
Sets the state of the specified output.
- Parameters
-
idx | The index starts with QA on the first device and ends with QH on the last device. |
state | A true state will set the output HIGH, while a false state will set the output LOW. |
◆ ShiftRegister595()
daisy::ShiftRegister595::ShiftRegister595 |
( |
| ) |
|
|
inline |
◆ Write()
void daisy::ShiftRegister595::Write |
( |
| ) |
|
Writes the states of shift register out to the connected devices.
◆ ~ShiftRegister595()
daisy::ShiftRegister595::~ShiftRegister595 |
( |
| ) |
|
|
inline |