PCF2119x based I2C LCD Library. SUNLIKE DISPLAY SCG002B (PCF2119SU/2)

Dependents:   barometer-m0 PCF2119_hello

Fork of TextLCD by Simon Ford

Embed: (wiki syntax)

« Back to documentation index

PCF2119 Class Reference

PCF2119 Class Reference

A PCF2119 interface for driving I2C PCF2119x-based LCDs. More...

#include <PCF2119.h>

Public Types

enum  LCDType { LCD16x2, LCD16x2B, LCD20x2, LCD20x4 }
 

LCD panel format.

More...

Public Member Functions

 PCF2119 (PinName sda, PinName sck, PinName reset, LCDType type=LCD16x2, char addr=0x74)
 Create a TextLCD interface.
 PCF2119 (I2C &i2c, PinName reset, LCDType type=LCD16x2, char addr=0x74)
 Create a TextLCD interface.
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 to a screen column and row.
void cls ()
 Clear the screen and locate to 0,0.

Detailed Description

A PCF2119 interface for driving I2C PCF2119x-based LCDs.

Currently supports 16x2, 20x2 and 20x4 panels

 #include "mbed.h"
 #include "PCF2119.h"
 
 TextLCD lcd(p10, p12, p15, p30); // sda, sck, reset
 
 int main() {
     lcd.printf("Hello World!\n");
 }

Definition at line 46 of file PCF2119.h.


Member Enumeration Documentation

enum LCDType

LCD panel format.

Enumerator:
LCD16x2 

16x2 LCD panel (default)

LCD16x2B 

16x2 LCD panel alternate addressing

LCD20x2 

20x2 LCD panel

LCD20x4 

20x4 LCD panel

Definition at line 50 of file PCF2119.h.


Constructor & Destructor Documentation

PCF2119 ( PinName  sda,
PinName  sck,
PinName  reset,
LCDType  type = LCD16x2,
char  addr = 0x74 
)

Create a TextLCD interface.

Parameters:
sdaI2C data line pin
sckI2C clock line pin
resetReset pin
typeSets the panel size/addressing mode (default = LCD16x2)
addrI2C address (default = 0x74)

Definition at line 29 of file PCF2119.cpp.

PCF2119 ( I2C &  i2c,
PinName  reset,
LCDType  type = LCD16x2,
char  addr = 0x74 
)

Create a TextLCD interface.

Parameters:
i2cI2C class
resetReset pin
typeSets the panel size/addressing mode (default = LCD16x2)
addrI2C address (default = 0x74)

Definition at line 34 of file PCF2119.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0,0.

Definition at line 72 of file PCF2119.cpp.

void locate ( int  column,
int  row 
)

Locate to a screen column and row.

Parameters:
columnThe horizontal position from the left, indexed from 0
rowThe vertical position from the top, indexed from 0

Definition at line 80 of file PCF2119.cpp.

int printf ( const char *  format,
  ... 
)

Write a formated string to the LCD.

Parameters:
formatA printf-style format string, followed by the variables to use in formating the string.
int putc ( int  c )

Write a character to the LCD.

Parameters:
cThe character to write to the display