Simple library for controlling a shift register using only three pins on the mbed. Defaults to controlling an 8 bit shift register.

Dependents:   Lab07_RTOS_display Lab07_RTOS_queue

Embed: (wiki syntax)

« Back to documentation index

ShiftOut Class Reference

ShiftOut Class Reference

A simple serial driver for a shift register that uses only three digital out pins leaving SPI and i2c free. More...

#include <ShiftOut.h>

Public Member Functions

 ShiftOut (PinName clk, PinName data, PinName latch, int8_t registerCount=0x08)
 Constructs a new ShiftOut with the given three pins.
void write (int data)
 Writes the given integer to the shift register.

Detailed Description

A simple serial driver for a shift register that uses only three digital out pins leaving SPI and i2c free.

ShiftOut can be configured for any size shift register but defaults to eight bits.

Definition at line 9 of file ShiftOut.h.


Constructor & Destructor Documentation

ShiftOut ( PinName  clk,
PinName  data,
PinName  latch,
int8_t  registerCount = 0x08 
)

Constructs a new ShiftOut with the given three pins.

Parameters:
clk- the pin to use for the shift register clock.
data- the pin to use for the shift register data line.
latch- the pin to use for the shift register latch.
registerCount- the number of registers in the shift register, defaults to eight.

Definition at line 19 of file ShiftOut.h.


Member Function Documentation

void write ( int  data )

Writes the given integer to the shift register.

Definition at line 34 of file ShiftOut.h.