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() [1/2]
| ShiftRegister::ShiftRegister |
( |
| ) |
|
Default constructor. Does nothing. If the object is constructed this way, you have to call setup() to initialise it properly.
◆ ShiftRegister() [2/2]
| 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(). |
◆ setup()
| void ShiftRegister::setup |
( |
const Pins & | pins, |
|
|
unsigned int | maxSize ) |
◆ dataReady()
| 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.
◆ process()
| 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