Adafruit SSD1327
Adafruit_SSD1327.h
1 /*********************************************************************
2 This is a library for our Grayscale OLEDs based on SSD1327 drivers
3 
4  Pick one up today in the adafruit shop!
5  ------> https://www.adafruit.com/products/4741
6 
7 These displays use I2C or SPI to communicate
8 
9 Adafruit invests time and resources providing this open source code,
10 please support Adafruit and open-source hardware by purchasing
11 products from Adafruit!
12 
13 Written by Limor Fried/Ladyada for Adafruit Industries.
14 BSD license, check license.txt for more information
15 All text above, and the splash screen must be included in any redistribution
16 *********************************************************************/
17 #ifndef ADAFRUIT_SSD1327_H
18 #define ADAFRUIT_SSD1327_H
19 
20 #include <Adafruit_GrayOLED.h>
21 
22 #define SSD1327_BLACK 0x0
23 #define SSD1327_WHITE 0xF
24 
25 #define SSD1327_I2C_ADDRESS 0x3D
26 
27 #define SSD1305_SETBRIGHTNESS 0x82
28 
29 #define SSD1327_SETCOLUMN 0x15
30 
31 #define SSD1327_SETROW 0x75
32 
33 #define SSD1327_SETCONTRAST 0x81
34 
35 #define SSD1305_SETLUT 0x91
36 
37 #define SSD1327_SEGREMAP 0xA0
38 #define SSD1327_SETSTARTLINE 0xA1
39 #define SSD1327_SETDISPLAYOFFSET 0xA2
40 #define SSD1327_NORMALDISPLAY 0xA4
41 #define SSD1327_DISPLAYALLON 0xA5
42 #define SSD1327_DISPLAYALLOFF 0xA6
43 #define SSD1327_INVERTDISPLAY 0xA7
44 #define SSD1327_SETMULTIPLEX 0xA8
45 #define SSD1327_REGULATOR 0xAB
46 #define SSD1327_DISPLAYOFF 0xAE
47 #define SSD1327_DISPLAYON 0xAF
48 
49 #define SSD1327_PHASELEN 0xB1
50 #define SSD1327_DCLK 0xB3
51 #define SSD1327_PRECHARGE2 0xB6
52 #define SSD1327_GRAYTABLE 0xB8
53 #define SSD1327_PRECHARGE 0xBC
54 #define SSD1327_SETVCOM 0xBE
55 
56 #define SSD1327_FUNCSELB 0xD5
57 
58 #define SSD1327_CMDLOCK 0xFD
59 
61 class Adafruit_SSD1327 : public Adafruit_GrayOLED {
62 public:
63  Adafruit_SSD1327(uint16_t w, uint16_t h, TwoWire *twi = &Wire,
64  int8_t rst_pin = -1, uint32_t preclk = 400000,
65  uint32_t postclk = 100000);
66  Adafruit_SSD1327(uint16_t w, uint16_t h, int8_t mosi_pin, int8_t sclk_pin,
67  int8_t dc_pin, int8_t rst_pin, int8_t cs_pin);
68  Adafruit_SSD1327(uint16_t w, uint16_t h, SPIClass *spi, int8_t dc_pin,
69  int8_t rst_pin, int8_t cs_pin, uint32_t bitrate = 8000000UL);
70  ~Adafruit_SSD1327(void);
71 
72  bool begin(uint8_t i2caddr = SSD1327_I2C_ADDRESS, bool reset = true);
73  void display();
74  void invertDisplay(bool i);
75 
76 private:
77  int8_t page_offset = 0;
78  int8_t column_offset = 0;
79 };
80 
81 #endif
~Adafruit_SSD1327(void)
Destructor for Adafruit_SSD1327 object.
Definition: Adafruit_SSD1327.cpp:125
bool begin(uint8_t i2caddr=SSD1327_I2C_ADDRESS, bool reset=true)
Allocate RAM for image buffer, initialize peripherals and pins.
Definition: Adafruit_SSD1327.cpp:149
void invertDisplay(bool i)
Enable or disable display invert mode (white-on-black vs black-on-white). Handy for testing! ...
Definition: Adafruit_SSD1327.cpp:311
Definition: Adafruit_SSD1327.h:61
Adafruit_SSD1327(uint16_t w, uint16_t h, TwoWire *twi=&Wire, int8_t rst_pin=-1, uint32_t preclk=400000, uint32_t postclk=100000)
Constructor for I2C-interfaced SSD1327 displays.
Definition: Adafruit_SSD1327.cpp:56
void display()
Do the actual writing of the internal frame buffer to display RAM.
Definition: Adafruit_SSD1327.cpp:214