Library to control a QVGA TFT connected to SPI. You can use printf to print text The lib can handle different fonts, draw lines, circles, rect and bmp

Committer:
dreschpe
Date:
Tue Sep 11 20:44:49 2012 +0000
Revision:
13:d525819cb601
Parent:
0:cccc5726bdf3
Switch back to io mode CS. The automatic spi cs can cause problems with interrupts or RTOS.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dreschpe 0:cccc5726bdf3 1 /* mbed GraphicsDisplay Display Library Base Class
dreschpe 0:cccc5726bdf3 2 * Copyright (c) 2007-2009 sford
dreschpe 0:cccc5726bdf3 3 * Released under the MIT License: http://mbed.org/license/mit
dreschpe 0:cccc5726bdf3 4 *
dreschpe 0:cccc5726bdf3 5 * A library for providing a common base class for Graphics displays
dreschpe 0:cccc5726bdf3 6 * To port a new display, derive from this class and implement
dreschpe 0:cccc5726bdf3 7 * the constructor (setup the display), pixel (put a pixel
dreschpe 0:cccc5726bdf3 8 * at a location), width and height functions. Everything else
dreschpe 0:cccc5726bdf3 9 * (locate, printf, putc, cls, window, putp, fill, blit, blitbit)
dreschpe 0:cccc5726bdf3 10 * will come for free. You can also provide a specialised implementation
dreschpe 0:cccc5726bdf3 11 * of window and putp to speed up the results
dreschpe 0:cccc5726bdf3 12 */
dreschpe 0:cccc5726bdf3 13
dreschpe 0:cccc5726bdf3 14 #ifndef MBED_GRAPHICSDISPLAY_H
dreschpe 0:cccc5726bdf3 15 #define MBED_GRAPHICSDISPLAY_H
dreschpe 0:cccc5726bdf3 16
dreschpe 0:cccc5726bdf3 17 #include "TextDisplay.h"
dreschpe 0:cccc5726bdf3 18
dreschpe 0:cccc5726bdf3 19 class GraphicsDisplay : public TextDisplay {
dreschpe 0:cccc5726bdf3 20
dreschpe 0:cccc5726bdf3 21 public:
dreschpe 0:cccc5726bdf3 22
dreschpe 0:cccc5726bdf3 23 GraphicsDisplay(const char* name);
dreschpe 0:cccc5726bdf3 24
dreschpe 0:cccc5726bdf3 25 virtual void pixel(int x, int y, int colour) = 0;
dreschpe 0:cccc5726bdf3 26 virtual int width() = 0;
dreschpe 0:cccc5726bdf3 27 virtual int height() = 0;
dreschpe 0:cccc5726bdf3 28
dreschpe 0:cccc5726bdf3 29 virtual void window(int x, int y, int w, int h);
dreschpe 0:cccc5726bdf3 30 virtual void putp(int colour);
dreschpe 0:cccc5726bdf3 31
dreschpe 0:cccc5726bdf3 32 virtual void cls();
dreschpe 0:cccc5726bdf3 33 virtual void fill(int x, int y, int w, int h, int colour);
dreschpe 0:cccc5726bdf3 34 virtual void blit(int x, int y, int w, int h, const int *colour);
dreschpe 0:cccc5726bdf3 35 virtual void blitbit(int x, int y, int w, int h, const char* colour);
dreschpe 0:cccc5726bdf3 36
dreschpe 0:cccc5726bdf3 37 virtual void character(int column, int row, int value);
dreschpe 0:cccc5726bdf3 38 virtual int columns();
dreschpe 0:cccc5726bdf3 39 virtual int rows();
dreschpe 0:cccc5726bdf3 40
dreschpe 0:cccc5726bdf3 41 protected:
dreschpe 0:cccc5726bdf3 42
dreschpe 0:cccc5726bdf3 43 // pixel location
dreschpe 0:cccc5726bdf3 44 short _x;
dreschpe 0:cccc5726bdf3 45 short _y;
dreschpe 0:cccc5726bdf3 46
dreschpe 0:cccc5726bdf3 47 // window location
dreschpe 0:cccc5726bdf3 48 short _x1;
dreschpe 0:cccc5726bdf3 49 short _x2;
dreschpe 0:cccc5726bdf3 50 short _y1;
dreschpe 0:cccc5726bdf3 51 short _y2;
dreschpe 0:cccc5726bdf3 52
dreschpe 0:cccc5726bdf3 53 };
dreschpe 0:cccc5726bdf3 54
dreschpe 0:cccc5726bdf3 55 #endif