Johan Kritzinger
/
FRDMKL25Z-ShiftBrite
A few classes to interface one or more ShiftBrite module to the FRDM KL25Z.
Diff: sbDriver.cpp
- Revision:
- 4:d2f8ddb423e2
- Parent:
- 3:9376bf1f1bbd
- Child:
- 5:aa0424f31fa1
--- a/sbDriver.cpp Wed Aug 20 08:11:28 2014 +0000 +++ b/sbDriver.cpp Wed Aug 20 09:26:42 2014 +0000 @@ -3,7 +3,7 @@ #include "mbed.h" #include "sbDriver.h" -#define ERRORPRINT //Comment out to not see any error message on STD:: +//#define ERRORPRINT //Comment out to not see any error message on STD:: //NOTES ON THE SHIFTBRITE MODULES @@ -112,10 +112,11 @@ //============================================================================================= // Display object tracking/controlling multiple rgbLed objects -shiftBriteDisplay::shiftBriteDisplay (Serial *port,DigitalOut &latch, DigitalOut &enable, DigitalOut &reset, SPI &spiPort, unsigned int moduleCount):/*PC(port),*/sb_latch(latch), sb_enable(enable), sb_reset(reset), spi(spiPort){ //constructor +//shiftBriteDisplay::shiftBriteDisplay (Serial *port,DigitalOut &latch, DigitalOut &enable, DigitalOut &reset, SPI &spiPort, unsigned int moduleCount):/*PC(port),*/sb_latch(latch), sb_enable(enable), sb_reset(reset), spi(spiPort){ //constructor +shiftBriteDisplay::shiftBriteDisplay (DigitalOut &latch, DigitalOut &enable, DigitalOut &reset, SPI &spiPort, unsigned int moduleCount):/*PC(port),*/sb_latch(latch), sb_enable(enable), sb_reset(reset), spi(spiPort){ //constructor // OK, so the sb control/data lines have been setup via references //Allocate memory for moduleCount* sb modules - serial_p = port; + //serial_p = port; spi.format(8,0);//8 bit, mode 0 spi.frequency(100000);//100kHz clk