Johan Kritzinger / Mbed 2 deprecated FRDMKL25Z-ShiftBrite

Dependencies:   mbed

Revision:
3:9376bf1f1bbd
Parent:
2:3935d2ed40cd
Child:
4:d2f8ddb423e2
--- a/sbDriver.h	Wed Aug 20 05:24:38 2014 +0000
+++ b/sbDriver.h	Wed Aug 20 08:11:28 2014 +0000
@@ -100,7 +100,7 @@
     #include "mbed.h"
     #include "sbDriver.h"
     //This code is licenced as "BEERWARE" and used at own your own risk and discretion. Coded by Johan Kritzinger 8/2014.
-    Serial PC(PTA2, PTA1);//Access to serial port
+    Serial PC(PTA2, PTA1);//Access to serial port for sending error messages
     DigitalOut latch(PTC16);//to LI pin of shiftBrite module
     DigitalOut enable(PTA13);//to EI pin of shiftBrite module
     DigitalOut reset(PTC12);//to power control circuit of your doing - NOT MANDATORY
@@ -169,22 +169,89 @@
 //TO DO - Modify the constructor to initialise the spi PWM, and setup defaults for the SB control sinals (i.e. enable, latch and reset)
 // Also, initialize the SB current control registers(this WILL need to be done each time the SB modules are reset)
 
-//    Constructor
+/**Constructor
+See the example code for usage instructions.
+*/
     shiftBriteDisplay (Serial *port,DigitalOut &latch, DigitalOut &enable, DigitalOut &reset, SPI &spiPort, unsigned int moduleCount); //constructor
 
 //    Destructor
     ~shiftBriteDisplay();//destructor - needs to release module_p
     
-//    Setters    
-    void setLed(unsigned int moduleNum, unsigned long int rgbValue);
+//    Setters 
+/**used to set the colour for a specific dot (LED) using the RGB system. e.g. 0XFF0000 is full blue. I would suggest not using this
+* unless you have no option because it only allows specifying 256 levels for each colour whereas the ShiftBright modules are 
+* capable of 1024. Use the overloaded member function.
+*/
+   void setLed(unsigned int moduleNum, unsigned long int rgbValue);
+
+
+/**used to set the colour for a specific dot (LED) using the full ability of the ShiftBrite modules. Each colour is supplied 
+* individualy in the range of 0-1023 (0-0x3FF).
+*/
     void setLed(unsigned int moduleNum, unsigned short int red, unsigned short int green, unsigned short int blue);//Overloaded
 //    void setCurrentCorr( unsigned long int rgbValue=0x786464);//ALL modules
-    void setCurrentCorr( unsigned short int red/* = 0x78*/, unsigned short int green/* = 0x64*/, unsigned short int blue/* = 0x64*/);//ALL modules
+
+/** used to adjust the maximum current to each colour. Consists of 3 values, one each for red, green and blue.
+* This allow you to adjust the brightness level of the reds, green and blues. Is usefull if one colour is brighter than the others
+* that causes colours to mix incorrectly. When used it will record the arguments as the default values.
+*/
+
+    void setCurrentCorr( unsigned short int red, unsigned short int green, unsigned short int blue);//ALL modules
+
+/** same as above but call up the stored default values.
+*/
     void setCurrentCorr();//overload - meaning, read the vals from the class member and set accordingly
 
-//    Display update    
+//    Getters
+    
+//    Display update  
+/** used to refresh the display. All colour values are written out.
+*/  
     void displayFrame();// write a whole display's worth of data.
     unsigned int getModuleCount(){return moduleCount;}
     
+//    Basic effects
+/**rotateLeft()
+* is used to shift the whole display colours one step left.
+*The first colour is rotated around and shifted in the last dot.
+*/
+    void rotateLeft();
+    
+/**shiftLeft()
+* is used to shift the whole display colours one step left.
+* A blank dot is shifted in.
+*/
+    void shiftLeft();//info shifted out is lost
+
+/**rotateRight()
+* is used to shift the whole display colours one step right.
+*The first colour is rotated around and shifted in the last dot.
+*/
+    void rotateRight();
+
+
+/**shiftRight()
+* is used to shift the whole display colours one step right.
+* A blank dot is shifted in.
+*/
+    void shiftRight();//info shifted out is lost
+    
+/**Display output is turned enabled.
+*/
+    void turnOn();
+    
+/**Display output is turned disabled.
+*/    
+    void turnOff();
+    
+/**Used to exchange display values left to right and right to left.
+*/
+    void flip(); //swop positions
+    
+/**Changes all display colours with it's mathematical opposite.
+*/
+    void invert(); //invert colours
+    
+    
 };
 #endif
\ No newline at end of file