LCDisplay with IIC (I2C)-bus and IC 8574
Fork of TextLCD by
TextLCD_SPI_N_3_10 Class Reference
Create a TextLCD interface using a controller with native SPI3 10 bits interface Note: current mbed libs only support SPI 10 bit mode for NXP platforms. More...
#include <TextLCD.h>
Inherits TextLCD_Base.
Public Types | |
enum | LCDType { LCD8x1 = (LCD_T_A | LCD_T_C8 | LCD_T_R1), LCD8x2 = (LCD_T_A | LCD_T_C8 | LCD_T_R2), LCD8x2B = (LCD_T_D | LCD_T_C8 | LCD_T_R2), LCD12x2 = (LCD_T_A | LCD_T_C12 | LCD_T_R2), LCD12x3D = (LCD_T_D | LCD_T_C12 | LCD_T_R3), LCD12x3D1 = (LCD_T_D1 | LCD_T_C12 | LCD_T_R3), LCD12x4 = (LCD_T_A | LCD_T_C12 | LCD_T_R4), LCD12x4D = (LCD_T_B | LCD_T_C12 | LCD_T_R4), LCD16x1 = (LCD_T_A | LCD_T_C16 | LCD_T_R1), LCD16x1C = (LCD_T_C | LCD_T_C16 | LCD_T_R1), LCD16x2 = (LCD_T_A | LCD_T_C16 | LCD_T_R2), LCD16x3D = (LCD_T_D | LCD_T_C16 | LCD_T_R3), LCD16x3F = (LCD_T_F | LCD_T_C16 | LCD_T_R3), LCD16x3G = (LCD_T_G | LCD_T_C16 | LCD_T_R3), LCD16x4 = (LCD_T_A | LCD_T_C16 | LCD_T_R4), LCD20x2 = (LCD_T_A | LCD_T_C20 | LCD_T_R2), LCD20x4 = (LCD_T_A | LCD_T_C20 | LCD_T_R4), LCD20x4D = (LCD_T_D | LCD_T_C20 | LCD_T_R4), LCD24x1 = (LCD_T_A | LCD_T_C24 | LCD_T_R1), LCD24x2 = (LCD_T_A | LCD_T_C24 | LCD_T_R2), LCD24x4D = (LCD_T_D | LCD_T_C24 | LCD_T_R4), LCD40x2 = (LCD_T_A | LCD_T_C40 | LCD_T_R2), LCD40x4 = (LCD_T_E | LCD_T_C40 | LCD_T_R4) } |
LCD panel format. More... | |
enum | LCDCtrl { HD44780 = 0 | LCD_C_PAR, WS0010 = 1 | (LCD_C_PAR | LCD_C_SPI3_10 | LCD_C_BST), ST7036_3V3 = 2 | (LCD_C_PAR | LCD_C_SPI4 | LCD_C_I2C | LCD_C_BST | LCD_C_CTR), ST7036_5V = 3 | (LCD_C_PAR | LCD_C_SPI4 | LCD_C_I2C | LCD_C_BST | LCD_C_CTR), ST7032_3V3 = 4 | (LCD_C_PAR | LCD_C_SPI4 | LCD_C_I2C | LCD_C_BST | LCD_C_CTR), ST7032_5V = 5 | (LCD_C_PAR | LCD_C_SPI4 | LCD_C_I2C | LCD_C_CTR), KS0078 = 6 | (LCD_C_PAR | LCD_C_SPI3_24), PCF2113_3V3 = 7 | (LCD_C_PAR | LCD_C_I2C | LCD_C_BST | LCD_C_CTR), PCF2116_3V3 = 8 | (LCD_C_PAR | LCD_C_I2C | LCD_C_BST), PCF2116_5V = 9 | (LCD_C_PAR | LCD_C_I2C), PCF2119_3V3 = 10 | (LCD_C_PAR | LCD_C_I2C | LCD_C_BST | LCD_C_CTR), AIP31068 = 12 | (LCD_C_SPI3_9 | LCD_C_I2C | LCD_C_BST), SSD1803_3V3 = 13 | (LCD_C_PAR | LCD_C_SPI3_24 | LCD_C_I2C | LCD_C_BST | LCD_C_CTR | LCD_C_PDN), US2066_3V3 = 15 | (LCD_C_PAR | LCD_C_SPI3_24 | LCD_C_I2C | LCD_C_CTR | LCD_C_PDN) } |
LCD Controller Device. More... | |
enum | LCDCursor { CurOff_BlkOff = 0x00, CurOn_BlkOff = 0x02, CurOff_BlkOn = 0x01, CurOn_BlkOn = 0x03 } |
LCD Cursor control. More... | |
enum | LCDMode { DispOff = 0x00, DispOn = 0x04 } |
LCD Display control. More... | |
enum | LCDBacklight { LightOff, LightOn } |
LCD Backlight control. More... | |
enum | LCDBlink { BlinkOff, BlinkOn } |
LCD Blink control (UDC), supported for some Controllers. More... | |
enum | LCDOrient { Top, Bottom } |
LCD Orientation control, supported for some Controllers. More... | |
Public Member Functions | |
TextLCD_SPI_N_3_10 (SPI *spi, PinName cs, LCDType type=LCD16x2, PinName bl=NC, LCDCtrl ctrl=AIP31068) | |
Create a TextLCD interface using a controller with native SPI3 10 bits interface Note: current mbed libs only support SPI 10 bit mode for NXP platforms. | |
int | putc (int c) |
Write a character to the LCD. | |
int | printf (const char *format,...) |
Write a formated string to the LCD. | |
void | locate (int column, int row) |
Locate cursor to a screen column and row. | |
int | getAddress (int column, int row) |
Return the memoryaddress of screen column and row location. | |
void | setAddress (int column, int row) |
Set the memoryaddress of screen column and row location. | |
void | cls () |
Clear the screen and locate to 0,0. | |
int | rows () |
Return the number of rows. | |
int | columns () |
Return the number of columns. | |
void | setCursor (LCDCursor cursorMode) |
Set the Cursormode. | |
void | setMode (LCDMode displayMode) |
Set the Displaymode. | |
void | setBacklight (LCDBacklight backlightMode) |
Set the Backlight mode. | |
void | setUDC (unsigned char c, char *udc_data) |
Set User Defined Characters (UDC) | |
void | setUDCBlink (LCDBlink blinkMode) |
Set UDC Blink setUDCBlink method is supported by some compatible devices (eg SSD1803) | |
void | setContrast (unsigned char c=LCD_DEF_CONTRAST) |
Set Contrast setContrast method is supported by some compatible devices (eg ST7032i) that have onboard LCD voltage generation Code imported from fork by JH1PJL. | |
void | setPower (bool powerOn=true) |
Set Power setPower method is supported by some compatible devices (eg SSD1803) that have power down modes. | |
void | setOrient (LCDOrient orient=Top) |
Set Orient setOrient method is supported by some compatible devices (eg SSD1803, US2066) that have top/bottom view modes. | |
Protected Types | |
enum | _LCDCtrl_Idx |
LCD controller select, mainly used for LCD40x4. More... | |
Protected Member Functions | |
virtual int | _putc (int value) |
Write a single character (Stream implementation) | |
void | _init () |
Low level method for LCD controller. | |
void | _initCtrl () |
Low level initialisation method for LCD controller. | |
int | _address (int column, int row) |
Low level character address set method. | |
void | _setCursor (LCDCursor show) |
Low level cursor enable or disable method. | |
void | _setUDC (unsigned char c, char *udc_data) |
Low level method to store user defined characters for current controller. | |
void | _setCursorAndDisplayMode (LCDMode displayMode, LCDCursor cursorType) |
Low level method to restore the cursortype and display mode for current controller. | |
void | _writeNibble (int value) |
Low level nibble write operation to LCD controller (serial or parallel) | |
void | _writeCommand (int command) |
Low level command byte write operation to LCD controller. | |
void | _writeData (int data) |
Low level data byte write operation to LCD controller (serial or parallel). |
Detailed Description
Create a TextLCD interface using a controller with native SPI3 10 bits interface Note: current mbed libs only support SPI 10 bit mode for NXP platforms.
Definition at line 1046 of file TextLCD.h.
Member Enumeration Documentation
enum _LCDCtrl_Idx [protected, inherited] |
enum LCDBacklight [inherited] |
enum LCDBlink [inherited] |
enum LCDCtrl [inherited] |
LCD Controller Device.
- Enumerator:
enum LCDCursor [inherited] |
enum LCDMode [inherited] |
enum LCDOrient [inherited] |
enum LCDType [inherited] |
LCD panel format.
- Enumerator:
Constructor & Destructor Documentation
TextLCD_SPI_N_3_10 | ( | SPI * | spi, |
PinName | cs, | ||
LCDType | type = LCD16x2 , |
||
PinName | bl = NC , |
||
LCDCtrl | ctrl = AIP31068 |
||
) |
Create a TextLCD interface using a controller with native SPI3 10 bits interface Note: current mbed libs only support SPI 10 bit mode for NXP platforms.
Create a TextLCD interface using a controller with a native SPI3 10 bits interface.
- Parameters:
-
spi SPI Bus cs chip select pin (active low) type Sets the panel size/addressing mode (default = LCD16x2) bl Backlight control line (optional, default = NC) ctrl LCD controller (default = AIP31068)
Definition at line 2669 of file TextLCD.cpp.
Member Function Documentation
int _address | ( | int | column, |
int | row | ||
) | [protected, inherited] |
Low level character address set method.
Definition at line 1250 of file TextLCD.cpp.
void _init | ( | ) | [protected, inherited] |
Low level method for LCD controller.
Init the LCD Controller(s) Clear display.
Definition at line 156 of file TextLCD.cpp.
void _initCtrl | ( | ) | [protected, inherited] |
Low level initialisation method for LCD controller.
Init the LCD controller 4-bit mode, number of lines, fonttype, no cursor etc.
Note: some configurations are commented out because they have not yet been tested due to lack of hardware
Definition at line 179 of file TextLCD.cpp.
int _putc | ( | int | value ) | [protected, virtual, inherited] |
Write a single character (Stream implementation)
Definition at line 1152 of file TextLCD.cpp.
void _setCursor | ( | LCDCursor | show ) | [protected, inherited] |
Low level cursor enable or disable method.
Low level method to restore the cursortype and display mode for current controller.
Definition at line 1544 of file TextLCD.cpp.
void _setUDC | ( | unsigned char | c, |
char * | udc_data | ||
) | [protected, inherited] |
Low level method to store user defined characters for current controller.
Definition at line 1599 of file TextLCD.cpp.
void _writeCommand | ( | int | command ) | [protected, inherited] |
Low level command byte write operation to LCD controller.
Methods resets the RS bit and provides the required timing for the command.
Definition at line 1227 of file TextLCD.cpp.
void _writeData | ( | int | data ) | [protected, inherited] |
Low level data byte write operation to LCD controller (serial or parallel).
Methods sets the RS bit and provides the required timing for the data.
Definition at line 1237 of file TextLCD.cpp.
void _writeNibble | ( | int | value ) | [protected, inherited] |
Low level nibble write operation to LCD controller (serial or parallel)
Definition at line 1195 of file TextLCD.cpp.
void cls | ( | ) | [inherited] |
Clear the screen and locate to 0,0.
Clear the screen, Cursor home.
Definition at line 1103 of file TextLCD.cpp.
int columns | ( | ) | [inherited] |
Return the number of columns.
- Parameters:
-
return The number of columns return The number of columns
Note: some configurations are commented out because they have not yet been tested due to lack of hardware
Definition at line 1464 of file TextLCD.cpp.
int getAddress | ( | int | column, |
int | row | ||
) | [inherited] |
Return the memoryaddress of screen column and row location.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0 return The memoryaddress of screen column and row location
Definition at line 1264 of file TextLCD.cpp.
void locate | ( | int | column, |
int | row | ||
) | [inherited] |
Locate cursor to a screen column and row.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0
Definition at line 1139 of file TextLCD.cpp.
int printf | ( | const char * | format, |
... | |||
) | [inherited] |
Write a formated string to the LCD.
- Parameters:
-
format A printf-style format string, followed by the variables to use in formating the string.
int putc | ( | int | c ) | [inherited] |
Write a character to the LCD.
- Parameters:
-
c The character to write to the display
int rows | ( | ) | [inherited] |
Return the number of rows.
- Parameters:
-
return The number of rows return The number of rows
Note: some configurations are commented out because they have not yet been tested due to lack of hardware
Definition at line 1477 of file TextLCD.cpp.
void setAddress | ( | int | column, |
int | row | ||
) | [inherited] |
Set the memoryaddress of screen column and row location.
- Parameters:
-
column The horizontal position from the left, indexed from 0 row The vertical position from the top, indexed from 0
Definition at line 1430 of file TextLCD.cpp.
void setBacklight | ( | LCDBacklight | backlightMode ) | [inherited] |
Set the Backlight mode.
- Parameters:
-
backlightMode The Backlight mode (LightOff, LightOn)
Definition at line 1554 of file TextLCD.cpp.
void setContrast | ( | unsigned char | c = LCD_DEF_CONTRAST ) |
[inherited] |
Set Contrast setContrast method is supported by some compatible devices (eg ST7032i) that have onboard LCD voltage generation Code imported from fork by JH1PJL.
Set Contrast setContrast method is supported by some compatible devices (eg ST7032i) that have onboard LCD voltage generation Initial code for ST70XX imported from fork by JH1PJL.
- Parameters:
-
unsigned char c contrast data (6 significant bits, valid range 0..63, Value 0 will disable the Vgen)
- Returns:
- none
Definition at line 1706 of file TextLCD.cpp.
void setCursor | ( | LCDCursor | cursorMode ) | [inherited] |
Set the Cursormode.
- Parameters:
-
cursorMode The Cursor mode (CurOff_BlkOff, CurOn_BlkOff, CurOff_BlkOn, CurOn_BlkOn)
Definition at line 1488 of file TextLCD.cpp.
void setMode | ( | LCDMode | displayMode ) | [inherited] |
Set the Displaymode.
- Parameters:
-
displayMode The Display mode (DispOff, DispOn)
Definition at line 1501 of file TextLCD.cpp.
void setOrient | ( | LCDOrient | orient = Top ) |
[inherited] |
Set Orient setOrient method is supported by some compatible devices (eg SSD1803, US2066) that have top/bottom view modes.
- Parameters:
-
LCDOrient orient Orientation
- Returns:
- none
Definition at line 1849 of file TextLCD.cpp.
void setPower | ( | bool | powerOn = true ) |
[inherited] |
Set Power setPower method is supported by some compatible devices (eg SSD1803) that have power down modes.
- Parameters:
-
bool powerOn Power on/off
- Returns:
- none
Definition at line 1777 of file TextLCD.cpp.
void setUDC | ( | unsigned char | c, |
char * | udc_data | ||
) | [inherited] |
Set User Defined Characters (UDC)
Set User Defined Characters.
- Parameters:
-
unsigned char c The Index of the UDC (0..7) char *udc_data The bitpatterns for the UDC (8 bytes of 5 significant bits)
Definition at line 1569 of file TextLCD.cpp.
void setUDCBlink | ( | LCDBlink | blinkMode ) | [inherited] |
Set UDC Blink setUDCBlink method is supported by some compatible devices (eg SSD1803)
- Parameters:
-
blinkMode The Blink mode (BlinkOff, BlinkOn)
Definition at line 1620 of file TextLCD.cpp.
Generated on Wed Jul 13 2022 08:07:13 by 1.7.2