Adafruit SSD1331 Arduino Library
Public Member Functions | Static Public Attributes | List of all members
Adafruit_SSD1331 Class Reference

Class to manage hardware interface with SSD1331 chipset. More...

#include <Adafruit_SSD1331.h>

Inheritance diagram for Adafruit_SSD1331:

Public Member Functions

 Adafruit_SSD1331 (int8_t cs, int8_t dc, int8_t mosi, int8_t sclk, int8_t rst)
 Instantiate Adafruit SSD1331 driver with software SPI. More...
 
 Adafruit_SSD1331 (int8_t cs, int8_t dc, int8_t rst)
 Instantiate Adafruit SSD1331 driver with hardware SPI. More...
 
 Adafruit_SSD1331 (SPIClass *spi, int8_t cs, int8_t dc, int8_t rst=-1)
 Instantiate Adafruit SSD1331 driver with hardware SPI. More...
 
void begin (uint32_t begin=8000000)
 Initialize SSD1331 chip Connects to the SSD1331 over SPI and sends initialization procedure commands. More...
 
void setRotation (uint8_t r)
 Set origin of (0,0) and orientation of OLED display. More...
 
void setAddrWindow (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 SPI displays set an address window rectangle for blitting pixels. More...
 
void enableDisplay (boolean enable)
 Change whether display is on or off. More...
 

Static Public Attributes

static const int16_t TFTWIDTH = 96
 The width of the display.
 
static const int16_t TFTHEIGHT = 64
 The height of the display.
 

Detailed Description

Class to manage hardware interface with SSD1331 chipset.

Constructor & Destructor Documentation

◆ Adafruit_SSD1331() [1/3]

Adafruit_SSD1331::Adafruit_SSD1331 ( int8_t  cs,
int8_t  dc,
int8_t  mosi,
int8_t  sclk,
int8_t  rst 
)

Instantiate Adafruit SSD1331 driver with software SPI.

Parameters
csChip select pin #
dcData/Command pin #
mosiSPI MOSI pin #
sclkSPI Clock pin #
rstReset pin # (optional, pass -1 if unused)

◆ Adafruit_SSD1331() [2/3]

Adafruit_SSD1331::Adafruit_SSD1331 ( int8_t  cs,
int8_t  dc,
int8_t  rst 
)

Instantiate Adafruit SSD1331 driver with hardware SPI.

Parameters
csChip select pin #
dcData/Command pin #
rstReset pin # (optional, pass -1 if unused)

◆ Adafruit_SSD1331() [3/3]

Adafruit_SSD1331::Adafruit_SSD1331 ( SPIClass *  spi,
int8_t  cs,
int8_t  dc,
int8_t  rst = -1 
)

Instantiate Adafruit SSD1331 driver with hardware SPI.

Parameters
spiPointer to an existing SPIClass instance (e.g. &SPI, the microcontroller's primary SPI bus).
csChip select pin #
dcData/Command pin #
rstReset pin # (optional, pass -1 if unused)

Member Function Documentation

◆ begin()

void Adafruit_SSD1331::begin ( uint32_t  freq = 8000000)

Initialize SSD1331 chip Connects to the SSD1331 over SPI and sends initialization procedure commands.

Parameters
freqDesired SPI clock frequency

◆ setRotation()

void Adafruit_SSD1331::setRotation ( uint8_t  r)

Set origin of (0,0) and orientation of OLED display.

Parameters
rThe index for rotation, from 0-3 inclusive
Returns
None (void).
Note
SSD1331 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.

◆ setAddrWindow()

void Adafruit_SSD1331::setAddrWindow ( uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)

SPI displays set an address window rectangle for blitting pixels.

Parameters
xTop left corner x coordinate
yTop left corner x coordinate
wWidth of window
hHeight of window

◆ enableDisplay()

void Adafruit_SSD1331::enableDisplay ( boolean  enable)

Change whether display is on or off.

Parameters
enableTrue if you want the display ON, false OFF

The documentation for this class was generated from the following files: