Char font '~' changed to block for making Big number font

Dependents:   Real-time_Bus_Arrival_Alarm WaterLogger

Fork of SeeedGrayOLED by Dan Cohen

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SeeedGrayOLED.h Source File

SeeedGrayOLED.h

00001 /*
00002  * SeeedGrayOLED.h
00003  * SSD1327 Gray OLED Driver Library for SSD1327
00004  *
00005  * Copyright (c) 2011 seeed technology inc.
00006  * Author        :   Visweswara R
00007  * Create Time   :   Dec 2011
00008  * Change Log    :
00009  *
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or (at your option) any later version.
00014  *
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00023  */
00024 
00025 #ifndef SeeedGrayOLED_data_H
00026 #define SeeedGrayOLED_data_H
00027 
00028 // SeeedGrayOLED Instruction set addresses
00029 
00030 // #include "Arduino.h"
00031 #include "mbed.h"
00032 #include <inttypes.h>
00033 
00034 
00035 #define VERTICAL_MODE                       01
00036 #define HORIZONTAL_MODE                     02
00037 
00038 #define SeeedGrayOLED_Address               0x3c
00039 #define SeeedGrayOLED_Command_Mode          0x80
00040 #define SeeedGrayOLED_Data_Mode             0x40
00041 
00042 #define SeeedGrayOLED_Display_Off_Cmd       0xAE
00043 #define SeeedGrayOLED_Display_On_Cmd        0xAF
00044 
00045 #define SeeedGrayOLED_Normal_Display_Cmd    0xA4
00046 #define SeeedGrayOLED_Inverse_Display_Cmd   0xA7
00047 #define SeeedGrayOLED_Activate_Scroll_Cmd   0x2F
00048 #define SeeedGrayOLED_Dectivate_Scroll_Cmd  0x2E
00049 #define SeeedGrayOLED_Set_ContrastLevel_Cmd 0x81
00050 
00051 #define Scroll_Left             0x00
00052 #define Scroll_Right            0x01
00053 
00054 #define Scroll_2Frames          0x7
00055 #define Scroll_3Frames          0x4
00056 #define Scroll_4Frames          0x5
00057 #define Scroll_5Frames          0x0
00058 #define Scroll_25Frames         0x6
00059 #define Scroll_64Frames         0x1
00060 #define Scroll_128Frames        0x2
00061 #define Scroll_256Frames        0x3
00062 
00063 
00064 class SeeedGrayOLED  {
00065 public:
00066 
00067     /** Create a new TDA7419 communication interface
00068     *
00069     * @param sda is the pin for I2C SDA
00070     * @param scl is the pin for I2C SCL
00071     */
00072     SeeedGrayOLED(PinName sda, PinName scl);
00073 
00074 
00075     char addressingMode;
00076 
00077     void init(void);
00078 
00079     void setNormalDisplay();
00080     void setInverseDisplay();
00081 
00082     void sendCommand(unsigned char command);
00083     void sendData(unsigned char Data);
00084     void setGrayLevel(unsigned char grayLevel);
00085 
00086     void setVerticalMode();
00087     void setHorizontalMode();
00088 
00089     void setTextXY(unsigned char Row, unsigned char Column);
00090     void clearDisplay();
00091     void setContrastLevel(unsigned char ContrastLevel);
00092     void putChar(unsigned char c);
00093     void putString(const char *String);
00094     unsigned char putNumber(long n);
00095     unsigned char putFloat(float floatNumber,unsigned char decimal);
00096     unsigned char putFloat(float floatNumber);
00097 
00098     void drawBitmap(unsigned char *bitmaparray,int bytes);
00099 
00100     void setHorizontalScrollProperties(bool direction,unsigned char startRow, unsigned char endRow,unsigned char startColumn, unsigned char endColumn, unsigned char scrollSpeed);
00101     void activateScroll();
00102     void deactivateScroll();
00103 
00104 private:
00105 
00106     // Signals related to I2C communication
00107     I2C _device;
00108 
00109     unsigned char grayH;
00110     unsigned char grayL;
00111 
00112 
00113 };
00114 
00115 
00116 #endif
00117