![]() |
128x64 EasyC OLED Display 1.0.0
This is a library for Soldered OLED Display
|
Class that stores state and functions for interacting with SSD1306 OLED displays. More...
#include <Adafruit_SSD1306.h>
Inherits Adafruit_GFX.
Inherited by OLED_Display.
Public Member Functions | |
Adafruit_SSD1306 (uint8_t w, uint8_t h, TwoWire *twi=&Wire, int8_t rst_pin=-1, uint32_t clkDuring=400000UL, uint32_t clkAfter=100000UL) | |
Constructor for I2C-interfaced SSD1306 displays. | |
Adafruit_SSD1306 (uint8_t w, uint8_t h, int8_t mosi_pin, int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin) | |
Adafruit_SSD1306 (uint8_t w, uint8_t h, SPIClass *spi, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin, uint32_t bitrate=8000000UL) | |
Constructor for SPI SSD1306 displays, using native hardware SPI. | |
Adafruit_SSD1306 (int8_t mosi_pin, int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin) | |
DEPRECATED constructor for SPI SSD1306 displays, using software (bitbang) SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this. | |
Adafruit_SSD1306 (int8_t dc_pin, int8_t rst_pin, int8_t cs_pin) | |
DEPRECATED constructor for SPI SSD1306 displays, using native hardware SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this. Only the primary SPI bus is supported, and bitrate is fixed at 8 MHz. | |
Adafruit_SSD1306 (int8_t rst_pin=-1) | |
DEPRECATED constructor for I2C SSD1306 displays. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this. Only the primary I2C bus is supported. | |
~Adafruit_SSD1306 (void) | |
Destructor for Adafruit_SSD1306 object. | |
bool | begin (uint8_t switchvcc=SSD1306_SWITCHCAPVCC, uint8_t i2caddr=0, bool reset=true, bool periphBegin=true) |
Allocate RAM for image buffer, initialize peripherals and pins. | |
void | display (void) |
Push data currently in RAM to SSD1306 display. | |
void | clearDisplay (void) |
Clear contents of display buffer (set all pixels to off). | |
void | invertDisplay (bool i) |
Enable or disable display invert mode (white-on-black vs black-on-white). | |
void | dim (bool dim) |
Dim the display. | |
void | drawPixel (int16_t x, int16_t y, uint16_t color) |
Set/clear/invert a single pixel. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives. | |
virtual void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
Draw a horizontal line. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives. | |
virtual void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
Draw a vertical line. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives. | |
void | startscrollright (uint8_t start, uint8_t stop) |
Activate a right-handed scroll for all or part of the display. | |
void | startscrollleft (uint8_t start, uint8_t stop) |
Activate a left-handed scroll for all or part of the display. | |
void | startscrolldiagright (uint8_t start, uint8_t stop) |
Activate a diagonal scroll for all or part of the display. | |
void | startscrolldiagleft (uint8_t start, uint8_t stop) |
Activate alternate diagonal scroll for all or part of the display. | |
void | stopscroll (void) |
Cease a previously-begun scrolling action. | |
void | ssd1306_command (uint8_t c) |
Issue a single low-level command directly to the SSD1306 display, bypassing the library. | |
bool | getPixel (int16_t x, int16_t y) |
Return color of a single pixel in display buffer. | |
uint8_t * | getBuffer (void) |
Get base address of display buffer for direct reading or writing. | |
![]() | |
Adafruit_GFX (int16_t w, int16_t h) | |
Instatiate a GFX context for graphics! Can only be done by a superclass. | |
virtual void | startWrite (void) |
Start a display-writing routine, overwrite in subclasses. | |
virtual void | writePixel (int16_t x, int16_t y, uint16_t color) |
Write a pixel, overwrite in subclasses if startWrite is defined! | |
virtual void | writeFillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
Write a rectangle completely with one color, overwrite in subclasses if startWrite is defined! | |
virtual void | writeFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
Write a perfectly vertical line, overwrite in subclasses if startWrite is defined! | |
virtual void | writeFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
Write a perfectly horizontal line, overwrite in subclasses if startWrite is defined! | |
virtual void | writeLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
Write a line. Bresenham's algorithm - thx wikpedia. | |
virtual void | endWrite (void) |
End a display-writing routine, overwrite in subclasses if startWrite is defined! | |
virtual void | setRotation (uint8_t r) |
Set rotation setting for display. | |
virtual void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
Fill a rectangle completely with one color. Update in subclasses if desired! | |
virtual void | fillScreen (uint16_t color) |
Fill the screen completely with one color. Update in subclasses if desired! | |
virtual void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
Draw a line. | |
virtual void | drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
Draw a rectangle with no fill color. | |
void | drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
Draw a circle outline. | |
void | drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color) |
Quarter-circle drawer, used to do circles and roundrects. | |
void | fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
Draw a circle with filled color. | |
void | fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color) |
Quarter-circle drawer with fill, used for circles and roundrects. | |
void | drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
Draw a triangle with no fill color. | |
void | fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
Draw a triangle with color-fill. | |
void | drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
Draw a rounded rectangle with no fill color. | |
void | fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
Draw a rounded rectangle with fill color. | |
void | drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) |
Draw a PROGMEM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). | |
void | drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color, uint16_t bg) |
Draw a PROGMEM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. | |
void | drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) |
Draw a RAM-resident 1-bit image at the specified (x,y) position, using the specified foreground color (unset bits are transparent). | |
void | drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg) |
Draw a RAM-resident 1-bit image at the specified (x,y) position, using the specified foreground (for set bits) and background (unset bits) colors. | |
void | drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color) |
Draw PROGMEM-resident XBitMap Files (*.xbm), exported from GIMP. Usage: Export from GIMP to *.xbm, rename *.xbm to *.c and open in editor. C Array can be directly used with this function. There is no RAM-resident version of this function; if generating bitmaps in RAM, use the format defined by drawBitmap() and call that instead. | |
void | drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h) |
Draw a PROGMEM-resident 8-bit image (grayscale) at the specified (x,y) pos. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
void | drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h) |
Draw a RAM-resident 8-bit image (grayscale) at the specified (x,y) pos. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
void | drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], const uint8_t mask[], int16_t w, int16_t h) |
Draw a PROGMEM-resident 8-bit image (grayscale) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (grayscale and mask) must be PROGMEM-resident. Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
void | drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h) |
Draw a RAM-resident 8-bit image (grayscale) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (grayscale and mask) must be RAM-residentt, no mix-and-match Specifically for 8-bit display devices such as IS31FL3731; no color reduction/expansion is performed. | |
void | drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h) |
Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) at the specified (x,y) position. For 16-bit display devices; no color reduction performed. | |
void | drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h) |
Draw a RAM-resident 16-bit image (RGB 5/6/5) at the specified (x,y) position. For 16-bit display devices; no color reduction performed. | |
void | drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], const uint8_t mask[], int16_t w, int16_t h) |
Draw a PROGMEM-resident 16-bit image (RGB 5/6/5) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (color and mask) must be PROGMEM-resident. For 16-bit display devices; no color reduction performed. | |
void | drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h) |
Draw a RAM-resident 16-bit image (RGB 5/6/5) with a 1-bit mask (set bits = opaque, unset bits = clear) at the specified (x,y) position. BOTH buffers (color and mask) must be RAM-resident. For 16-bit display devices; no color reduction performed. | |
void | drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size) |
Draw a single character. | |
void | drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size_x, uint8_t size_y) |
Draw a single character. | |
void | getTextBounds (const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
Helper to determine size of a string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
void | getTextBounds (const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
Helper to determine size of a PROGMEM string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
void | getTextBounds (const String &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h) |
Helper to determine size of a string with current font/size. Pass string and a cursor position, returns UL corner and W,H. | |
void | setTextSize (uint8_t s) |
Set text 'magnification' size. Each increase in s makes 1 pixel that much bigger. | |
void | setTextSize (uint8_t sx, uint8_t sy) |
Set text 'magnification' size. Each increase in s makes 1 pixel that much bigger. | |
void | setFont (const GFXfont *f=NULL) |
Set the font to display when print()ing, either custom or default. | |
void | setCursor (int16_t x, int16_t y) |
Set text cursor location. | |
void | setTextColor (uint16_t c) |
Set text font color with transparant background. | |
void | setTextColor (uint16_t c, uint16_t bg) |
Set text font color with custom background color. | |
void | setTextWrap (bool w) |
Set whether text that is too long for the screen width should automatically wrap around to the next line (else clip right). | |
void | cp437 (bool x=true) |
Enable (or disable) Code Page 437-compatible charset. There was an error in glcdfont.c for the longest time – one character (#176, the 'light shade' block) was missing – this threw off the index of every character that followed it. But a TON of code has been written with the erroneous character indices. By default, the library uses the original 'wrong' behavior and old sketches will still work. Pass 'true' to this function to use correct CP437 character values in your code. | |
virtual size_t | write (uint8_t) |
Print one byte/character of data, used to support print() | |
virtual void | write (uint8_t) |
int16_t | width (void) const |
Get width of the display, accounting for current rotation. | |
int16_t | height (void) const |
Get height of the display, accounting for current rotation. | |
uint8_t | getRotation (void) const |
Get rotation setting for display. | |
int16_t | getCursorX (void) const |
Get text cursor X location. | |
int16_t | getCursorY (void) const |
Get text cursor Y location. | |
Protected Attributes | |
SPISettings | spiSettings |
![]() | |
int16_t | WIDTH |
This is the 'raw' display width - never changes. | |
int16_t | HEIGHT |
This is the 'raw' display height - never changes. | |
int16_t | _width |
Display width as modified by current rotation. | |
int16_t | _height |
Display height as modified by current rotation. | |
int16_t | cursor_x |
x location to start print()ing text | |
int16_t | cursor_y |
y location to start print()ing text | |
uint16_t | textcolor |
16-bit background color for print() | |
uint16_t | textbgcolor |
16-bit text color for print() | |
uint8_t | textsize_x |
Desired magnification in X-axis of text to print() | |
uint8_t | textsize_y |
Desired magnification in Y-axis of text to print() | |
uint8_t | rotation |
Display rotation (0 thru 3) | |
bool | wrap |
If set, 'wrap' text at right edge of display. | |
bool | _cp437 |
If set, use correct CP437 charset (default is off) | |
GFXfont * | gfxFont |
Pointer to special font. | |
Private Member Functions | |
void | SPIwrite (uint8_t d) __attribute__((always_inline)) |
void | drawFastHLineInternal (int16_t x, int16_t y, int16_t w, uint16_t color) |
void | drawFastVLineInternal (int16_t x, int16_t y, int16_t h, uint16_t color) |
void | ssd1306_command1 (uint8_t c) |
void | ssd1306_commandList (const uint8_t *c, uint8_t n) |
Private Attributes | |
SPIClass * | spi |
TwoWire * | wire |
uint8_t * | buffer |
int8_t | i2caddr |
int8_t | vccstate |
int8_t | page_end |
int8_t | mosiPin |
int8_t | clkPin |
int8_t | dcPin |
int8_t | csPin |
int8_t | rstPin |
PortReg * | mosiPort |
PortReg * | clkPort |
PortReg * | dcPort |
PortReg * | csPort |
PortMask | mosiPinMask |
PortMask | clkPinMask |
PortMask | dcPinMask |
PortMask | csPinMask |
uint32_t | wireClk |
uint32_t | restoreClk |
uint8_t | contrast |
Additional Inherited Members | |
![]() | |
void | charBounds (unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy) |
Helper to determine size of a character with current font/size. Broke this out as it's used by both the PROGMEM- and RAM-resident getTextBounds() functions. | |
Class that stores state and functions for interacting with SSD1306 OLED displays.
Adafruit_SSD1306::Adafruit_SSD1306 | ( | uint8_t | w, |
uint8_t | h, | ||
TwoWire * | twi = &Wire, | ||
int8_t | rst_pin = -1, | ||
uint32_t | clkDuring = 400000UL, | ||
uint32_t | clkAfter = 100000UL ) |
Constructor for I2C-interfaced SSD1306 displays.
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 SSD1306 library calls. Defaults to 400000 (400 KHz), a known 'safe' value for most microcontrollers, and meets the SSD1306 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) SSD1306'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 SSD1306 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.) |
Constructor for SPI SSD1306 displays, using software (bitbang) SPI.
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. |
Adafruit_SSD1306::Adafruit_SSD1306 | ( | uint8_t | w, |
uint8_t | h, | ||
int8_t | mosi_pin, | ||
int8_t | sclk_pin, | ||
int8_t | dc_pin, | ||
int8_t | rst_pin, | ||
int8_t | cs_pin ) |
Adafruit_SSD1306::Adafruit_SSD1306 | ( | uint8_t | w, |
uint8_t | h, | ||
SPIClass * | spi, | ||
int8_t | dc_pin, | ||
int8_t | rst_pin, | ||
int8_t | cs_pin, | ||
uint32_t | bitrate = 8000000UL ) |
Constructor for SPI SSD1306 displays, using native hardware SPI.
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). |
Adafruit_SSD1306::Adafruit_SSD1306 | ( | int8_t | mosi_pin, |
int8_t | sclk_pin, | ||
int8_t | dc_pin, | ||
int8_t | rst_pin, | ||
int8_t | cs_pin ) |
DEPRECATED constructor for SPI SSD1306 displays, using software (bitbang) SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this.
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. |
Adafruit_SSD1306::Adafruit_SSD1306 | ( | int8_t | dc_pin, |
int8_t | rst_pin, | ||
int8_t | cs_pin ) |
DEPRECATED constructor for SPI SSD1306 displays, using native hardware SPI. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this. Only the primary SPI bus is supported, and bitrate is fixed at 8 MHz.
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. |
Adafruit_SSD1306::Adafruit_SSD1306 | ( | int8_t | rst_pin = -1 | ) |
DEPRECATED constructor for I2C SSD1306 displays. Provided for older code to maintain compatibility with the current library. Screen size is determined by enabling one of the SSD1306_* size defines in Adafruit_SSD1306.h. New code should NOT use this. Only the primary I2C bus is supported.
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). |
Adafruit_SSD1306::~Adafruit_SSD1306 | ( | void | ) |
Destructor for Adafruit_SSD1306 object.
bool Adafruit_SSD1306::begin | ( | uint8_t | vcs = SSD1306_SWITCHCAPVCC, |
uint8_t | addr = 0, | ||
bool | reset = true, | ||
bool | periphBegin = true ) |
Allocate RAM for image buffer, initialize peripherals and pins.
vcs | VCC selection. Pass SSD1306_SWITCHCAPVCC to generate the display voltage (step up) from the 3.3V source, or SSD1306_EXTERNALVCC otherwise. Most situations with Adafruit SSD1306 breakouts will want SSD1306_SWITCHCAPVCC. |
addr | I2C address of corresponding SSD1306 display (or pass 0 to use default of 0x3C for 128x32 display, 0x3D for all others). SPI displays (hardware or software) do not use addresses, but this argument is still required (pass 0 or any value really, it will simply be ignored). Default if unspecified is 0. |
reset | If true, and if the reset pin passed to the constructor is valid, a hard reset will be performed before initializing the display. If using multiple SSD1306 displays on the same bus, and if they all share the same reset pin, you should only pass true on the first display being initialized, false on all others, else the already-initialized displays would be reset. Default if unspecified is true. |
periphBegin | If true, and if a hardware peripheral is being used (I2C or SPI, but not software SPI), call that peripheral's begin() function, else (false) it has already been done in one's sketch code. Cases where false might be used include multiple displays or other devices sharing a common bus, or situations on some platforms where a nonstandard begin() function is available (e.g. a TwoWire interface on non-default pins, as can be done on the ESP8266 and perhaps others). |
void Adafruit_SSD1306::clearDisplay | ( | void | ) |
Clear contents of display buffer (set all pixels to off).
void Adafruit_SSD1306::dim | ( | bool | dim | ) |
Dim the display.
dim | true to enable lower brightness mode, false for full brightness. |
void Adafruit_SSD1306::display | ( | void | ) |
Push data currently in RAM to SSD1306 display.
|
virtual |
Draw a horizontal line. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives.
x | Leftmost column – 0 at left to (screen width - 1) at right. |
y | Row of display – 0 at top to (screen height -1) at bottom. |
w | Width of line, in pixels. |
color | Line color, one of: SSD1306_BLACK, SSD1306_WHITE or SSD1306_INVERT. |
Reimplemented from Adafruit_GFX.
|
private |
|
virtual |
Draw a vertical line. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives.
x | Column of display – 0 at left to (screen width -1) at right. |
y | Topmost row – 0 at top to (screen height - 1) at bottom. |
h | Height of line, in pixels. |
color | Line color, one of: SSD1306_BLACK, SSD1306_WHITE or SSD1306_INVERT. |
Reimplemented from Adafruit_GFX.
|
private |
|
virtual |
Set/clear/invert a single pixel. This is also invoked by the Adafruit_GFX library in generating many higher-level graphics primitives.
x | Column of display – 0 at left to (screen width - 1) at right. |
y | Row of display – 0 at top to (screen height -1) at bottom. |
color | Pixel color, one of: SSD1306_BLACK, SSD1306_WHITE or SSD1306_INVERT. |
Implements Adafruit_GFX.
uint8_t * Adafruit_SSD1306::getBuffer | ( | void | ) |
Get base address of display buffer for direct reading or writing.
bool Adafruit_SSD1306::getPixel | ( | int16_t | x, |
int16_t | y ) |
Return color of a single pixel in display buffer.
x | Column of display – 0 at left to (screen width - 1) at right. |
y | Row of display – 0 at top to (screen height -1) at bottom. |
|
virtual |
Enable or disable display invert mode (white-on-black vs black-on-white).
i | If true, switch to invert mode (black-on-white), else normal mode (white-on-black). |
Reimplemented from Adafruit_GFX.
|
inlineprivate |
void Adafruit_SSD1306::ssd1306_command | ( | uint8_t | c | ) |
Issue a single low-level command directly to the SSD1306 display, bypassing the library.
c | Command to issue (0x00 to 0xFF, see datasheet). |
|
private |
|
private |
void Adafruit_SSD1306::startscrolldiagleft | ( | uint8_t | start, |
uint8_t | stop ) |
Activate alternate diagonal scroll for all or part of the display.
start | First row. |
stop | Last row. |
void Adafruit_SSD1306::startscrolldiagright | ( | uint8_t | start, |
uint8_t | stop ) |
Activate a diagonal scroll for all or part of the display.
start | First row. |
stop | Last row. |
void Adafruit_SSD1306::startscrollleft | ( | uint8_t | start, |
uint8_t | stop ) |
Activate a left-handed scroll for all or part of the display.
start | First row. |
stop | Last row. |
void Adafruit_SSD1306::startscrollright | ( | uint8_t | start, |
uint8_t | stop ) |
Activate a right-handed scroll for all or part of the display.
start | First row. |
stop | Last row. |
void Adafruit_SSD1306::stopscroll | ( | void | ) |
Cease a previously-begun scrolling action.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |