00001
00002
00003
00004
00005
00006
00007
00008 #ifndef MARYOLED_H_
00009 #define MARYOLED_H_
00010
00011
00035 #include "SPI.h"
00036 #include "gpio.h"
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00042 typedef enum {OLED,Nokia6610,Nokia6100,PCF8833} LCD_DEVICES;
00043
00044 class MARYOLED {
00045 private:
00046 LCD_DEVICES device;
00047 int _row;
00048 int _column;
00049 int _foreground;
00050 int _background;
00051 int _width;
00052 int _height;
00053
00055 enum {
00056 SET_DISPLAY_MODE_ALL_OFF = 0xA4,
00057 SET_COMMAND_LOCK = 0xFD,
00058 SET_SLEEP_MODE_ON = 0xAE,
00059 FRONT_CLOCK_DRIVER_OSC_FREQ = 0xB3,
00060 SET_MUX_RATIO = 0xCA,
00061 SET_DISPAY_OFFSET = 0xA2,
00062 SET_DISPAY_START_LINE = 0xA1,
00063 SET_REMAP_COLOR_DEPTH = 0xA0,
00064 SET_GPIO = 0xB5,
00065 FUNCTION_SELECTION = 0xAB,
00066 SET_SEGMENT_LOW_VOLTAGE = 0xB4,
00067 SET_CONTRAST_CURRENT_FOR_COLOR_ABC = 0xC1,
00068 MASTER_CONTRAST_CURRENT_CONTROL = 0xC7,
00069 LOOKUP_TABLE_FOR_GRAYSCALE_PULSE_WIDTH = 0xB8,
00070 USE_BUILT_IN_LINEAR_LUT = 0xB9,
00071 SET_RESET_PRECHARGE_PERIOD = 0xB1,
00072 ENHANCE_DRIVING_SCHEME_CAPABILITY = 0xB2,
00073 SET_PRECHARGE_VOLTAGE = 0xBB,
00074 SET_SECOND_PRECHARGE_VOLTAGE = 0xB6,
00075 SET_VCOMH_VOLTAGE = 0xBE,
00076 SET_DISPLAY_MODE_RESET = 0xA6,
00077 SET_COLUMN_ADDRESS = 0x15,
00078 SET_ROW_ADDRESS = 0x75,
00079 WRITE_RAM_COMMAND = 0x5C,
00080 SET_SLEEP_MODE_OFF = 0xAF
00081 };
00083 enum {
00084 OFF = 0,
00085 ON
00086 };
00087
00088
00089 public:
00090 MARYOLED();
00091 ~MARYOLED();
00092
00093 void reset();
00094 void command( int value );
00095 void data( int value );
00096 void _window( int x, int y, int width, int height );
00097 void locate(int column, int row);
00098 void newline();
00099 void _putp( int colour );
00100 int _putc( int value );
00101 void cls( void );
00102 void window( int x, int y, int width, int height );
00103 void WindowReset(void);
00104 void putp( int colour );
00105 void pixel( int x, int y, int colour );
00106 void fill( int x, int y, int width, int height, int colour );
00107 void blit( int x, int y, int width, int height, const int* colour );
00108 void bitblit( int x, int y, int width, int height, const char* bitstream );
00109 void foreground(int c);
00110 void background(int c);
00111 int width();
00112 int height();
00113 int columns();
00114 int rows();
00115 };
00116
00117 extern MARYOLED oled;
00118
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122 #endif