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) | |
| 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. | |
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.
| enum LCDType |
LCD panel format.
| 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.
Create and Nokia LCD interface, using a SPI and two DigitalOut interfaces.
| mosi | SPI data out | |
| sclk | SPI clock | |
| cs | Chip Select (DigitalOut) | |
| rst | Reset (DigitalOut) | |
| type | The LCDType to select driver chip variants |
Definition at line 15 of file NokiaLCD.cpp.
| void background | ( | int | c | ) |
| void cls | ( | ) |
Clear the screen and locate to 0,0.
Definition at line 286 of file NokiaLCD.cpp.
| void fill | ( | int | x, | |
| int | y, | |||
| int | width, | |||
| int | height, | |||
| int | colour | |||
| ) |
Fill an area of the screen.
| x | horizontal position from left | |
| y | vertical position from top | |
| width | width in pixels | |
| height | height in pixels | |
| colour | 24-bit colour in format 0x00RRGGBB |
Definition at line 312 of file NokiaLCD.cpp.
| void foreground | ( | int | c | ) |
| void locate | ( | int | column, | |
| int | row | |||
| ) |
Locate to a screen column and row.
| column | The horizontal position from the left, indexed from 0 | |
| row | The vertical position from the top, indexed from 0 |
Definition at line 254 of file NokiaLCD.cpp.
| void pixel | ( | int | x, | |
| int | y, | |||
| int | colour | |||
| ) |
Set a pixel on te screen.
| x | horizontal position from left | |
| y | vertical position from top | |
| colour | 24-bit colour in format 0x00RRGGBB |
Definition at line 305 of file NokiaLCD.cpp.
| int printf | ( | const char * | format, | |
| ... | ||||
| ) |
Write a formated string to the LCD.
| format | A printf-style format string, followed by the variables to use in formating the string. |
| int putc | ( | int | c | ) |
Write a character to the LCD.
| c | The character to write to the display |