12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /*****************************************************************************
- * | File : OLED_0in96.h
- * | Author : Waveshare team
- * | Function : OLED_0in96 OLED Module Drive function
- * | Info :
- *----------------
- * | This version: V2.0
- * | Date : 2020-08-14
- * | Info :
- * -----------------------------------------------------------------------------
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documnetation files (the "Software"), to deal
- # in the Software without restriction, including without limitation the rights
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- # copies of the Software, and to permit persons to whom the Software is
- # furished to do so, subject to the following conditions:
- #
- # The above copyright notice and this permission notice shall be included in
- # all copies or substantial portions of the Software.
- #
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- # FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- # LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
- #
- ******************************************************************************/
- #ifndef _OLED_0IN96_H_
- #define _OLED_0IN96_H_
- #include "DEV_Config.h"
- #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_COLUMNADDR 0x21
- #define SSD1306_PAGEADDR 0x22
- #define SSD1306_COMSCANINC 0xC0
- #define SSD1306_COMSCANDEC 0xC8
- #define SSD1306_SEGREMAP 0xA0
- #define SSD1306_CHARGEPUMP 0x8D
- #define SSD1306_EXTERNALVCC 0x01
- #define SSD1306_SWITCHCAPVCC 0x02
- //Scrolling constants
- #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
- /********************************************************************************
- function:
- Define the full screen height length of the display
- ********************************************************************************/
- #define OLED_0in96_WIDTH 64//OLED width
- #define OLED_0in96_HEIGHT 128 //OLED height
- void OLED_0in96_Init();
- void OLED_0in96_clear();
- void OLED_0in96_display(UBYTE *Image);
- #endif
|