Class that stores state and functions for interacting with SSD1351 OLED displays.
More...
#include <Adafruit_SSD1351.h>
|
| Adafruit_SSD1351 (uint16_t width, uint16_t height, int8_t cs_pin, int8_t dc_pin, int8_t mosi_pin, int8_t sclk_pin, int8_t rst_pin=-1) |
| Constructor for SSD1351 displays, using software (bitbang) SPI. More...
|
|
| Adafruit_SSD1351 (uint16_t width, uint16_t height, SPIClass *spi, int8_t cs_pin, int8_t dc_pin, int8_t rst_pin=-1) |
| Constructor for SSD1351 displays, using native hardware SPI. More...
|
|
| Adafruit_SSD1351 (int8_t cs_pin, int8_t dc_pin, int8_t mosi_pin, int8_t sclk_pin, int8_t rst_pin=-1) |
| DEPRECATED constructor for SSD1351 displays, using software (bitbang) SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by editing the SSD1351WIDTH and SSD1351HEIGHT defines in Adafruit_SSD1351.h. New code should NOT use this. More...
|
|
| Adafruit_SSD1351 (int8_t cs_pin, int8_t dc_pin, int8_t rst_pin=-1) |
| DEPRECATED constructor for SSD1351 displays, using native hardware SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by editing the SSD1351WIDTH and SSD1351HEIGHT defines in Adafruit_SSD1351.h. Only the primary SPI bus is supported, and bitrate is fixed at a default. New code should NOT use this. More...
|
|
| ~Adafruit_SSD1351 (void) |
| Destructor for Adafruit_SSD1351 object.
|
|
void | begin (uint32_t freq=0) |
| Initialize SSD1351 chip. Configures pins, connects to the SSD1351 and sends initialization commands. More...
|
|
void | setRotation (uint8_t r) |
| Set origin of (0,0) and orientation of OLED display. More...
|
|
void | invertDisplay (boolean i) |
| Enable/Disable display color inversion. More...
|
|
void | invert (boolean i) |
| Enable/Disable display color inversion. More...
|
|
void | enableDisplay (boolean enable) |
| Change whether display is on or off. More...
|
|
void | setAddrWindow (uint16_t x, uint16_t y, uint16_t w, uint16_t h) |
| Set the "address window" - the rectangle we will write to graphics RAM with the next chunk of SPI data writes. The SSD1351 will automatically wrap the data as each row is filled. More...
|
|
Class that stores state and functions for interacting with SSD1351 OLED displays.
◆ Adafruit_SSD1351() [1/4]
Adafruit_SSD1351::Adafruit_SSD1351 |
( |
uint16_t |
width, |
|
|
uint16_t |
height, |
|
|
int8_t |
cs_pin, |
|
|
int8_t |
dc_pin, |
|
|
int8_t |
mosi_pin, |
|
|
int8_t |
sclk_pin, |
|
|
int8_t |
rst_pin = -1 |
|
) |
| |
Constructor for SSD1351 displays, using software (bitbang) SPI.
- Parameters
-
width | Display width in pixels (usu. 128) |
height | Display height in pixels (usu. 128 or 96) |
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
dc_pin | Data/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high). |
mosi_pin | MOSI (master out, slave in) pin (using Arduino pin numbering). This transfers serial data from microcontroller to display. |
sclk_pin | SCLK (serial clock) pin (using Arduino pin numbering). This clocks each bit from MOSI. |
rst_pin | Reset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin). |
- Returns
- Adafruit_SSD1351 object.
- Note
- Call the object's begin() function before use.
◆ Adafruit_SSD1351() [2/4]
Adafruit_SSD1351::Adafruit_SSD1351 |
( |
uint16_t |
width, |
|
|
uint16_t |
height, |
|
|
SPIClass * |
spi, |
|
|
int8_t |
cs_pin, |
|
|
int8_t |
dc_pin, |
|
|
int8_t |
rst_pin = -1 |
|
) |
| |
Constructor for SSD1351 displays, using native hardware SPI.
- Parameters
-
width | Display width in pixels |
height | Display height in pixels |
spi | Pointer to an existing SPIClass instance (e.g. &SPI, the microcontroller's primary SPI bus). |
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
dc_pin | Data/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high). |
rst_pin | Reset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin). |
- Returns
- Adafruit_SSD1351 object.
- Note
- Call the object's begin() function before use.
◆ Adafruit_SSD1351() [3/4]
Adafruit_SSD1351::Adafruit_SSD1351 |
( |
int8_t |
cs_pin, |
|
|
int8_t |
dc_pin, |
|
|
int8_t |
mosi_pin, |
|
|
int8_t |
sclk_pin, |
|
|
int8_t |
rst_pin = -1 |
|
) |
| |
DEPRECATED constructor for SSD1351 displays, using software (bitbang) SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by editing the SSD1351WIDTH and SSD1351HEIGHT defines in Adafruit_SSD1351.h. New code should NOT use this.
- Parameters
-
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
dc_pin | Data/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high). |
mosi_pin | MOSI (master out, slave in) pin (using Arduino pin numbering). This transfers serial data from microcontroller to display. |
sclk_pin | SCLK (serial clock) pin (using Arduino pin numbering). This clocks each bit from MOSI. |
rst_pin | Reset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin). |
- Returns
- Adafruit_SSD1351 object.
- Note
- Call the object's begin() function before use.
◆ Adafruit_SSD1351() [4/4]
Adafruit_SSD1351::Adafruit_SSD1351 |
( |
int8_t |
cs_pin, |
|
|
int8_t |
dc_pin, |
|
|
int8_t |
rst_pin = -1 |
|
) |
| |
DEPRECATED constructor for SSD1351 displays, using native hardware SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by editing the SSD1351WIDTH and SSD1351HEIGHT defines in Adafruit_SSD1351.h. Only the primary SPI bus is supported, and bitrate is fixed at a default. New code should NOT use this.
- Parameters
-
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
dc_pin | Data/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high). |
rst_pin | Reset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin). |
- Returns
- Adafruit_SSD1351 object.
- Note
- Call the object's begin() function before use.
◆ begin()
void Adafruit_SSD1351::begin |
( |
uint32_t |
freq = 0 | ) |
|
Initialize SSD1351 chip. Configures pins, connects to the SSD1351 and sends initialization commands.
- Parameters
-
freq | SPI bitrate – default of 0 will use a (usually) platform- optimized value, e.g. 8 MHz on AVR, 12 MHz on M0. |
- Returns
- None (void).
◆ setRotation()
void Adafruit_SSD1351::setRotation |
( |
uint8_t |
r | ) |
|
Set origin of (0,0) and orientation of OLED display.
- Parameters
-
r | The index for rotation, from 0-3 inclusive |
- Returns
- None (void).
- Note
- SSD1351 works differently than most (all?) other SPITFT displays. With certain rotation changes the screen contents may change immediately into a peculiar format (mirrored, not necessarily rotated) (other displays, this only affects new drawing – rotation combinations can apply to different areas). Therefore, it's recommend to clear the screen (fillScreen(0)) before changing rotation.
◆ invertDisplay()
void Adafruit_SSD1351::invertDisplay |
( |
boolean |
i | ) |
|
Enable/Disable display color inversion.
- Parameters
-
i | True to invert display, False for normal color. |
- Returns
- None (void).
- Note
- This syntax is used by other SPITFT compatible libraries. New code should use this.
◆ invert()
void Adafruit_SSD1351::invert |
( |
boolean |
i | ) |
|
Enable/Disable display color inversion.
- Parameters
-
i | True to invert display, False for normal color. |
- Returns
- None (void).
- Note
- This is an older syntax used by this library prior to the SPITFT library. New code should avoid it.
◆ enableDisplay()
void Adafruit_SSD1351::enableDisplay |
( |
boolean |
enable | ) |
|
Change whether display is on or off.
- Parameters
-
enable | True if you want the display ON, false OFF |
◆ setAddrWindow()
void Adafruit_SSD1351::setAddrWindow |
( |
uint16_t |
x1, |
|
|
uint16_t |
y1, |
|
|
uint16_t |
w, |
|
|
uint16_t |
h |
|
) |
| |
Set the "address window" - the rectangle we will write to graphics RAM with the next chunk of SPI data writes. The SSD1351 will automatically wrap the data as each row is filled.
- Parameters
-
x1 | Leftmost column of rectangle (screen pixel coordinates). |
y1 | Topmost row of rectangle (screen pixel coordinates). |
w | Width of rectangle. |
h | Height of rectangle. |
- Returns
- None (void).
The documentation for this class was generated from the following files: