This is a mbed library for a 1.8 inch 128x160 pixel SPI TFT display
Dependents: ST7735_Pong ST7735_TFT SPI18TFT_FRDM-KL25Z SPI18TFT ... more
GraphicsDisplay.h@1:967235e6fd48, 2011-12-11 (annotated)
- Committer:
- smultron1977
- Date:
- Sun Dec 11 21:18:21 2011 +0000
- Revision:
- 1:967235e6fd48
- Parent:
- 0:246f2fb5be59
SPI frequency increased
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
smultron1977 | 0:246f2fb5be59 | 1 | /* mbed GraphicsDisplay Display Library Base Class |
smultron1977 | 0:246f2fb5be59 | 2 | * Copyright (c) 2007-2009 sford |
smultron1977 | 0:246f2fb5be59 | 3 | * Released under the MIT License: http://mbed.org/license/mit |
smultron1977 | 0:246f2fb5be59 | 4 | * |
smultron1977 | 0:246f2fb5be59 | 5 | * A library for providing a common base class for Graphics displays |
smultron1977 | 0:246f2fb5be59 | 6 | * To port a new display, derive from this class and implement |
smultron1977 | 0:246f2fb5be59 | 7 | * the constructor (setup the display), pixel (put a pixel |
smultron1977 | 0:246f2fb5be59 | 8 | * at a location), width and height functions. Everything else |
smultron1977 | 0:246f2fb5be59 | 9 | * (locate, printf, putc, cls, window, putp, fill, blit, blitbit) |
smultron1977 | 0:246f2fb5be59 | 10 | * will come for free. You can also provide a specialised implementation |
smultron1977 | 0:246f2fb5be59 | 11 | * of window and putp to speed up the results |
smultron1977 | 0:246f2fb5be59 | 12 | */ |
smultron1977 | 0:246f2fb5be59 | 13 | |
smultron1977 | 0:246f2fb5be59 | 14 | #ifndef MBED_GRAPHICSDISPLAY_H |
smultron1977 | 0:246f2fb5be59 | 15 | #define MBED_GRAPHICSDISPLAY_H |
smultron1977 | 0:246f2fb5be59 | 16 | |
smultron1977 | 0:246f2fb5be59 | 17 | #include "TextDisplay.h" |
smultron1977 | 0:246f2fb5be59 | 18 | |
smultron1977 | 0:246f2fb5be59 | 19 | class GraphicsDisplay : public TextDisplay { |
smultron1977 | 0:246f2fb5be59 | 20 | |
smultron1977 | 0:246f2fb5be59 | 21 | public: |
smultron1977 | 0:246f2fb5be59 | 22 | |
smultron1977 | 0:246f2fb5be59 | 23 | GraphicsDisplay(const char* name); |
smultron1977 | 0:246f2fb5be59 | 24 | |
smultron1977 | 0:246f2fb5be59 | 25 | virtual void pixel(int x, int y, int colour) = 0; |
smultron1977 | 0:246f2fb5be59 | 26 | virtual int width() = 0; |
smultron1977 | 0:246f2fb5be59 | 27 | virtual int height() = 0; |
smultron1977 | 0:246f2fb5be59 | 28 | |
smultron1977 | 0:246f2fb5be59 | 29 | virtual void window(int x, int y, int w, int h); |
smultron1977 | 0:246f2fb5be59 | 30 | virtual void putp(int colour); |
smultron1977 | 0:246f2fb5be59 | 31 | |
smultron1977 | 0:246f2fb5be59 | 32 | virtual void cls(); |
smultron1977 | 0:246f2fb5be59 | 33 | virtual void fill(int x, int y, int w, int h, int colour); |
smultron1977 | 0:246f2fb5be59 | 34 | virtual void blit(int x, int y, int w, int h, const int *colour); |
smultron1977 | 0:246f2fb5be59 | 35 | virtual void blitbit(int x, int y, int w, int h, const char* colour); |
smultron1977 | 0:246f2fb5be59 | 36 | |
smultron1977 | 0:246f2fb5be59 | 37 | virtual void character(int column, int row, int value); |
smultron1977 | 0:246f2fb5be59 | 38 | virtual int columns(); |
smultron1977 | 0:246f2fb5be59 | 39 | virtual int rows(); |
smultron1977 | 0:246f2fb5be59 | 40 | |
smultron1977 | 0:246f2fb5be59 | 41 | protected: |
smultron1977 | 0:246f2fb5be59 | 42 | |
smultron1977 | 0:246f2fb5be59 | 43 | // pixel location |
smultron1977 | 0:246f2fb5be59 | 44 | short _x; |
smultron1977 | 0:246f2fb5be59 | 45 | short _y; |
smultron1977 | 0:246f2fb5be59 | 46 | |
smultron1977 | 0:246f2fb5be59 | 47 | // window location |
smultron1977 | 0:246f2fb5be59 | 48 | short _x1; |
smultron1977 | 0:246f2fb5be59 | 49 | short _x2; |
smultron1977 | 0:246f2fb5be59 | 50 | short _y1; |
smultron1977 | 0:246f2fb5be59 | 51 | short _y2; |
smultron1977 | 0:246f2fb5be59 | 52 | |
smultron1977 | 0:246f2fb5be59 | 53 | }; |
smultron1977 | 0:246f2fb5be59 | 54 | |
smultron1977 | 0:246f2fb5be59 | 55 | #endif |