Noiasca Liquid Crystal
A light weight LCD Library to print UTF-8 and special characters easily.
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
LiquidCrystal_Serial_base Class Reference

#include <lcd_serial.h>

Inheritance diagram for LiquidCrystal_Serial_base:
LiquidCrystal_dummy

Public Member Functions

 LiquidCrystal_Serial_base (Stream &stream, uint8_t cols=16, uint8_t rows=2)
 
size_t write (uint8_t value)
 
virtual void hwInit ()
 
void begin ()
 
void begin (uint8_t cols, uint8_t rows, uint8_t charsize=LCD_5x8DOTS)
 
void init ()
 
int setBacklight (uint8_t value)
 switch backlight on or off More...
 
int backlight ()
 switch backlight on More...
 
int noBacklight ()
 switch backlight off More...
 
void setBrightness (byte value)
 
void setPostTransmission (void(*cbPostTransmission)())
 action after the last byte was transmitted. More...
 
void setPreTransmission (void(*cbPreTransmission)())
 action before the first byte will be transmitted. More...
 
void setKey (Callback1 cbKey)
 action when a key was pressed More...
 
void parse ()
 
- Public Member Functions inherited from LiquidCrystal_dummy
 LiquidCrystal_dummy (uint8_t, uint8_t)
 
void setDelay (uint8_t, char)
 
size_t writeOld (uint8_t)
 unmodified version of write More...
 
void command (uint8_t)
 Send a command to the display, for commands not supported by the library (LCD API) More...
 
void clear ()
 Clear the display and place cursor at 0,0 (LCD API) More...
 
void home ()
 Home the cursor to 0,0 and leave displayed characters (LCD API) More...
 
void setCursor (uint8_t, uint8_t)
 Where Row 0-MAXLINEs, and Col 0-MAXCOLUMNS. More...
 
void cursor ()
 Turn the block cursor on. More...
 
void cursor_on ()
 
void noCursor ()
 Turn the block cursor off. More...
 
void cursor_off ()
 
void blink ()
 Turn on the blinking underline cursor (LCD API blink_on) More...
 
void blink_on ()
 
void noBlink ()
 Turn off the blinking underline cursor (LCD blink_off) More...
 
void blink_off ()
 
void setContrast (int)
 
void on ()
 Turn the LCD display on (LCD API optional) More...
 
void off ()
 Turn the LCD display off (LCD API optional) More...
 
void createChar (const uint8_t, const uint8_t[])
 Load up a custom character (LCD API extend) More...
 
void load_custom_character (const uint8_t Char_Num, const uint8_t Rows[])
 
void createChar_P (const uint8_t, const uint8_t *)
 Load up a custom character from PROGMEM. More...
 
void createUml ()
 creates 3 German Umlauts using special characters 5, 6, and 7 More...
 
void setFont (uint8_t value=0)
 sets the used font More...
 

Protected Types

using Callback1 = void(*)(uint8_t)
 

Protected Member Functions

void send (uint8_t value, uint8_t rs, uint8_t rw=rwWrite)
 
void write8bits (uint8_t value, uint8_t rs=rsIR, uint8_t rw=rwWrite)
 
void delBuffer ()
 
virtual void send (uint8_t, uint8_t, uint8_t=rwWrite)
 

Protected Attributes

Stream * stream
 
uint8_t displaycontrolFlagOld = displaycontrolFlag
 
void(* cbPreTransmission )()
 
void(* cbPostTransmission )()
 
Callback1 cbKey
 
byte receivedChars [numChars]
 
byte ndx {0}
 
- Protected Attributes inherited from LiquidCrystal_dummy
const uint8_t waitshort = 37
 
const uint16_t waitlong = 1500
 
uint8_t rowStartingAddress [4] {0x00, 0x40, 0x14, 0x54}
 
const uint8_t cols
 
const uint8_t rows
 
uint8_t currentRow = 255
 
uint8_t entrymodesetFlag
 
uint8_t displaycontrolFlag = displaycontrol_on
 
uint32_t special = 0
 

Static Protected Attributes

static constexpr byte numChars {8}
 
static constexpr uint8_t startMarker {0xAA}
 
static constexpr uint8_t cmdProductReset {0x01}
 
static constexpr uint8_t cmdClearDisplay {0x10}
 
