SCLD peripheral of the KL46Z
Dependents: FRDM-KL46Z LCD rtc Demo KL46Z EE202A_HW1_MH SignalGenerator ... more
Revision 10:ef2b3b7f1b01, committed 2014-03-23
- Comitter:
- Tomo2k
- Date:
- Sun Mar 23 19:55:14 2014 +0000
- Parent:
- 9:dae947a658f0
- Commit message:
- Documentation updated
Changed in this revision
SLCD.cpp | Show annotated file Show diff for this revision Revisions of this file |
SLCD.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/SLCD.cpp Sun Mar 23 19:10:10 2014 +0000 +++ b/SLCD.cpp Sun Mar 23 19:55:14 2014 +0000 @@ -195,7 +195,7 @@ CharPosition++; } -void SLCD::Home (void) +void SLCD::Home() { CharPosition = 0; } @@ -267,11 +267,11 @@ DP(2, mode==1); } -void SLCD::Colon (int mode) +void SLCD::Colon (bool on) { uint8_t *lbpLCDWF; lbpLCDWF = (uint8_t *)&LCD->WF8B[0]; - if (mode==1) { + if (on) { lbpLCDWF[(uint8_t)WF_ORDERING_TABLE[7]]|=1; } else { lbpLCDWF[(uint8_t)WF_ORDERING_TABLE[7]]&=~1;
--- a/SLCD.h Sun Mar 23 19:10:10 2014 +0000 +++ b/SLCD.h Sun Mar 23 19:55:14 2014 +0000 @@ -27,20 +27,55 @@ } */ +/** +* SLCD peripheral of the FRDM-KL46Z\n +Inherits mbed::Stream and supports the majority of Stream functions. + +@code +#include "mbed.h" +#include "SLCD.h" + +SLCD slcd; + +main() +{ + slcd.Home(); // Moves cursor to position 0 (start) + slcd.printf("1.2.3.4"); // Standard printf function, only characters in ASCII_TO_WF_CODIFICATION_TABLE will display + // Dots printed using decimal points + slcd.putc('A'); // Prints a single character + + while(1); // Wait forever +} +@endcode +*/ class SLCD : public Stream { public: + //! Construct an SLCD object SLCD(); - void Home (void); + //! Move the SLCD cursor to the first character + void Home(); + /** + * Set contrast + * @param lbContrast 0 - 15, 0 lightest, 15 darkest + */ void Contrast (uint8_t lbContrast); void All_Segments (int); + //! Turn off all segments void clear(); + /** + * Turn a decimal point on or off + * @param pos decimal point position: 0-2 + * @param on True or False + */ void DP(int pos, bool on); void DP1 (int); void DP2 (int); void DP3 (int); - void Colon (int); + //! Turn the colon symbol on or off + void Colon (bool on); + //! Current cursor position uint8_t CharPosition; void blink(int blink = 3); void deepsleepEnable(bool enable);