Christian Lerche
/
EAOLED_HelloWorld
EA OLED Hello World (Runs through the different possibilities with the OLED software
EAOLED.h@0:ff072ee9597c, 2010-10-03 (annotated)
- Committer:
- Lerche
- Date:
- Sun Oct 03 08:40:47 2010 +0000
- Revision:
- 0:ff072ee9597c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Lerche | 0:ff072ee9597c | 1 | // test library for Embedded Artists OLED used on Xpresso Baseboard |
Lerche | 0:ff072ee9597c | 2 | |
Lerche | 0:ff072ee9597c | 3 | #ifndef MBED_EAOLED_H |
Lerche | 0:ff072ee9597c | 4 | #define MBED_EAOLED_H |
Lerche | 0:ff072ee9597c | 5 | |
Lerche | 0:ff072ee9597c | 6 | #include "mbed.h" |
Lerche | 0:ff072ee9597c | 7 | #include "GraphicsDisplay.h" |
Lerche | 0:ff072ee9597c | 8 | |
Lerche | 0:ff072ee9597c | 9 | class EAOLED : public GraphicsDisplay { |
Lerche | 0:ff072ee9597c | 10 | public: |
Lerche | 0:ff072ee9597c | 11 | EAOLED(PinName mosi, PinName dnc, PinName sclk, PinName cs, PinName power); |
Lerche | 0:ff072ee9597c | 12 | virtual void pixel(int x, int y, int colour); |
Lerche | 0:ff072ee9597c | 13 | virtual void circle(int x, int y, int r, int colour); |
Lerche | 0:ff072ee9597c | 14 | virtual void hline(int x0, int x1, int y, int colour); |
Lerche | 0:ff072ee9597c | 15 | virtual void vline(int y0, int y1, int x, int colour); |
Lerche | 0:ff072ee9597c | 16 | virtual void line(int x0, int y0, int x1, int y1, int colour); |
Lerche | 0:ff072ee9597c | 17 | virtual void rect(int x0, int y0, int x1, int y1, int colour); |
Lerche | 0:ff072ee9597c | 18 | virtual void fillrect(int x0, int y0, int x1, int y1, int colour); |
Lerche | 0:ff072ee9597c | 19 | // virtual void cls(); |
Lerche | 0:ff072ee9597c | 20 | virtual int width() { return 96; } |
Lerche | 0:ff072ee9597c | 21 | virtual int height() { return 64; } |
Lerche | 0:ff072ee9597c | 22 | |
Lerche | 0:ff072ee9597c | 23 | void reset(); |
Lerche | 0:ff072ee9597c | 24 | void data(int value); |
Lerche | 0:ff072ee9597c | 25 | void command(int value); |
Lerche | 0:ff072ee9597c | 26 | |
Lerche | 0:ff072ee9597c | 27 | SPI _spi; |
Lerche | 0:ff072ee9597c | 28 | DigitalOut _data; |
Lerche | 0:ff072ee9597c | 29 | DigitalOut _cs; |
Lerche | 0:ff072ee9597c | 30 | DigitalOut _power; |
Lerche | 0:ff072ee9597c | 31 | |
Lerche | 0:ff072ee9597c | 32 | uint8_t framebuffer[(96 * 64) / 8]; |
Lerche | 0:ff072ee9597c | 33 | }; |
Lerche | 0:ff072ee9597c | 34 | |
Lerche | 0:ff072ee9597c | 35 | #endif |