Library for TFT via SPI

Dependents:   mbed_projekt_tetris Ejemplo_TFT

Committer:
2018US_HarisSoljic
Date:
Mon Jun 18 20:01:55 2018 +0000
Revision:
0:b8956708b92f
revi?n;

Who changed what in which revision?

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