Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
LiquidCrystal_SR3W Class Reference
Inheritance diagram for LiquidCrystal_SR3W:
LCD Print

Public Member Functions

 LiquidCrystal_SR3W (uint8_t data, uint8_t clk, uint8_t strobe)
 
 LiquidCrystal_SR3W (uint8_t data, uint8_t clk, uint8_t strobe, uint8_t backlighPin, t_backlighPol pol)
 
 LiquidCrystal_SR3W (uint8_t data, uint8_t clk, uint8_t strobe, uint8_t En, uint8_t Rw, uint8_t Rs, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
 
 LiquidCrystal_SR3W (uint8_t data, uint8_t clk, uint8_t strobe, uint8_t En, uint8_t Rw, uint8_t Rs, uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7, uint8_t backlighPin, t_backlighPol pol)
 
virtual void send (uint8_t value, uint8_t mode)
 
void setBacklightPin (uint8_t value, t_backlighPol pol)
 
void setBacklight (uint8_t value)
 
virtual void begin (uint8_t cols, uint8_t rows, uint8_t charsize=LCD_5x8DOTS)
 
void clear ()
 
void home ()
 
void noDisplay ()
 
void display ()
 
void noBlink ()
 
void blink ()
 
void noCursor ()
 
void cursor ()
 
void scrollDisplayLeft ()
 
void scrollDisplayRight ()
 
void leftToRight ()
 
void rightToLeft ()
 
void moveCursorLeft ()
 
void moveCursorRight ()
 
void autoscroll ()
 
void noAutoscroll ()
 
void createChar (uint8_t location, uint8_t charmap[])
 
void setCursor (uint8_t col, uint8_t row)
 
void backlight (void)
 
void noBacklight (void)
 
void on (void)
 
void off (void)
 
virtual void write (uint8_t value)
 
size_t write (const char *str)
 Writes a c-string to output stream. More...
 
virtual size_t write (const uint8_t *buffer, size_t size)
 Writes characters from a buffer to output stream. More...
 
size_t write (const char *buffer, size_t size)
 Writes characters from a buffer to output stream. More...
 
int getWriteError ()
 Gets last error. More...
 
void clearWriteError ()
 Clears the last write error. More...
 
size_t print (char)
 Prints a single character to output stream. More...
 
size_t print (const char[])
 Prints a c-string to output stream. More...
 
size_t print (unsigned long, int base=DEC)
 Prints a number to output stream. More...
 
size_t print (long, int base=DEC)
 Prints a number to output stream. More...
 
size_t print (unsigned int, int base=DEC)
 
size_t print (unsigned char, int base=DEC)
 
size_t print (int, int base=DEC)
 Prints a number to output stream. More...
 
size_t print (double, int digits=2)
 Prints number to output stream. More...
 
size_t print (const Printable &p)
 Prints a Printable object to output stream. More...
 
size_t print (const String &s)
 Prints a String to output stream. More...
 
size_t println (void)
 Prints a newline to output stream. More...
 
size_t println (const char[])
 Prints a c-string to output stream, appending newline. More...
 
size_t println (char)
 Prints a single character to output stream, appending newline. More...
 
size_t println (unsigned char, int base=DEC)
 Prints a number to output stream, appending newline. More...
 
size_t println (unsigned int, int base=DEC)
 
size_t println (unsigned long, int base=DEC)
 
size_t println (int, int base=DEC)
 Prints a number to output stream, appending newline. More...
 
size_t println (long, int base=DEC)
 Prints a number to output stream, appending newline. More...
 
size_t println (double, int digits=2)
 Prints a number to output stream, appending newline. More...
 
size_t println (const Printable &p)
 Prints a Printable object to output stream, appending newline. More...
 
size_t println (const String &s)
 Prints a String to output stream, appending newline. More...
 
size_t printf (const char *fmt,...)
 Prints a formatted c-string to output stream. More...
 

Protected Member Functions

void setWriteError (int err=1)
 

Protected Attributes

uint8_t _displayfunction
 
uint8_t _displaycontrol
 
uint8_t _displaymode
 
uint8_t _numlines
 
uint8_t _cols
 
t_backlighPol _polarity
 

Constructor & Destructor Documentation

LiquidCrystal_SR3W::LiquidCrystal_SR3W ( uint8_t  data,
uint8_t  clk,
uint8_t  strobe 
)

Class constructor. Initializes class variables and defines the IO driving the shift register. The constructor does not initialize the LCD. Default configuration: Shift register LCD QA - 0 DB4 QB - 1 DB5 QC - 2 DB6 QD - 3 DB7 QE - 4 E QF - 5 QG - 6 Rs GND Rw

Parameters
strobe[in]digital IO connected to shiftregister strobe pin.
data[in]digital IO connected to the shiftregister data pin.
clk[in]digital IO connected to the shiftregister clock pin.
LiquidCrystal_SR3W::LiquidCrystal_SR3W ( uint8_t  data,
uint8_t  clk,
uint8_t  strobe,
uint8_t  En,
uint8_t  Rw,
uint8_t  Rs,
uint8_t  d4,
uint8_t  d5,
uint8_t  d6,
uint8_t  d7 
)

Class constructor. Initializes class variables and defines the control lines of the LCD and the shiftregister. The constructor does not initialize the LCD.

Parameters
strobe[in]digital IO connected to shiftregister strobe pin.
data[in]digital IO connected to shiftregister data pin.
clk[in]digital IO connected to shiftregister clock pin.
En[in]LCD En (Enable) pin connected to SR output pin.
Rw[in]LCD Rw (Read/write) pin connected to SR output pin.
Rs[in]LCD Rs (Reg Select) pin connected to SR output pin.
d4[in]LCD data 4 pin map to the SR output pin.
d5[in]LCD data 5 pin map to the SR output pin.
d6[in]LCD data 6 pin map to the SR output pin.
d7[in]LCD data 7 pin map to the SR output pin.

Member Function Documentation

void LCD::autoscroll ( )
inherited

Turns on automatic scrolling of the LCD. Turns on automatic scrolling of the LCD. This causes each character output to the display to push previous characters over by one space. If the current text direction is left-to-right (the default), the display scrolls to the left; if the current direction is right-to-left, the display scrolls to the right. This has the effect of outputting each new character to the same location on the LCD.

Parameters
none
void LCD::backlight ( void  )
inherited

Switch-on the LCD backlight. Switch-on the LCD backlight. The setBacklightPin has to be called before setting the backlight for this method to work.

See also
setBacklightPin.
virtual void LCD::begin ( uint8_t  cols,
uint8_t  rows,
uint8_t  charsize = LCD_5x8DOTS 
)
virtualinherited

LCD initialization. Initializes the LCD to a given size (col, row). This methods initializes the LCD, therefore, it MUST be called prior to using any other method from this class.

This method is abstract, a base implementation is available common to all LCD drivers. Should it not be compatible with some other LCD driver, a derived implementation should be done on the driver specif class.

Parameters
cols[in]the number of columns that the display has
rows[in]the number of rows that the display has
charsize[in]character size, default==LCD_5x8DOTS

Reimplemented in LiquidCrystal_I2C.

void LCD::blink ( )
inherited

Display the cursor of the LCD. Display the blinking LCD cursor. If used in combination with the cursor() function, the result will depend on the particular display.

Parameters
none
void LCD::clear ( )
inherited

Clears the LCD. Clears the LCD screen and positions the cursor in the upper-left corner.

This operation is time consuming for the LCD.

Parameters
none
void Print::clearWriteError ( )
inlineinherited

Clears the last write error.

void LCD::createChar ( uint8_t  location,
uint8_t  charmap[] 
)
inherited

Creates a custom character for use on the LCD. Create a custom character (glyph) for use on the LCD. Most chipsets only support up to eight characters of 5x8 pixels. Therefore, this methods has been limited to locations (numbered 0 to 7).

The appearance of each custom character is specified by an array of eight bytes, one for each row. The five least significant bits of each byte determine the pixels in that row. To display a custom character on screen, write()/print() its number, i.e. lcd.print (char(x)); // Where x is 0..7.

Parameters
location[in]LCD memory location of the character to create (0 to 7)
charmap[in]the bitmap array representing each row of the character.
void LCD::cursor ( )
inherited

Display the LCD cursor. Display the LCD cursor: an underscore (line) at the location where the next character will be written.

Parameters
none
void LCD::display ( )
inherited

Turns on the LCD display. Turns on the LCD display, after it's been turned off with noDisplay(). This will restore the text (and cursor location) that was on the display prior to calling noDisplay().

Parameters
none
int Print::getWriteError ( )
inlineinherited

Gets last error.

Return values
intError number of last write error
void LCD::home ( )
inherited

Sets the cursor to the upper-left corner. Positions the cursor in the upper-left of the LCD. That is, use that location in outputting subsequent text to the display. To also clear the display, use the clear() function instead.

This operation is time consuming for the LCD.

Parameters
none
void LCD::leftToRight ( )
inherited

Set the direction for text written to the LCD to left-to-right. Set the direction for text written to the LCD to left-to-right. All subsequent characters written to the display will go from left to right, but does not affect previously-output text.

This is the default configuration.

Parameters
none
void LCD::moveCursorLeft ( )
inherited

Moves the cursor one space to the left.

Parameters
none
void LCD::moveCursorRight ( )
inherited

Moves the cursor one space to the right.

Parameters
none
void LCD::noAutoscroll ( )
inherited

Turns off automatic scrolling of the LCD. Turns off automatic scrolling of the LCD, this is the default configuration of the LCD.

Parameters
none
void LCD::noBacklight ( void  )
inherited

Switch-off the LCD backlight. Switch-off the LCD backlight. The setBacklightPin has to be called before setting the backlight for this method to work.

See also
setBacklightPin.
void LCD::noBlink ( )
inherited

Turns off the blinking of the LCD cursor.

Parameters
none
void LCD::noCursor ( )
inherited

Hides the LCD cursor.

Parameters
none
void LCD::noDisplay ( )
inherited

Turns off the LCD display. Turns off the LCD display, without losing the text currently being displayed on it.

Parameters
none
void LCD::off ( void  )
inherited

Switch off the LCD module. Switch off the LCD module, it will switch off the LCD controller and the backlight. This method has the same effect of calling noDisplay and noBacklight.

See also
display,
backlight
void LCD::on ( void  )
inherited

Switch on the LCD module. Switch on the LCD module, it will switch on the LCD controller and the backlight. This method has the same effect of calling display and backlight.

See also
display,
backlight
size_t Print::print ( char  )
inherited

Prints a single character to output stream.

Return values
size_tQuantity of characters written to stream
size_t Print::print ( const char  [])
inherited

Prints a c-string to output stream.

Parameters
char[]c-string to print
Return values
size_tQuantity of characters written to output stream
size_tQuantity of characters written to stream
size_t Print::print ( unsigned  char,
int  base = DEC 
)
inherited

Prints a number to output stream.

Parameters
unsigned longNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
Parameters
unsigned intNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
Parameters
unsigned charNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::print ( long  ,
int  base = DEC 
)
inherited

Prints a number to output stream.

Parameters
longNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::print ( int  ,
int  base = DEC 
)
inherited

Prints a number to output stream.

Parameters
intNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::print ( double  ,
int  digits = 2 
)
inherited

Prints number to output stream.

Prints a number to output stream.

Parameters
doubleNumber to print
intDecimal places to show
Return values
size_tQuantity of characters written to output stream
Parameters
doubleNumber to print
digitsThe decimal places to print (Default: 2, e.g. 21.35)
Return values
size_tQuantity of characters written to stream
size_t Print::print ( const Printable p)
inherited

Prints a Printable object to output stream.

Parameters
pObject to print
Return values
size_tQuantity of characters written to stream
size_t Print::print ( const String s)
inherited

Prints a String to output stream.

Parameters
sString to print
Return values
size_tQuantity of characters written to stream
size_t Print::printf ( const char *  fmt,
  ... 
)
inherited

Prints a formatted c-string to output stream.

Parameters
fmtPointer to formated c-string to print
...Parameters for placeholders within formated string
Return values
size_tQuantity of characters written to stream
Note
Use standard printf placeholders, e.g. d for integer, s for c-string, etc.
size_t Print::println ( void  )
inherited

Prints a newline to output stream.

Parameters
Printsnewline to output stream
Return values
size_tQuantity of characters written to output stream
size_tQuantity of characters written to stream
size_t Print::println ( const char  [])
inherited

Prints a c-string to output stream, appending newline.

Parameters
char[]c-string to print
Return values
size_tQuantity of characters written to stream
size_t Print::println ( char  )
inherited

Prints a single character to output stream, appending newline.

Parameters
charCharacter to print
Return values
size_tQuantity of characters written to stream
size_t Print::println ( unsigned  long,
int  base = DEC 
)
inherited

Prints a number to output stream, appending newline.

Parameters
unsigned charNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
Parameters
unsigned intNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
Parameters
unsigned longNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::println ( int  ,
int  base = DEC 
)
inherited

Prints a number to output stream, appending newline.

Parameters
intNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::println ( long  ,
int  base = DEC 
)
inherited

Prints a number to output stream, appending newline.

Parameters
longNumber to print
baseThe base for output (Default: Decimal (base 10))
Return values
size_tQuantity of characters written to stream
size_t Print::println ( double  ,
int  digits = 2 
)
inherited

Prints a number to output stream, appending newline.

Parameters
doubleNumber to print
digitsThe decimal places to print (Default: 2, e.g. 21.35)
Return values
size_tQuantity of characters written to stream
size_t Print::println ( const Printable p)
inherited

Prints a Printable object to output stream, appending newline.

Parameters
pObject to print
Return values
size_tQuantity of characters written to stream
size_t Print::println ( const String s)
inherited

Prints a String to output stream, appending newline.

Parameters
sString to print
Return values
size_tQuantity of characters written to stream
void LCD::rightToLeft ( )
inherited

Set the direction for text written to the LCD to right-to-left. Set the direction for text written to the LCD to right-to-left. All subsequent characters written to the display will go from right to left, but does not affect previously-output text.

left-to-right is the default configuration.

Parameters
none
void LCD::scrollDisplayLeft ( )
inherited

Scrolls the contents of the display (text and cursor) one space to the left.

Parameters
none
void LCD::scrollDisplayRight ( )
inherited

Scrolls the contents of the display (text and cursor) one space to the right.

Parameters
none
virtual void LiquidCrystal_SR3W::send ( uint8_t  value,
uint8_t  mode 
)
virtual

Send a particular value to the LCD. Sends a particular value to the LCD for writing to the LCD or as an LCD command.

Users should never call this method.

Parameters
value[in]Value to send to the LCD.
mode[in]DATA - write to the LCD CGRAM, COMMAND - write a command to the LCD.

Reimplemented from LCD.

void LiquidCrystal_SR3W::setBacklight ( uint8_t  value)
virtual

Switch-on/off the LCD backlight. Switch-on/off the LCD backlight. The setBacklightPin has to be called before setting the backlight for this method to work.

See also
setBacklightPin.
Parameters
valuebacklight mode (HIGH|LOW)

Reimplemented from LCD.

void LiquidCrystal_SR3W::setBacklightPin ( uint8_t  value,
t_backlighPol  pol 
)
virtual

Sets the pin to control the backlight. Sets the pin in the device to control the backlight. This device doesn't support dimming backlight capability.

Parameters
0backlight off, 1..255: backlight on.

Reimplemented from LCD.

void LCD::setCursor ( uint8_t  col,
uint8_t  row 
)
inherited

Position the LCD cursor. Sets the position of the LCD cursor. Set the location at which subsequent text written to the LCD will be displayed.

Parameters
col[in]LCD column
row[in]LCD row - line.
size_t Print::write ( const char *  str)
inlineinherited

Writes a c-string to output stream.

Parameters
strPointer to c-string
Return values
size_tQuantity of characters written to stream
size_t Print::write ( const uint8_t *  buffer,
size_t  size 
)
virtualinherited

Writes characters from a buffer to output stream.

Parameters
bufferPointer to character buffer
sizeQuantity of characters to write
Return values
size_tQuantity of characters written to stream

Reimplemented in HardwareSerial, CircularBuffer, FileStream, MemoryDataStream, LimitedMemoryStream, TwoWire, EndlessMemoryStream, GdbFileStream, rBootItemOutputStream, and ReadWriteStream.

size_t Print::write ( const char *  buffer,
size_t  size 
)
inlineinherited

Writes characters from a buffer to output stream.

Parameters
bufferPointer to character buffer
sizeQuantity of characters to write
Return values
size_tQuantity of characters written to stream
virtual void LCD::write ( uint8_t  value)
virtualinherited

Writes to the LCD. This method writes character to the LCD in the current cursor position.

This is the virtual write method, implemented in the Print class, therefore all Print class methods will end up calling this method.

Parameters
value[in]Value to write to the LCD.

Implements Print.