Adafruit SSD1327
Public Member Functions | List of all members
Adafruit_SSD1327 Class Reference

#include <Adafruit_SSD1327.h>

Inheritance diagram for Adafruit_SSD1327:

Public Member Functions

 Adafruit_SSD1327 (uint16_t w, uint16_t h, TwoWire *twi=&Wire, int8_t rst_pin=-1, uint32_t preclk=400000, uint32_t postclk=100000)
 Constructor for I2C-interfaced SSD1327 displays. More...
 
 Adafruit_SSD1327 (uint16_t w, uint16_t h, int8_t mosi_pin, int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin)
 Constructor for SPI SSD1327 displays, using software (bitbang) SPI. More...
 
 Adafruit_SSD1327 (uint16_t w, uint16_t h, SPIClass *spi, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin, uint32_t bitrate=8000000UL)
 Constructor for SPI SSD1327 displays, using native hardware SPI. More...
 
 ~Adafruit_SSD1327 (void)
 Destructor for Adafruit_SSD1327 object.
 
bool begin (uint8_t i2caddr=SSD1327_I2C_ADDRESS, bool reset=true)
 Allocate RAM for image buffer, initialize peripherals and pins. More...
 
void display ()
 Do the actual writing of the internal frame buffer to display RAM.
 
void invertDisplay (bool i)
 Enable or disable display invert mode (white-on-black vs black-on-white). Handy for testing! More...
 

Detailed Description

The controller object for SSD1327 OLED displays

Constructor & Destructor Documentation

◆ Adafruit_SSD1327() [1/3]

Adafruit_SSD1327::Adafruit_SSD1327 ( uint16_t  w,
uint16_t  h,
TwoWire *  twi = &Wire,
int8_t  rst_pin = -1,
uint32_t  clkDuring = 400000,
uint32_t  clkAfter = 100000 
)

Constructor for I2C-interfaced SSD1327 displays.

Parameters
wDisplay width in pixels
hDisplay height in pixels
twiPointer to an existing TwoWire instance (e.g. &Wire, the microcontroller's primary I2C bus).
rst_pinReset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin).
clkDuringSpeed (in Hz) for Wire transmissions in SSD1327 library calls. Defaults to 400000 (400 KHz), a known 'safe' value for most microcontrollers, and meets the SSD1327 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) SSD1327'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.)
clkAfterSpeed (in Hz) for Wire transmissions following SSD1327 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_SSD1327() [2/3]

Adafruit_SSD1327::Adafruit_SSD1327 ( uint16_t  w,
uint16_t  h,
int8_t  mosi_pin,
int8_t  sclk_pin,
int8_t  dc_pin,
int8_t  rst_pin,
int8_t  cs_pin 
)

Constructor for SPI SSD1327 displays, using software (bitbang) SPI.

Parameters
wDisplay width in pixels
hDisplay height in pixels
mosi_pinMOSI (master out, slave in) pin (using Arduino pin numbering). This transfers serial data from microcontroller to display.
sclk_pinSCLK (serial clock) pin (using Arduino pin numbering). This clocks each bit from MOSI.
dc_pinData/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high).
rst_pinReset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin).
cs_pinChip-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_SSD1327() [3/3]

Adafruit_SSD1327::Adafruit_SSD1327 ( uint16_t  w,
uint16_t  h,
SPIClass *  spi,
int8_t  dc_pin,
int8_t  rst_pin,
int8_t  cs_pin,
uint32_t  bitrate = 8000000UL 
)

Constructor for SPI SSD1327 displays, using native hardware SPI.

Parameters
wDisplay width in pixels
hDisplay height in pixels
spiPointer to an existing SPIClass instance (e.g. &SPI, the microcontroller's primary SPI bus).
dc_pinData/command pin (using Arduino pin numbering), selects whether display is receiving commands (low) or data (high).
rst_pinReset pin (using Arduino pin numbering), or -1 if not used (some displays might be wired to share the microcontroller's reset pin).
cs_pinChip-select pin (using Arduino pin numbering) for sharing the bus with other devices. Active low.
bitrateSPI 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!

Member Function Documentation

◆ begin()

bool Adafruit_SSD1327::begin ( uint8_t  addr = SSD1327_I2C_ADDRESS,
bool  reset = true 
)

Allocate RAM for image buffer, initialize peripherals and pins.

Parameters
addrI2C address of corresponding SSD1327 display. 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.
resetIf 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 SSD1327 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.
Returns
true on successful allocation/init, false otherwise. Well-behaved code should check the return value before proceeding.
Note
MUST call this function before any drawing or updates!

◆ invertDisplay()

void Adafruit_SSD1327::invertDisplay ( bool  i)

Enable or disable display invert mode (white-on-black vs black-on-white). Handy for testing!

Parameters
iIf true, switch to invert mode (black-on-white), else normal mode (white-on-black).

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