57 template<board::DigitalPin CLOCK_, board::DigitalPin LATCH_, board::DigitalPin DATA_>
class SIPO
69 SIPO& operator=(
const SIPO&) =
delete;
104 uint8_t* pdata = (uint8_t*) data;
106 for (uint8_t i = 0; i <
sizeof(T); ++i) bit_bang_data(pdata[i]);
129 void bit_bang_data(uint8_t data)
This template class supports one SIPO chip, connected to the MCU through 3 pins.
static constexpr const board::DigitalPin CLOCK
The output pin that will send the clock signal to the chip.
static constexpr const board::DigitalPin LATCH
The output pin that will tell the chip to copy its shift register content to its output pins.
void output(T data)
Handles output and latching of all bits in data to the SIPO chip.
static constexpr const board::DigitalPin DATA
The output pin that will send serial data to the chip.
void init()
Initialize (direction, value) all used pins.
SIPO()=default
Create a new SIPO handler, according to pins defined by class template parameters.
#define INLINE
Specific GCC attribute to force the compiler to always inline code of a given function.
static constexpr uint8_t HIGH_BYTE(uint16_t value)
Extract the high byte (aka Most Significant Byte, MSB) of a uint16_t value.
static constexpr uint8_t LOW_BYTE(uint16_t value)
Extract the low byte (aka Least Significant Byte, LSB) of a uint16_t value.
DigitalPin
Defines all available digital input/output pins of the target MCU.
Defines all API for all external devices supported by FastArduino.
typename FastPinType< DPIN_ >::TYPE FAST_PIN
Useful alias type to the FastPin type matching a given board::DigitalPin.
@ OUTPUT
Digital pin is configured as output.