static constexpr uint8_t cmdDisplayOn {0x11}
 
static constexpr uint8_t cmdDisplayOff {0x12}
 
static constexpr uint8_t cmdSetBrightness {0x13}
 
static constexpr uint8_t cmdSetCursorPosition {0x20}
 
static constexpr uint8_t cmdCursorOn {0x21}
 
static constexpr uint8_t cmdCursorOff {0x22}
 
static constexpr uint8_t cmdCursorBlinkOn {0x23}
 
static constexpr uint8_t cmdCursorBlinkOff {0x24}
 
static constexpr uint8_t cmdWritingText {0x25}
 
static constexpr uint8_t cmdDefineCustomCharacter {0x26}
 
static constexpr uint8_t cmdOutputUserPressesTheKeycode {0x55}
 
- Static Protected Attributes inherited from LiquidCrystal_dummy
static const uint8_t cleardisplay = 0x01
 
static const uint8_t returnhome = 0x02
 
static const uint8_t entrymodeset = 0x04
 
static const uint8_t displaycontrol = 0x08
 
static const uint8_t cursorshift = 0x10
 
static const uint8_t functionset = 0x20
 
static const uint8_t setcgramaddress = 0x40
 
static const uint8_t setddramaddress = 0x80
 
static const uint8_t entrymode_shift = 0x01
 
static const uint8_t entrymode_increment = 0x02
 
static const uint8_t displaycontrol_blink = 0x01
 
static const uint8_t displaycontrol_cursor = 0x02
 
static const uint8_t displaycontrol_on = 0x04
 
static const uint8_t cursorshift_right = 0x04
 
static const uint8_t cursorshift_displayshift = 0x08
 
static const uint8_t functionset_font = 0x04
 
static const uint8_t functionset_lines = 0x08
 
static const uint8_t functionset_8bit = 0x10
 
static const byte rsIR = 0
 
static const byte rsDR = 1
 
static const byte rwWrite = 0
 
static const byte rwRead = 1
 

Member Typedef Documentation

◆ Callback1

using LiquidCrystal_Serial_base::Callback1 = void (*)(uint8_t)
protected

Constructor & Destructor Documentation

◆ LiquidCrystal_Serial_base()

LiquidCrystal_Serial_base::LiquidCrystal_Serial_base ( Stream &  stream,
uint8_t  cols = 16,
uint8_t  rows = 2 
)
inline

Member Function Documentation

◆ send()

void LiquidCrystal_Serial_base::send ( uint8_t  value,
uint8_t  rs,
uint8_t  rw = rwWrite 
)
inlineprotectedvirtual

Reimplemented from LiquidCrystal_dummy.

◆ write8bits()

void LiquidCrystal_Serial_base::write8bits ( uint8_t  value,
uint8_t  rs = rsIR,
uint8_t  rw = rwWrite 
)
inlineprotected

◆ delBuffer()

void LiquidCrystal_Serial_base::delBuffer ( )
inlineprotected

◆ write()

size_t LiquidCrystal_Serial_base::write ( uint8_t  value)
inline

◆ hwInit()

virtual void LiquidCrystal_Serial_base::hwInit ( )
inlinevirtual

◆ begin() [1/2]

void LiquidCrystal_Serial_base::begin ( )
inline

Initializes the display (LCD API: init()) Clears the screen and puts the cursor to 0, 0 noiasca: methods are on HW implementation level I prefer the begin() methods init() will be just an alias for begin() as it is part of LCD API

◆ begin() [2/2]

void LiquidCrystal_Serial_base::begin ( uint8_t  cols,
uint8_t  rows,
uint8_t  charsize = LCD_5x8DOTS 
)
inline

◆ init()

void LiquidCrystal_Serial_base::init ( )
inline

◆ setBacklight()

int LiquidCrystal_Serial_base::setBacklight ( uint8_t  value)
inline

switch backlight on or off

Parameters
value0 = off; 1 = on

◆ backlight()

int LiquidCrystal_Serial_base::backlight ( )
inline

switch backlight on

◆ noBacklight()

int LiquidCrystal_Serial_base::noBacklight ( )
inline

switch backlight off

◆ setBrightness()

void LiquidCrystal_Serial_base::setBrightness ( byte  value)
inline

specific for Serial display

