A class to drive a shift register using Bela's digital I/O.
More...
#include <ShiftRegister.h>
|
enum | State { kStart,
kTransmitting,
kStop,
kIdle
} |
|
|
Pins | pins |
|
State | state = kStop |
|
std::vector< bool > | data |
|
bool | pinModeSet = false |
|
bool | notified = true |
|
A class to drive a shift register using Bela's digital I/O.
A class to drive a shift register using Bela's digital I/O. This class accesses the BelaContext directly to perform data I/O. You need to assign it three digital channels at initialisation, to which data will be written at each call to process().
ShiftRegister::ShiftRegister |
( |
| ) |
|
Default constructor. Does nothing. If the object is constructed this way, you have to call setup() to initialise it properly.
ShiftRegister::ShiftRegister |
( |
const Pins & |
pins, |
|
|
unsigned int |
maxSize |
|
) |
| |
Set the Bela digital channels that will be used and the maximum length of the messages to be transmitted.
- Parameters
-
pins | the data, clock, latch pins to be used. |
maxSize | the maximum length of the messages that will be passed to setData(). |
void ShiftRegister::setup |
( |
const Pins & |
pins, |
|
|
unsigned int |
maxSize |
|
) |
| |
bool ShiftRegister::dataReady |
( |
| ) |
|
Check whether the last I/O transmission is completed. After one call has returned true
, future calls will return false
until a new transmission is completed.
- Returns
true
if all data has been shifted, or false
if shifting is still in progress.
- Examples:
- Sensors/shift-register-out/render.cpp.
virtual void ShiftRegister::process |
( |
BelaContext * |
context, |
|
|
unsigned int |
n |
|
) |
| |
|
pure virtual |
The documentation for this class was generated from the following files:
- libraries/ShiftRegister/ShiftRegister.h
- libraries/ShiftRegister/ShiftRegister.cpp