Device Driver for 8-bit shift register.
CD74HC595 - 8-bit serial to parallel output shift.
More...
Device Driver for 8-bit shift register.
CD74HC595 - 8-bit serial to parallel output shift.
- Author
- shensley
- Date
- May 2020
#include <sr_595.h>
◆ Pins
The following pins correspond to the hardware connections to the 595.
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"
|
◆ ShiftRegister595()
ShiftRegister595::ShiftRegister595 |
( |
| ) |
|
|
inline |
◆ ~ShiftRegister595()
ShiftRegister595::~ShiftRegister595 |
( |
| ) |
|
|
inline |
◆ Init()
void ShiftRegister595::Init |
( |
dsy_gpio_pin * |
pin_cfg, |
|
|
size_t |
num_daisy_chained = 1 |
|
) |
| |
Initializes the GPIO, and data for the ShiftRegister
- Parameters
-
pin_cfg | is an array of dsy_gpio_pin corresponding the the Pins enum above. |
num_daisy_chained | (default = 1) is the number of 595 devices daisy chained together. |
◆ Set()
void 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. |
◆ Write()
void ShiftRegister595::Write |
( |
| ) |
|
Writes the states of shift register out to the connected devices.
The documentation for this class was generated from the following file: