A test example using the OLED display on the Embedded Artists Xpresso baseboard

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers EAOLED.h Source File

EAOLED.h

00001 // test library for Embedded Artists OLED used on Xpresso Baseboard
00002 
00003 #ifndef MBED_EAOLED_H
00004 #define MBED_EAOLED_H
00005 
00006 #include "mbed.h"
00007 #include "GraphicsDisplay.h"
00008 
00009 class EAOLED : public GraphicsDisplay {
00010 public:
00011     EAOLED(PinName mosi, PinName dnc, PinName sclk, PinName cs, PinName power);
00012     virtual void pixel(int x, int y, int colour);
00013   //  virtual void cls();
00014     virtual int width() { return 96; }
00015     virtual int height() { return 64; }
00016     
00017     void reset();
00018     void data(int value);
00019     void command(int value);
00020 
00021     SPI _spi;
00022     DigitalOut _data;
00023     DigitalOut _cs;
00024     DigitalOut _power;
00025     
00026     uint8_t framebuffer[(96 * 64) / 8];
00027 };
00028 
00029 #endif