Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: wifi-ism43362
Dependents: DigitalOut DigitalOut
Adafruit_SSD1306_Spi Class Reference
This is the SPI SSD1306 display driver transport class. More...
#include <Adafruit_SSD1306.h>
Inherits Adafruit_SSD1306.
Public Member Functions | |
| Adafruit_SSD1306_Spi (SPI &spi, PinName DC, PinName RST, PinName CS, uint8_t rawHieght=32, uint8_t rawWidth=128) | |
| Create a SSD1306 SPI transport display driver instance with the specified DC, RST, and CS pins, as well as the display dimentions. | |
| virtual void | drawPixel (int16_t x, int16_t y, uint16_t color) |
| Paint one BLACK or WHITE pixel in the display buffer. | |
| void | clearDisplay (void) |
| Clear the display buffer. | |
| void | display () |
| Cause the display to be updated with the buffer content. | |
| virtual void | splash () |
| Fill the buffer with the AdaFruit splash screen. | |
| virtual void | drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color) |
| Draw a Horizontal Line. | |
| virtual void | drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Draw a rectangle. | |
| virtual void | fillScreen (uint16_t color) |
| Fill the entire display. | |
| void | drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw a circle. | |
| void | fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color) |
| Draw and fill a circle. | |
| 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. | |
| void | fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color) |
| Draw and fill a triangle. | |
| void | drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
| Draw a rounded rectangle. | |
| void | fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color) |
| Draw and fill a rounded rectangle. | |
| void | drawBitmap (int16_t x, int16_t y, const uint8_t *bitmap, int16_t w, int16_t h, uint16_t color) |
| Draw a bitmap. | |
| virtual void | drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
| Draw a line. | |
| virtual void | drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color) |
| Draw a vertical line. | |
| virtual void | fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
| Draw and fill a rectangle. | |
| void | drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size) |
| Draw a text character at a specified pixel location. | |
| size_t | writeChar (uint8_t) |
| Draw a text character at the text cursor location. | |
| int16_t | width (void) |
| Get the width of the display in pixels. | |
| int16_t | height (void) |
| Get the height of the display in pixels. | |
| void | setTextCursor (int16_t x, int16_t y) |
| Set the text cursor location, based on the size of the text. | |
| void | setTextSize (uint8_t s) |
| Set the size of the text to be drawn. | |
| void | setTextColor (uint16_t c) |
| Set the text foreground and background colors to be the same. | |
| void | setTextColor (uint16_t c, uint16_t b) |
| Set the text foreground and background colors independantly. | |
| void | setTextWrap (bool w) |
| Set text wraping mode true or false. | |
| void | setRotation (uint8_t r) |
| Set the display rotation, 1, 2, 3, or 4. | |
| uint8_t | getRotation (void) |
| Get the current rotation. | |
Detailed Description
This is the SPI SSD1306 display driver transport class.
Definition at line 88 of file Adafruit_SSD1306.h.
Constructor & Destructor Documentation
| Adafruit_SSD1306_Spi | ( | SPI & | spi, |
| PinName | DC, | ||
| PinName | RST, | ||
| PinName | CS, | ||
| uint8_t | rawHieght = 32, |
||
| uint8_t | rawWidth = 128 |
||
| ) |
Create a SSD1306 SPI transport display driver instance with the specified DC, RST, and CS pins, as well as the display dimentions.
Required parameters
- Parameters:
-
spi - a reference to an initialized SPI object DC (Data/Command) pin name RST (Reset) pin name CS (Chip Select) pin name
Optional parameters
- Parameters:
-
rawHeight - the vertical number of pixels for the display, defaults to 32 rawWidth - the horizonal number of pixels for the display, defaults to 128
Definition at line 103 of file Adafruit_SSD1306.h.
Member Function Documentation
| void clearDisplay | ( | void | ) | [inherited] |
Clear the display buffer.
Definition at line 148 of file Adafruit_SSD1306.cpp.
| void display | ( | void | ) | [inherited] |
Cause the display to be updated with the buffer content.
Definition at line 138 of file Adafruit_SSD1306.cpp.
| void drawBitmap | ( | int16_t | x, |
| int16_t | y, | ||
| const uint8_t * | bitmap, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw a bitmap.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 353 of file Adafruit_GFX.cpp.
| void drawChar | ( | int16_t | x, |
| int16_t | y, | ||
| unsigned char | c, | ||
| uint16_t | color, | ||
| uint16_t | bg, | ||
| uint8_t | size | ||
| ) | [inherited] |
Draw a text character at a specified pixel location.
Definition at line 389 of file Adafruit_GFX.cpp.
| void drawCircle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | r, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw a circle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 27 of file Adafruit_GFX.cpp.
| void drawFastHLine | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Draw a Horizontal Line.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 221 of file Adafruit_GFX.cpp.
| void drawFastVLine | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | h, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Draw a vertical line.
- Note:
- GFX_WANT_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
Definition at line 197 of file Adafruit_GFX.cpp.
| void drawLine | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | x1, | ||
| int16_t | y1, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Draw a line.
- Note:
- GFX_WANT_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
Definition at line 153 of file Adafruit_GFX.cpp.
| void drawPixel | ( | int16_t | x, |
| int16_t | y, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Paint one BLACK or WHITE pixel in the display buffer.
Implements Adafruit_GFX.
Definition at line 103 of file Adafruit_SSD1306.cpp.
| void drawRect | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Draw a rectangle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 213 of file Adafruit_GFX.cpp.
| void drawRoundRect | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| int16_t | radius, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw a rounded rectangle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 233 of file Adafruit_GFX.cpp.
| void drawTriangle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | x1, | ||
| int16_t | y1, | ||
| int16_t | x2, | ||
| int16_t | y2, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw a triangle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 259 of file Adafruit_GFX.cpp.
| void fillCircle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | r, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw and fill a circle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 109 of file Adafruit_GFX.cpp.
| void fillRect | ( | int16_t | x, |
| int16_t | y, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| uint16_t | color | ||
| ) | [virtual, inherited] |
Draw and fill a rectangle.
- Note:
- GFX_WANT_ABSTRACTS or GFX_SIZEABLE_TEXT must be defined in Adafruit_GFX_config.h
Definition at line 203 of file Adafruit_GFX.cpp.
| void fillRoundRect | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | w, | ||
| int16_t | h, | ||
| int16_t | radius, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw and fill a rounded rectangle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 248 of file Adafruit_GFX.cpp.
| void fillScreen | ( | uint16_t | color ) | [virtual, inherited] |
Fill the entire display.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 227 of file Adafruit_GFX.cpp.
| void fillTriangle | ( | int16_t | x0, |
| int16_t | y0, | ||
| int16_t | x1, | ||
| int16_t | y1, | ||
| int16_t | x2, | ||
| int16_t | y2, | ||
| uint16_t | color | ||
| ) | [inherited] |
Draw and fill a triangle.
- Note:
- GFX_WANT_ABSTRACTS must be defined in Adafruit_GFX_config.h
Definition at line 267 of file Adafruit_GFX.cpp.
| uint8_t getRotation | ( | void | ) | [inherited] |
Get the current rotation.
Definition at line 171 of file Adafruit_GFX.h.
| int16_t height | ( | void | ) | [inherited] |
Get the height of the display in pixels.
Definition at line 151 of file Adafruit_GFX.h.
| void setRotation | ( | uint8_t | r ) | [inherited] |
Set the display rotation, 1, 2, 3, or 4.
Definition at line 437 of file Adafruit_GFX.cpp.
| void setTextColor | ( | uint16_t | c, |
| uint16_t | b | ||
| ) | [inherited] |
Set the text foreground and background colors independantly.
Definition at line 164 of file Adafruit_GFX.h.
| void setTextColor | ( | uint16_t | c ) | [inherited] |
Set the text foreground and background colors to be the same.
Definition at line 162 of file Adafruit_GFX.h.
| void setTextCursor | ( | int16_t | x, |
| int16_t | y | ||
| ) | [inherited] |
Set the text cursor location, based on the size of the text.
Definition at line 154 of file Adafruit_GFX.h.
| void setTextSize | ( | uint8_t | s ) | [inherited] |
Set the size of the text to be drawn.
- Note:
- Make sure to enable either GFX_SIZEABLE_TEXT or GFX_WANT_ABSTRACTS
Definition at line 159 of file Adafruit_GFX.h.
| void setTextWrap | ( | bool | w ) | [inherited] |
Set text wraping mode true or false.
Definition at line 166 of file Adafruit_GFX.h.
| void splash | ( | void | ) | [virtual, inherited] |
Fill the buffer with the AdaFruit splash screen.
Definition at line 153 of file Adafruit_SSD1306.cpp.
| int16_t width | ( | void | ) | [inherited] |
Get the width of the display in pixels.
Definition at line 149 of file Adafruit_GFX.h.
| size_t writeChar | ( | uint8_t | c ) | [inherited] |
Draw a text character at the text cursor location.
Definition at line 366 of file Adafruit_GFX.cpp.
Generated on Thu Jul 14 2022 01:22:20 by
1.7.2