◆ setPostTransmission()

void LiquidCrystal_Serial_base::setPostTransmission ( void(*)()  cbPostTransmission)
inline

action after the last byte was transmitted.

This callback function gets called after a message has finished sending (i.e. after all data has been physically transmitted onto the serial bus).

Typical usage of this callback is to enable an RS485 transceiver's Receiver Enable pin, and disable its driver enable pin.

◆ setPreTransmission()

void LiquidCrystal_Serial_base::setPreTransmission ( void(*)()  cbPreTransmission)
inline

action before the first byte will be transmitted.

This callback function gets called just before a message is responded over serial. Typical usage of this callback is to enable an RS485 transceiver's Driver Enable pin, and optionally disable its receiver enable pin.

◆ setKey()

void LiquidCrystal_Serial_base::setKey ( Callback1  cbKey)
inline

action when a key was pressed

This callback function gets called when a key gets pressed in Server Push mode.

Parameters
cbKeythe callback function

◆ parse()

void LiquidCrystal_Serial_base::parse ( )
inline

Check serial interface if something is to be readed and parsed.

Note
In this sketch we do an imidiately interpretation of the incoming data as the protocol has no end marker

Member Data Documentation

◆ stream

Stream* LiquidCrystal_Serial_base::stream
protected

◆ displaycontrolFlagOld

uint8_t LiquidCrystal_Serial_base::displaycontrolFlagOld = displaycontrolFlag
protected

◆ cbPreTransmission

void(* LiquidCrystal_Serial_base::cbPreTransmission) ()
protected

◆ cbPostTransmission

void(* LiquidCrystal_Serial_base::cbPostTransmission) ()
protected

◆ cbKey

Callback1 LiquidCrystal_Serial_base::cbKey
protected

◆ numChars

constexpr byte LiquidCrystal_Serial_base::numChars {8}
staticconstexprprotected

◆ receivedChars

byte LiquidCrystal_Serial_base::receivedChars[numChars]
protected

◆ ndx

byte LiquidCrystal_Serial_base::ndx {0}
protected

◆ startMarker

constexpr uint8_t LiquidCrystal_Serial_base::startMarker {0xAA}
staticconstexprprotected

◆ cmdProductReset

constexpr uint8_t LiquidCrystal_Serial_base::cmdProductReset {0x01}
staticconstexprprotected

◆ cmdClearDisplay

constexpr uint8_t LiquidCrystal_Serial_base::cmdClearDisplay {0x10}
staticconstexprprotected

◆ cmdDisplayOn

constexpr uint8_t LiquidCrystal_Serial_base::cmdDisplayOn {0x11}
staticconstexprprotected

◆ cmdDisplayOff

constexpr uint8_t LiquidCrystal_Serial_base::cmdDisplayOff {0x12}
staticconstexprprotected

◆ cmdSetBrightness

constexpr uint8_t LiquidCrystal_Serial_base::cmdSetBrightness {0x13}
staticconstexprprotected

◆ cmdSetCursorPosition

constexpr uint8_t LiquidCrystal_Serial_base::cmdSetCursorPosition {0x20}
staticconstexprprotected

◆ cmdCursorOn

constexpr uint8_t LiquidCrystal_Serial_base::cmdCursorOn {0x21}
staticconstexprprotected

◆ cmdCursorOff

constexpr uint8_t LiquidCrystal_Serial_base::cmdCursorOff {0x22}
staticconstexprprotected

◆ cmdCursorBlinkOn

constexpr uint8_t LiquidCrystal_Serial_base::cmdCursorBlinkOn {0x23}
staticconstexprprotected

◆ cmdCursorBlinkOff

constexpr uint8_t LiquidCrystal_Serial_base::cmdCursorBlinkOff {0x24}
staticconstexprprotected

◆ cmdWritingText

constexpr uint8_t LiquidCrystal_Serial_base::cmdWritingText {0x25}
staticconstexprprotected

◆ cmdDefineCustomCharacter

constexpr uint8_t LiquidCrystal_Serial_base::cmdDefineCustomCharacter {0x26}
staticconstexprprotected

◆ cmdOutputUserPressesTheKeycode

constexpr uint8_t LiquidCrystal_Serial_base::cmdOutputUserPressesTheKeycode {0x55}
staticconstexprprotected