Digole Serial Display FRDM-KL25Z Test Program Requires pull-ups on the SDA & SCL data lines. Digole Serial modified with extra Stop commands so that it works with the FRDM-KL25Z I2C library functions. Works fine on LPC1768 without extra Stop commands.

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

DigoleSerialDisp Class Reference

DigoleSerialDisp Class Reference

Digole Serial LCD/OLED Library www.digole.com/index.php?productID=535. More...

#include <DigoleSerialDisp.h>

Public Member Functions

 DigoleSerialDisp (PinName sda, PinName scl, uint8_t address=0x27)
 Create a new Digole Serial Display interface.
void begin (void)
 Carryover from Arduino library, not needed.
size_t write (const char x)
 Write out a raw character.
size_t write (const char *buffer, size_t size)
 Write out raw data from a buffer.
size_t write (const char *str)
 Write out raw string.
size_t print (const char c)
 Prints a char to the display in a single I2C transmission using "TTb\0".
size_t print (const char s[])
 Prints a string of data to the display in a single I2C transmission using "TTbbb...\0".
size_t print (unsigned char u, int base=DEC)
 Print out an unsigned char as a number.
size_t print (int i, int base=DEC)
 Print out an integer.
size_t print (unsigned int u, int base=DEC)
 Print out an unsigned integer.
size_t print (long l, int base=DEC)
 Print out a long as a number.
size_t print (unsigned long l, int base=DEC)
 Print out an unsigned long.
size_t print (double f, int digits=2)
 Print out a double.
size_t println (const char s[])
 Prints a string of data to the display in a single I2C transmission using "TTbbb...\0".
size_t println (char c)
 Prints a char the display in a single I2C transmission using "TTb\0".
size_t println (unsigned char u, int base=DEC)
 Prints an unsigned char as a number.
size_t println (int i, int base=DEC)
 Print out an integer.
size_t println (unsigned int u, int base=DEC)
 Print out an unsigned char as a number.
size_t println (long l, int base=DEC)
 Print out a long as a number.
size_t println (unsigned long l, int base=DEC)
 Print out an unsigned long.
size_t println (double f, int digits=2)
 Print out a double.
size_t println (void)
 prints, well, nothing in this case, but pretend we printed a newline
void disableCursor (void)
 Turns off the cursor.
void enableCursor (void)
 Turns on the cursor.
void drawStr (uint8_t x, uint8_t y, const char *s)
 Displays a string at specified coordinates.
void setPrintPos (uint8_t x, uint8_t y, uint8_t graph=_TEXT_)
 Sets the print position for graphics or text.
void clearScreen (void)
 Clears the display screen.
void setLCDColRow (uint8_t col, uint8_t row)
 Configure your LCD if other than 1602 and the chip is other than KS0066U/F / HD44780.
void setI2CAddress (uint8_t add)
 Sets a new I2C address for the display (default is 0x27), the adapter will store the new address in memory.
void displayConfig (uint8_t v)
 Display Config on/off, the factory default set is on, so, when the module is powered up, it will display current communication mode on LCD, after you design finished, you can turn it off.
void preprint (void)
 Holdover from Arduino library; not needed.
void setFont (uint8_t font)
 Sets the font.
void nextTextLine (void)
 go to next text line, depending on the font size
void setColor (uint8_t)
 set color for graphic function
void backLightOn (void)
 Turn on back light.
void backLightOff (void)
 Turn off back light.
void directCommand (uint8_t d)
 send command to LCD drectly
void directData (uint8_t d)
 send data to LCD drectly
void moveArea (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, char xoffset, char yoffset)
 Move rectangle area on screen to another place.
void displayStartScreen (uint8_t m)
 Display startup screen.
void setMode (uint8_t m)
 Set display mode.
void setTextPosBack (void)
 set text position back to previous, only one back allowed
void setLCDChip (uint8_t chip)
 Only for universal serial adapter.
void uploadStartScreen (int lon, const unsigned char *data)
 Set Start Screen, 1st B is the lower byte of data length.
void uploadUserFont (int lon, const unsigned char *data, uint8_t sect)
 Upload a user font.
void digitalOutput (uint8_t x)
 Send a Byte to output head on board.

Detailed Description

Digole Serial LCD/OLED Library www.digole.com/index.php?productID=535.

Includes Arduino Print class member functions

Definition at line 33 of file DigoleSerialDisp.h.


Constructor & Destructor Documentation

DigoleSerialDisp ( PinName  sda,
PinName  scl,
uint8_t  address = 0x27 
)

Create a new Digole Serial Display interface.

Parameters:
sdais the pin for I2C SDA
sclis the pin for I2C SCL
addressis the 7-bit address (default is 0x27 for the device)

Definition at line 24 of file DigoleSerialDisp.cpp.


Member Function Documentation

void backLightOff ( void   )

Turn off back light.

Definition at line 452 of file DigoleSerialDisp.cpp.

void backLightOn ( void   )

Turn on back light.

Definition at line 447 of file DigoleSerialDisp.cpp.

void begin ( void   )

Carryover from Arduino library, not needed.

Definition at line 47 of file DigoleSerialDisp.h.

void clearScreen ( void   )

Clears the display screen.

Definition at line 301 of file DigoleSerialDisp.cpp.

void digitalOutput ( uint8_t  x )

Send a Byte to output head on board.

Parameters:
xis the byte to output

Definition at line 553 of file DigoleSerialDisp.cpp.

void directCommand ( uint8_t  d )

send command to LCD drectly

Parameters:
d- command

Definition at line 457 of file DigoleSerialDisp.cpp.

void directData ( uint8_t  d )

send data to LCD drectly

Parameters:
dis the data

Definition at line 462 of file DigoleSerialDisp.cpp.

void disableCursor ( void   )

Turns off the cursor.

Definition at line 266 of file DigoleSerialDisp.cpp.

void displayConfig ( uint8_t  v )

Display Config on/off, the factory default set is on, so, when the module is powered up, it will display current communication mode on LCD, after you design finished, you can turn it off.

Parameters:
vis the 1 is on, 0 is off

Definition at line 322 of file DigoleSerialDisp.cpp.

void displayStartScreen ( uint8_t  m )

Display startup screen.

Definition at line 478 of file DigoleSerialDisp.cpp.

void drawStr ( uint8_t  x,
uint8_t  y,
const char *  s 
)

Displays a string at specified coordinates.

Parameters:
xis the x coordinate to display the string
yis the y coordinate to display the string
sis the string to display

Definition at line 278 of file DigoleSerialDisp.cpp.

void enableCursor ( void   )

Turns on the cursor.

Definition at line 272 of file DigoleSerialDisp.cpp.

void moveArea ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
char  xoffset,
char  yoffset 
)

Move rectangle area on screen to another place.

Parameters:
x0,y1is the top left of the area to move
x1,y1is the bottom right of the area to move
xoffset,yoffsetis the the distance to move

Definition at line 467 of file DigoleSerialDisp.cpp.

void nextTextLine ( void   )

go to next text line, depending on the font size

Definition at line 432 of file DigoleSerialDisp.cpp.

void preprint ( void   )

Holdover from Arduino library; not needed.

Definition at line 328 of file DigoleSerialDisp.cpp.

size_t print ( int  i,
int  base = DEC 
)

Print out an integer.

Parameters:
iis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 115 of file DigoleSerialDisp.cpp.

size_t print ( unsigned int  u,
int  base = DEC 
)

Print out an unsigned integer.

Parameters:
uis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 120 of file DigoleSerialDisp.cpp.

size_t print ( unsigned long  l,
int  base = DEC 
)

Print out an unsigned long.

Parameters:
lis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 141 of file DigoleSerialDisp.cpp.

size_t print ( const char  c )

Prints a char to the display in a single I2C transmission using "TTb\0".

Parameters:
cis the character to print
Returns:
1

Definition at line 58 of file DigoleSerialDisp.cpp.

size_t print ( long  l,
int  base = DEC 
)

Print out a long as a number.

Parameters:
lis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 125 of file DigoleSerialDisp.cpp.

size_t print ( double  f,
int  digits = 2 
)

Print out a double.

Parameters:
fis the integer to print
digitsis the number of digits after the decimal

Definition at line 147 of file DigoleSerialDisp.cpp.

size_t print ( const char  s[] )

Prints a string of data to the display in a single I2C transmission using "TTbbb...\0".

Parameters:
sis the null-terminated char array to print
Returns:
length of s

Definition at line 69 of file DigoleSerialDisp.cpp.

size_t print ( unsigned char  u,
int  base = DEC 
)

Print out an unsigned char as a number.

Parameters:
uis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 110 of file DigoleSerialDisp.cpp.

size_t println ( int  i,
int  base = DEC 
)

Print out an integer.

Parameters:
iis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 159 of file DigoleSerialDisp.cpp.

size_t println ( unsigned int  u,
int  base = DEC 
)

Print out an unsigned char as a number.

Parameters:
uis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 166 of file DigoleSerialDisp.cpp.

size_t println ( long  l,
int  base = DEC 
)

Print out a long as a number.

Parameters:
lis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 173 of file DigoleSerialDisp.cpp.

size_t println ( unsigned long  l,
int  base = DEC 
)

Print out an unsigned long.

Parameters:
lis the integer to print
baseis the base to print, either DEC (default), HEX, BIN
Returns:
number of chars written

Definition at line 180 of file DigoleSerialDisp.cpp.

size_t println ( double  f,
int  digits = 2 
)

Print out a double.

Parameters:
fis the integer to print
digitsis the number of digits after the decimal
Returns:
number of chars written

Definition at line 187 of file DigoleSerialDisp.cpp.

size_t println ( void   )

prints, well, nothing in this case, but pretend we printed a newline

Returns:
1

Definition at line 194 of file DigoleSerialDisp.cpp.

size_t println ( const char  s[] )

Prints a string of data to the display in a single I2C transmission using "TTbbb...\0".

Parameters:
sis the null-terminated char array to print
Returns:
length of s

Definition at line 84 of file DigoleSerialDisp.cpp.

size_t println ( char  c )

Prints a char the display in a single I2C transmission using "TTb\0".

Parameters:
cis the character to print
Returns:
1
size_t println ( unsigned char  u,
int  base = DEC 
)

Prints an unsigned char as a number.

Parameters:
uis the unsigned char number
Returns:
1

Definition at line 152 of file DigoleSerialDisp.cpp.

void setColor ( uint8_t  color )

set color for graphic function

Definition at line 442 of file DigoleSerialDisp.cpp.

void setFont ( uint8_t  font )

Sets the font.

font - available fonts: 6,10,18,51,120,123, user font 200-203

Definition at line 437 of file DigoleSerialDisp.cpp.

void setI2CAddress ( uint8_t  add )

Sets a new I2C address for the display (default is 0x27), the adapter will store the new address in memory.

Parameters:
addressis the the new address

Definition at line 315 of file DigoleSerialDisp.cpp.

void setLCDChip ( uint8_t  chip )

Only for universal serial adapter.

Definition at line 515 of file DigoleSerialDisp.cpp.

void setLCDColRow ( uint8_t  col,
uint8_t  row 
)

Configure your LCD if other than 1602 and the chip is other than KS0066U/F / HD44780.

Parameters:
colis the number of columns
rowis the number of rows

Definition at line 307 of file DigoleSerialDisp.cpp.

void setMode ( uint8_t  m )

Set display mode.

Definition at line 484 of file DigoleSerialDisp.cpp.

void setPrintPos ( uint8_t  x,
uint8_t  y,
uint8_t  graph = _TEXT_ 
)

Sets the print position for graphics or text.

Parameters:
xis the x coordinate to display the string
yis the y coordinate to display the string
graphif set to _TEXT_ affects subsequent text position, otherwise, affects graphics position

Definition at line 288 of file DigoleSerialDisp.cpp.

void setTextPosBack ( void   )

set text position back to previous, only one back allowed

Definition at line 490 of file DigoleSerialDisp.cpp.

void uploadStartScreen ( int  lon,
const unsigned char *  data 
)

Set Start Screen, 1st B is the lower byte of data length.

Convert images to C array here: http://www.digole.com/tools/PicturetoC_Hex_converter.php

Parameters:
lonis the length of data
datais the binary data

Definition at line 521 of file DigoleSerialDisp.cpp.

void uploadUserFont ( int  lon,
const unsigned char *  data,
uint8_t  sect 
)

Upload a user font.

Parameters:
lonis the length of data
datais the user font data
sectis the section of memory you want to upload to

Definition at line 538 of file DigoleSerialDisp.cpp.

size_t write ( const char  x )

Write out a raw character.

Parameters:
xis the character to write
Returns:
1

Definition at line 32 of file DigoleSerialDisp.cpp.

size_t write ( const char *  buffer,
size_t  size 
)

Write out raw data from a buffer.

Parameters:
bufferis the char array to write
sizeis the the number of bytes to write
Returns:
size

Definition at line 45 of file DigoleSerialDisp.cpp.

size_t write ( const char *  str )

Write out raw string.

Parameters:
stris the string to write
Returns:
number of bytes written

Definition at line 39 of file DigoleSerialDisp.cpp.