diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-03-18 22:37:18 +0800 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2014-03-18 22:37:18 +0800 |
commit | be625d6ca4cf59fb4f4d0e2fe79d798a529b8c3d (patch) | |
tree | 5381012b46ad39362d5c08dbd7c82736eee73a6f /obdlogger/SSD1306.h | |
parent | 6aaf937f2c17d713966b3b3d647fa35980a3b8ce (diff) | |
download | 2021-arduino-obd-be625d6ca4cf59fb4f4d0e2fe79d798a529b8c3d.tar.gz 2021-arduino-obd-be625d6ca4cf59fb4f4d0e2fe79d798a529b8c3d.tar.bz2 2021-arduino-obd-be625d6ca4cf59fb4f4d0e2fe79d798a529b8c3d.zip |
Cleanup
Diffstat (limited to 'obdlogger/SSD1306.h')
-rw-r--r-- | obdlogger/SSD1306.h | 119 |
1 files changed, 0 insertions, 119 deletions
diff --git a/obdlogger/SSD1306.h b/obdlogger/SSD1306.h deleted file mode 100644 index aaa3534..0000000 --- a/obdlogger/SSD1306.h +++ /dev/null @@ -1,119 +0,0 @@ -#if ARDUINO >= 100 - #include "Arduino.h" -#else - #include "WProgram.h" -#endif - -#define BLACK 0 -#define WHITE 1 - -#define SSD1306_I2C_ADDRESS 0x3C // 011110+SA0+RW - 0x3C or 0x3D -// Address for 128x32 is 0x3C -// Address for 128x32 is 0x3D (default) or 0x3C (if SA0 is grounded) - -/*========================================================================= - SSD1306 Displays - ----------------------------------------------------------------------- - The driver is used in multiple displays (128x64, 128x32, etc.). - Select the appropriate display below to create an appropriately - sized framebuffer, etc. - - SSD1306_128_64 128x64 pixel display - - SSD1306_128_32 128x32 pixel display - - You also need to set the LCDWIDTH and LCDHEIGHT defines to an - appropriate size - - -----------------------------------------------------------------------*/ - #define SSD1306_128_64 -// #define SSD1306_128_32 -/*=========================================================================*/ - -#if defined SSD1306_128_64 && defined SSD1306_128_32 - #error "Only one SSD1306 display can be specified at once in SSD1306.h" -#endif -#if !defined SSD1306_128_64 && !defined SSD1306_128_32 - #error "At least one SSD1306 display must be specified in SSD1306.h" -#endif - -#if defined SSD1306_128_64 - #define SSD1306_LCDWIDTH 128 - #define SSD1306_LCDHEIGHT 64 -#endif -#if defined SSD1306_128_32 - #define SSD1306_LCDWIDTH 128 - #define SSD1306_LCDHEIGHT 32 -#endif - -#define SSD1306_SETCONTRAST 0x81 -#define SSD1306_DISPLAYALLON_RESUME 0xA4 -#define SSD1306_DISPLAYALLON 0xA5 -#define SSD1306_NORMALDISPLAY 0xA6 -#define SSD1306_INVERTDISPLAY 0xA7 -#define SSD1306_DISPLAYOFF 0xAE -#define SSD1306_DISPLAYON 0xAF - -#define SSD1306_SETDISPLAYOFFSET 0xD3 -#define SSD1306_SETCOMPINS 0xDA - -#define SSD1306_SETVCOMDETECT 0xDB - -#define SSD1306_SETDISPLAYCLOCKDIV 0xD5 -#define SSD1306_SETPRECHARGE 0xD9 - -#define SSD1306_SETMULTIPLEX 0xA8 - -#define SSD1306_SETLOWCOLUMN 0x00 -#define SSD1306_SETHIGHCOLUMN 0x10 - -#define SSD1306_SETSTARTLINE 0x40 - -#define SSD1306_MEMORYMODE 0x20 - -#define SSD1306_COMSCANINC 0xC0 -#define SSD1306_COMSCANDEC 0xC8 - -#define SSD1306_SEGREMAP 0xA0 - -#define SSD1306_CHARGEPUMP 0x8D - -#define SSD1306_EXTERNALVCC 0x1 -#define SSD1306_SWITCHCAPVCC 0x2 - -// Scrolling #defines -#define SSD1306_ACTIVATE_SCROLL 0x2F -#define SSD1306_DEACTIVATE_SCROLL 0x2E -#define SSD1306_SET_VERTICAL_SCROLL_AREA 0xA3 -#define SSD1306_RIGHT_HORIZONTAL_SCROLL 0x26 -#define SSD1306_LEFT_HORIZONTAL_SCROLL 0x27 -#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29 -#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL 0x2A - -class SSD1306 { -public: - SSD1306(int8_t SCLK, int8_t DC, int8_t RST, int8_t CS); - SSD1306(int8_t RST = 4); - - void begin(uint8_t switchvcc = SSD1306_SWITCHCAPVCC, uint8_t i2caddr = SSD1306_I2C_ADDRESS); - void ssd1306_command(uint8_t c); - void ssd1306_data(uint8_t c); - - void invertDisplay(uint8_t i); - void draw8x8(byte* buffer, byte x, byte y); - - void startscrollright(uint8_t start, uint8_t stop); - void startscrollleft(uint8_t start, uint8_t stop); - - void startscrolldiagright(uint8_t start, uint8_t stop); - void startscrolldiagleft(uint8_t start, uint8_t stop); - void stopscroll(void); - - void fill(unsigned char dat); - void clearBuffer(); - -protected: - uint8_t _i2caddr; -private: - int8_t sclk, dc, rst, cs; -}; |