Class that stores state and functions for interacting with SH110X OLED displays. Not instantiatable - use a subclass!
More...
#include <Adafruit_SH110X.h>
|
| 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. More...
|
|
| Adafruit_SH110X (uint16_t w, uint16_t h, int16_t mosi_pin, int16_t sclk_pin, int16_t dc_pin, int16_t rst_pin, int16_t cs_pin) |
| Constructor for SPI SH110X displays, using software (bitbang) SPI. More...
|
|
| Adafruit_SH110X (uint16_t w, uint16_t h, SPIClass *spi, int16_t dc_pin, int16_t rst_pin, int16_t cs_pin, uint32_t bitrate=8000000UL) |
| Constructor for SPI SH110X displays, using native hardware SPI. More...
|
|
virtual | ~Adafruit_SH110X (void)=0 |
| Destructor for Adafruit_SH110X object.
|
|
void | display (void) |
| Push data currently in RAM to SH110X display. More...
|
|
Class that stores state and functions for interacting with SH110X OLED displays. Not instantiatable - use a subclass!
◆ Adafruit_SH110X() [1/3]
Adafruit_SH110X::Adafruit_SH110X |
( |
uint16_t |
w, |
|
|
uint16_t |
h, |
|
|
TwoWire * |
twi = &Wire , |
|
|
int16_t |
rst_pin = -1 , |
|
|
uint32_t |
clkDuring = 400000 , |
|
|
uint32_t |
clkAfter = 100000 |
|
) |
| |
Constructor for I2C-interfaced SH110X displays.
- Parameters
-
w | Display width in pixels |
h | Display height in pixels |
twi | Pointer to an existing TwoWire instance (e.g. &Wire, the microcontroller's primary I2C bus). |
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). |
clkDuring | Speed (in Hz) for Wire transmissions in SH110X library calls. Defaults to 400000 (400 KHz), a known 'safe' value for most microcontrollers, and meets the SH110X datasheet spec. Some systems can operate I2C faster (800 KHz for ESP32, 1 MHz for many other 32-bit MCUs), and some (perhaps not all) SH110X's can work with this – so it's optionally be specified here and is not a default behavior. (Ignored if using pre-1.5.7 Arduino software, which operates I2C at a fixed 100 KHz.) |
clkAfter | Speed (in Hz) for Wire transmissions following SH110X library calls. Defaults to 100000 (100 KHz), the default Arduino Wire speed. This is done rather than leaving it at the 'during' speed because other devices on the I2C bus might not be compatible with the faster rate. (Ignored if using pre-1.5.7 Arduino software, which operates I2C at a fixed 100 KHz.) |
- Note
- Call the object's begin() function before use – buffer allocation is performed there!
◆ Adafruit_SH110X() [2/3]
Adafruit_SH110X::Adafruit_SH110X |
( |
uint16_t |
w, |
|
|
uint16_t |
h, |
|
|
int16_t |
mosi_pin, |
|
|
int16_t |
sclk_pin, |
|
|
int16_t |
dc_pin, |
|
|
int16_t |
rst_pin, |
|
|
int16_t |
cs_pin |
|
) |
| |
Constructor for SPI SH110X displays, using software (bitbang) SPI.
- Parameters
-
w | Display width in pixels |
h | Display height in pixels |
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. |
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). |
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
- Note
- Call the object's begin() function before use – buffer allocation is performed there!
◆ Adafruit_SH110X() [3/3]
Adafruit_SH110X::Adafruit_SH110X |
( |
uint16_t |
w, |
|
|
uint16_t |
h, |
|
|
SPIClass * |
spi, |
|
|
int16_t |
dc_pin, |
|
|
int16_t |
rst_pin, |
|
|
int16_t |
cs_pin, |
|
|
uint32_t |
bitrate = 8000000UL |
|
) |
| |
Constructor for SPI SH110X displays, using native hardware SPI.
- Parameters
-
w | Display width in pixels |
h | Display height in pixels |
spi | Pointer to an existing SPIClass instance (e.g. &SPI, the microcontroller's primary SPI bus). |
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). |
cs_pin | Chip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low. |
bitrate | SPI clock rate for transfers to this display. Default if unspecified is 8000000UL (8 MHz). |
- Note
- Call the object's begin() function before use – buffer allocation is performed there!
◆ display()
void Adafruit_SH110X::display |
( |
void |
| ) |
|
Push data currently in RAM to SH110X display.
- Note
- Drawing operations are not visible until this function is called. Call after each graphics command, or after a whole set of graphics commands, as best needed by one's own application.
◆ _page_start_offset
uint8_t Adafruit_SH110X::_page_start_offset = 0 |
|
protected |
some displays are 'inset' in memory, so we have to skip some memory to display
The documentation for this class was generated from the following files: