This includes all known improvements from other people's spins on the Nokia library, including Alistair Popple's fix to the very poor contrast on newer LCD 6100 displays.

Fork of NokiaLCD by Iftekhar Choudhury

Embed: (wiki syntax)

« Back to documentation index

NokiaLCD Class Reference

NokiaLCD Class Reference

An interface for the 130x130 Nokia Mobile phone screens. More...

#include <NokiaLCD.h>

Public Types

enum  LCDType { LCD6100, LCD6610 }
 

LCD panel format.

More...

Public Member Functions

 NokiaLCD (PinName mosi, PinName sclk, PinName cs, PinName rst, LCDType type=LCD6100, int contrast=39)
 Create and Nokia LCD interface, using a SPI and two DigitalOut interfaces.
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.
void pixel (int x, int y, int colour)
 Set a pixel on te screen.
void fill (int x, int y, int width, int height, int colour)
 Fill an area of the screen.
void foreground (int c)
 Set the foreground colour.
void background (int c)
 Set the background colour.
void newline ()
 Move to the next line.

Detailed Description

An interface for the 130x130 Nokia Mobile phone screens.

 #include "mbed.h"
 #include "NokiaLCD.h"

 NokiaLCD lcd(p5, p7, p8, p9, NokiaLCD::6610); // mosi, sclk, cs, rst, type

 int main() {
     lcd.printf("Hello World!");
 }

Definition at line 41 of file NokiaLCD.h.


Member Enumeration Documentation

enum LCDType

LCD panel format.

Enumerator:
LCD6100 

Nokia 6100, as found on sparkfun board (default)

LCD6610 

Nokia 6610, as found on olimex board.

Definition at line 45 of file NokiaLCD.h.


Constructor & Destructor Documentation

NokiaLCD ( PinName  mosi,
PinName  sclk,
PinName  cs,
PinName  rst,
LCDType  type = LCD6100,
int  contrast = 39 
)

Create and Nokia LCD interface, using a SPI and two DigitalOut interfaces.

Parameters:
mosiSPI data out
sclkSPI clock
csChip Select (DigitalOut)
rstReset (DigitalOut)
typeThe LCDType to select driver chip variants

Definition at line 15 of file NokiaLCD.cpp.


Member Function Documentation

void background ( int  c )

Set the background colour.

Parameters:
c24-bit colour

Definition at line 665 of file NokiaLCD.cpp.

void cls (  )

Clear the screen and locate to 0,0.

Definition at line 288 of file NokiaLCD.cpp.

void fill ( int  x,
int  y,
int  width,
int  height,
int  colour 
)

Fill an area of the screen.

Parameters:
xhorizontal position from left
yvertical position from top
widthwidth in pixels
heightheight in pixels
colour24-bit colour in format 0x00RRGGBB

Definition at line 314 of file NokiaLCD.cpp.

void foreground ( int  c )

Set the foreground colour.

Parameters:
c24-bit colour

Definition at line 661 of file NokiaLCD.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 256 of file NokiaLCD.cpp.

void newline (  )

Move to the next line.

Definition at line 261 of file NokiaLCD.cpp.

void pixel ( int  x,
int  y,
int  colour 
)

Set a pixel on te screen.

Parameters:
xhorizontal position from left
yvertical position from top
colour24-bit colour in format 0x00RRGGBB

Definition at line 307 of file NokiaLCD.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