This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
2016-10-30 23:25:44 +00:00
|
|
|
#ifndef PORT_SHIFTREGS_H
|
|
|
|
#define PORT_SHIFTREGS_H
|
|
|
|
#include <Arduino.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include <SPI.h>
|
|
|
|
#include <PortWriteInterface.h>
|
|
|
|
|
|
|
|
/* Port_ShiftRegs
|
2016-11-16 15:29:51 +00:00
|
|
|
slaveSelect is Arduino-pin number connected to shift register RCLK pin a.k.a. SS or ST
|
2016-10-30 23:25:44 +00:00
|
|
|
*/
|
|
|
|
class Port_ShiftRegs : public PortWriteInterface
|
|
|
|
{
|
|
|
|
private:
|
2016-10-31 01:46:23 +00:00
|
|
|
const uint8_t slaveSelect; //controller-pin number
|
2016-10-30 23:25:44 +00:00
|
|
|
uint8_t outputVal; //bit pattern for LEDs
|
|
|
|
public:
|
|
|
|
Port_ShiftRegs(const uint8_t slaveSelect);
|
|
|
|
void begin();
|
2016-11-16 01:47:23 +00:00
|
|
|
void writeLow(const uint8_t pin);
|
|
|
|
void writeHigh(const uint8_t pin);
|
2016-10-30 23:25:44 +00:00
|
|
|
};
|
|
|
|
#endif
|