LPC1768 Mini-DK board with 2.8" SPI TFT and SPI touch

Dependencies:   Mini-DK mbed SDFileSystem

WARNING: filetoflash (SD to CPU flash)

The SPI_TFT library called from Mini-DK.lib contains an option to copy an image from the SD card to the CPU flash memory. This allows you to use an image as background without speed loss when writing other text and graphics.

By default, this option is enabled.

It can be disabled by uncommenting the #define mentioned below in Mini_DK.h:

#define NO_FLASH_BUFFER

Since the flash memory has limited write endurance, DO NOT use this feature when you intend to read multiple images from the SD card (eg: when used as a photo frame).

Committer:
frankvnk
Date:
Thu Jan 03 10:54:09 2013 +0000
Revision:
2:d0acbd263ec7
Parent:
SPI_TFT/TextDisplay.h@0:ee7076d8260a
ONLY FOR TEST

Who changed what in which revision?

UserRevisionLine numberNew contents of line
frankvnk 0:ee7076d8260a 1 /* mbed TextDisplay Library Base Class
frankvnk 0:ee7076d8260a 2 * Copyright (c) 2007-2009 sford
frankvnk 0:ee7076d8260a 3 * Released under the MIT License: http://mbed.org/license/mit
frankvnk 0:ee7076d8260a 4 *
frankvnk 0:ee7076d8260a 5 * A common base class for Text displays
frankvnk 0:ee7076d8260a 6 * To port a new display, derive from this class and implement
frankvnk 0:ee7076d8260a 7 * the constructor (setup the display), character (put a character
frankvnk 0:ee7076d8260a 8 * at a location), rows and columns (number of rows/cols) functions.
frankvnk 0:ee7076d8260a 9 * Everything else (locate, printf, putc, cls) will come for free
frankvnk 0:ee7076d8260a 10 *
frankvnk 0:ee7076d8260a 11 * The model is the display will wrap at the right and bottom, so you can
frankvnk 0:ee7076d8260a 12 * keep writing and will always get valid characters. The location is
frankvnk 0:ee7076d8260a 13 * maintained internally to the class to make this easy
frankvnk 0:ee7076d8260a 14 */
frankvnk 0:ee7076d8260a 15
frankvnk 0:ee7076d8260a 16 #ifndef MBED_TEXTDISPLAY_H
frankvnk 0:ee7076d8260a 17 #define MBED_TEXTDISPLAY_H
frankvnk 0:ee7076d8260a 18
frankvnk 0:ee7076d8260a 19 #include "mbed.h"
frankvnk 0:ee7076d8260a 20
frankvnk 0:ee7076d8260a 21 class TextDisplay : public Stream {
frankvnk 0:ee7076d8260a 22 public:
frankvnk 0:ee7076d8260a 23
frankvnk 0:ee7076d8260a 24 // functions needing implementation in derived implementation class
frankvnk 0:ee7076d8260a 25 /** Create a TextDisplay interface
frankvnk 0:ee7076d8260a 26 *
frankvnk 0:ee7076d8260a 27 * @param name The name used in the path to access the strean through the filesystem
frankvnk 0:ee7076d8260a 28 */
frankvnk 0:ee7076d8260a 29 TextDisplay(const char *name = NULL);
frankvnk 0:ee7076d8260a 30
frankvnk 0:ee7076d8260a 31 /** output a character at the given position
frankvnk 0:ee7076d8260a 32 *
frankvnk 0:ee7076d8260a 33 * @param column column where charater must be written
frankvnk 0:ee7076d8260a 34 * @param row where character must be written
frankvnk 0:ee7076d8260a 35 * @param c the character to be written to the TextDisplay
frankvnk 0:ee7076d8260a 36 */
frankvnk 0:ee7076d8260a 37 virtual void character(int column, int row, int c) = 0;
frankvnk 0:ee7076d8260a 38
frankvnk 0:ee7076d8260a 39 /** return number if rows on TextDisplay
frankvnk 0:ee7076d8260a 40 * @result number of rows
frankvnk 0:ee7076d8260a 41 */
frankvnk 0:ee7076d8260a 42 virtual int rows() = 0;
frankvnk 0:ee7076d8260a 43
frankvnk 0:ee7076d8260a 44 /** return number if columns on TextDisplay
frankvnk 0:ee7076d8260a 45 * @result number of rows
frankvnk 0:ee7076d8260a 46 */
frankvnk 0:ee7076d8260a 47 virtual int columns() = 0;
frankvnk 0:ee7076d8260a 48
frankvnk 0:ee7076d8260a 49 // functions that come for free, but can be overwritten
frankvnk 0:ee7076d8260a 50
frankvnk 0:ee7076d8260a 51 /** redirect output from a stream (stoud, sterr) to display
frankvnk 0:ee7076d8260a 52 * @param stream stream that shall be redirected to the TextDisplay
frankvnk 0:ee7076d8260a 53 */
frankvnk 0:ee7076d8260a 54 virtual bool claim (FILE *stream);
frankvnk 0:ee7076d8260a 55
frankvnk 0:ee7076d8260a 56 /** clear screen
frankvnk 0:ee7076d8260a 57 */
frankvnk 0:ee7076d8260a 58 virtual void cls();
frankvnk 0:ee7076d8260a 59 virtual void locate(int column, int row);
frankvnk 0:ee7076d8260a 60 virtual void foreground(uint16_t colour);
frankvnk 0:ee7076d8260a 61 virtual void background(uint16_t colour);
frankvnk 0:ee7076d8260a 62 // putc (from Stream)
frankvnk 0:ee7076d8260a 63 // printf (from Stream)
frankvnk 0:ee7076d8260a 64
frankvnk 0:ee7076d8260a 65 protected:
frankvnk 0:ee7076d8260a 66
frankvnk 0:ee7076d8260a 67 virtual int _putc(int value);
frankvnk 0:ee7076d8260a 68 virtual int _getc();
frankvnk 0:ee7076d8260a 69
frankvnk 0:ee7076d8260a 70 // character location
frankvnk 0:ee7076d8260a 71 uint16_t _column;
frankvnk 0:ee7076d8260a 72 uint16_t _row;
frankvnk 0:ee7076d8260a 73
frankvnk 0:ee7076d8260a 74 // colours
frankvnk 0:ee7076d8260a 75 uint16_t _foreground;
frankvnk 0:ee7076d8260a 76 uint16_t _background;
frankvnk 0:ee7076d8260a 77 char *_path;
frankvnk 0:ee7076d8260a 78 };
frankvnk 0:ee7076d8260a 79
frankvnk 0:ee7076d8260a 80 #endif