Library for the OLED display, as used on the mbed LPCXpresso Baseboard

Dependencies:   mbed

Dependents:   EAOLED_HelloWorld EA_BigBen NetClock_aitendoOLED_from_EA_and_nucho

Committer:
simon
Date:
Sun Jun 06 19:33:24 2010 +0000
Revision:
0:8fe8b0fe5134

        

Who changed what in which revision?

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