Adafruit SH110x Arduino Library
Adafruit_SH110X.h
Go to the documentation of this file.
1 
24 #ifndef _Adafruit_SH110X_H_
25 #define _Adafruit_SH110X_H_
26 
27 #include <Adafruit_GrayOLED.h>
28 
30 #define SH110X_BLACK 0
31 #define SH110X_WHITE 1
32 #define SH110X_INVERSE 2
33 
34 // Uncomment to disable Adafruit splash logo
35 // #define SH110X_NO_SPLASH
36 
37 #define SH110X_MEMORYMODE 0x20
38 #define SH110X_COLUMNADDR 0x21
39 #define SH110X_PAGEADDR 0x22
40 #define SH110X_SETCONTRAST 0x81
41 #define SH110X_CHARGEPUMP 0x8D
42 #define SH110X_SEGREMAP 0xA0
43 #define SH110X_DISPLAYALLON_RESUME 0xA4
44 #define SH110X_DISPLAYALLON 0xA5
45 #define SH110X_NORMALDISPLAY 0xA6
46 #define SH110X_INVERTDISPLAY 0xA7
47 #define SH110X_SETMULTIPLEX 0xA8
48 #define SH110X_DCDC 0xAD
49 #define SH110X_DISPLAYOFF 0xAE
50 #define SH110X_DISPLAYON 0xAF
51 #define SH110X_SETPAGEADDR \
52  0xB0
53 #define SH110X_COMSCANINC 0xC0
55 #define SH110X_COMSCANDEC 0xC8
56 #define SH110X_SETDISPLAYOFFSET 0xD3
57 #define SH110X_SETDISPLAYCLOCKDIV 0xD5
58 #define SH110X_SETPRECHARGE 0xD9
59 #define SH110X_SETCOMPINS 0xDA
60 #define SH110X_SETVCOMDETECT 0xDB
61 #define SH110X_SETDISPSTARTLINE \
62  0xDC
63 
65 #define SH110X_SETLOWCOLUMN 0x00
66 #define SH110X_SETHIGHCOLUMN 0x10
67 #define SH110X_SETSTARTLINE 0x40
68 
69 
73 class Adafruit_SH110X : public Adafruit_GrayOLED {
74 public:
75  // NEW CONSTRUCTORS -- recommended for new projects
76  Adafruit_SH110X(uint16_t w, uint16_t h, TwoWire *twi = &Wire,
77  int16_t rst_pin = -1, uint32_t preclk = 400000,
78  uint32_t postclk = 100000);
79  Adafruit_SH110X(uint16_t w, uint16_t h, int16_t mosi_pin, int16_t sclk_pin,
80  int16_t dc_pin, int16_t rst_pin, int16_t cs_pin);
81  Adafruit_SH110X(uint16_t w, uint16_t h, SPIClass *spi, int16_t dc_pin,
82  int16_t rst_pin, int16_t cs_pin,
83  uint32_t bitrate = 8000000UL);
84 
85  virtual ~Adafruit_SH110X(void) = 0;
86 
87  void display(void);
88 
89 protected:
92  uint8_t _page_start_offset = 0;
93 
94 private:
95 };
96 
102 public:
103  Adafruit_SH1106G(uint16_t w, uint16_t h, TwoWire *twi = &Wire,
104  int16_t rst_pin = -1, uint32_t preclk = 400000,
105  uint32_t postclk = 100000);
106  Adafruit_SH1106G(uint16_t w, uint16_t h, int16_t mosi_pin, int16_t sclk_pin,
107  int16_t dc_pin, int16_t rst_pin, int16_t cs_pin);
108  Adafruit_SH1106G(uint16_t w, uint16_t h, SPIClass *spi, int16_t dc_pin,
109  int16_t rst_pin, int16_t cs_pin,
110  uint32_t bitrate = 8000000UL);
111 
112  ~Adafruit_SH1106G(void);
113 
114  bool begin(uint8_t i2caddr = 0x3C, bool reset = true);
115 };
116 
122 public:
123  Adafruit_SH1107(uint16_t w, uint16_t h, TwoWire *twi = &Wire,
124  int16_t rst_pin = -1, uint32_t preclk = 400000,
125  uint32_t postclk = 100000);
126  Adafruit_SH1107(uint16_t w, uint16_t h, int16_t mosi_pin, int16_t sclk_pin,
127  int16_t dc_pin, int16_t rst_pin, int16_t cs_pin);
128  Adafruit_SH1107(uint16_t w, uint16_t h, SPIClass *spi, int16_t dc_pin,
129  int16_t rst_pin, int16_t cs_pin,
130  uint32_t bitrate = 8000000UL);
131 
132  ~Adafruit_SH1107(void);
133 
134  bool begin(uint8_t i2caddr = 0x3C, bool reset = true);
135 };
136 #endif // _Adafruit_SH110X_H_
Class that stores state and functions for interacting with SH1107 OLED displays.
Definition: Adafruit_SH110X.h:121
virtual ~Adafruit_SH110X(void)=0
Destructor for Adafruit_SH110X object.
Definition: Adafruit_SH110X.cpp:145
uint8_t _page_start_offset
Definition: Adafruit_SH110X.h:92
Adafruit_SH110X(uint16_t w, uint16_t h, TwoWire *twi=&Wire, int16_t rst_pin=-1, uint32_t preclk=400000, uint32_t postclk=100000)
Constructor for I2C-interfaced SH110X displays.
Definition: Adafruit_SH110X.cpp:76
Class that stores state and functions for interacting with SH1106G OLED displays. ...
Definition: Adafruit_SH110X.h:101
Class that stores state and functions for interacting with SH110X OLED displays. Not instantiatable -...
Definition: Adafruit_SH110X.h:73
void display(void)
Push data currently in RAM to SH110X display.
Definition: Adafruit_SH110X.cpp:155