Group shiftregister¶
Classes¶
| Type | Name |
|---|---|
| class | daisy::ShiftRegister4021 <num_daisychained, num_parallel> Device Driver for CD4021 shift register. |
| class | daisy::ShiftRegister595 Device Driver for 8-bit shift register. CD74HC595 - 8-bit serial to parallel output shift. |
Public Types¶
| Type | Name |
|---|---|
| enum | Pins |
Public Functions¶
| Type | Name |
|---|---|
| void | Init (Pin * pin_cfg, size_t num_daisy_chained=1) |
| void | Set (uint8_t idx, bool state) |
| ShiftRegister595 () |
|
| void | Write () |
| ~ShiftRegister595 () |
Public Types Documentation¶
enum 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
Public Functions Documentation¶
function Init¶
Initializes the GPIO, and data for the ShiftRegister
Parameters:
pin_cfgis an array of Pin corresponding the the Pins enum above.num_daisy_chained(default = 1) is the number of 595 devices daisy chained together.
function Set¶
Sets the state of the specified output.
Parameters:
idxThe index starts with QA on the first device and ends with QH on the last device.stateA true state will set the output HIGH, while a false state will set the output LOW.
function ShiftRegister595¶
function Write¶
Writes the states of shift register out to the connected devices.