4D Systems serial microOLED driver http://www.4dsystems.com.au/prod.php?id=77 http://www.sparkfun.com/products/8538

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MicroOLED.h Source File

MicroOLED.h

00001 #include "mbed.h"
00002 
00003 #define     OLED_FONT5X7                    0x01
00004 #define     OLED_FONT8X8                    0x02
00005 #define     OLED_FONT8X12                   0x03
00006 
00007 #define     OLED_DISPLAYCONTROL_DISPLAY     0x01
00008 #define     OLED_DISPLAYCONTROL_CONTRAST    0x02
00009 #define     OLED_DISPLAYCONTROL_POWER       0x03
00010 
00011 class MicroOLED {
00012 public:
00013 
00014     MicroOLED(PinName serialTX, PinName serialRX, PinName reset);
00015 
00016     short getRGB(char red, char green, char blue);
00017 
00018     bool addBitmappedCharacter(char character, char data[8]);
00019     bool blockCopyPaste(char sourceX, char sourceY, char destinationX, char destinationY, char width, char height);
00020     bool displayControl(char mode);
00021     bool displayUserBitmappedCharacter(char character, char x, char y, short color);
00022     bool drawCircle(char x, char y, char radius, short color);
00023     bool drawCharacter(char character, char column, char row, short color);
00024     bool drawImage(char x, char y, char width, char height, char colorMode, char *pixels);
00025     bool drawLine(char x1, char y1, char x2, char y2, short color);
00026     bool drawPolygon(char vertices, char *x, char *y, short color);
00027     bool drawRectangle(char x, char y, char width, char height, short color);
00028     bool drawText(char column, char row, char font, short color, char *text);
00029     bool drawTriangle(char x1, char y1, char x2, char y2, char x3, char y3, short color);
00030     bool eraseScreen();
00031     bool init();
00032     bool penSize(char size);
00033     bool putPixel(char x, char y, short color);
00034     short readPixel(char x, char y);
00035     bool setBackgroundColor(short color);
00036     bool setFontSize(char fontType);
00037     bool textButton(char state, char x, char y, short buttonColor, char font, short textColor, char textWidth, char textHeight, char *text);
00038     bool textMode(char mode);
00039     bool versionInfo(bool onScreen, char *info);
00040     
00041     
00042 protected:
00043     Serial      _oled;
00044     DigitalOut  _reset;
00045     
00046     void resetDisplay();
00047 };#include "mbed.h"
00048 
00049 #define     OLED_FONT5X7                    0x01
00050 #define     OLED_FONT8X8                    0x02
00051 #define     OLED_FONT8X12                   0x03
00052 
00053 #define     OLED_DISPLAYCONTROL_DISPLAY     0x01
00054 #define     OLED_DISPLAYCONTROL_CONTRAST    0x02
00055 #define     OLED_DISPLAYCONTROL_POWER       0x03
00056 
00057 class MicroOLED {
00058 public:
00059 
00060     MicroOLED(PinName serialTX, PinName serialRX, PinName reset);
00061 
00062     short getRGB(char red, char green, char blue);
00063 
00064     bool addBitmappedCharacter(char character, char data[8]);
00065     bool blockCopyPaste(char sourceX, char sourceY, char destinationX, char destinationY, char width, char height);
00066     bool displayControl(char mode);
00067     bool displayUserBitmappedCharacter(char character, char x, char y, short color);
00068     bool drawCircle(char x, char y, char radius, short color);
00069     bool drawCharacter(char character, char column, char row, short color);
00070     bool drawImage(char x, char y, char width, char height, char colorMode, char *pixels);
00071     bool drawLine(char x1, char y1, char x2, char y2, short color);
00072     bool drawPolygon(char vertices, char *x, char *y, short color);
00073     bool drawRectangle(char x, char y, char width, char height, short color);
00074     bool drawText(char column, char row, char font, short color, char *text);
00075     bool drawTriangle(char x1, char y1, char x2, char y2, char x3, char y3, short color);
00076     bool eraseScreen();
00077     bool init();
00078     bool penSize(char size);
00079     bool putPixel(char x, char y, short color);
00080     short readPixel(char x, char y);
00081     bool setBackgroundColor(short color);
00082     bool setFontSize(char fontType);
00083     bool textButton(char state, char x, char y, short buttonColor, char font, short textColor, char textWidth, char textHeight, char *text);
00084     bool textMode(char mode);
00085     bool versionInfo(bool onScreen, char *info);
00086     
00087     
00088 protected:
00089     Serial      _oled;
00090     DigitalOut  _reset;
00091     
00092     void resetDisplay();
00093 };