JM9 XRCU Board 0.1.3
Libraries API Reference
Loading...
Searching...
No Matches
Adafruit_GrayOLED Class Referenceabstract

Class that stores state and functions for interacting with generic grayscale OLED displays. More...

#include <Adafruit_GrayOLED.h>

Inheritance diagram for Adafruit_GrayOLED:
Adafruit_GFX Print

Public Member Functions

 Adafruit_GrayOLED (uint8_t bpp, uint16_t w, uint16_t h, TwoWire *twi=&Wire, int8_t rst_pin=-1, uint32_t preclk=400000, uint32_t postclk=100000)
 
 Adafruit_GrayOLED (uint8_t bpp, 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)
 
 Adafruit_GrayOLED (uint8_t bpp, uint16_t w, uint16_t h, SPIClass *spi, int8_t dc_pin, int8_t rst_pin, int8_t cs_pin, uint32_t bitrate=8000000UL)
 
virtual void display (void)=0
 The function that sub-classes define that writes out the buffer to the display over I2C or SPI.
 
void clearDisplay (void)
 
void invertDisplay (bool i)
 
void setContrast (uint8_t contrastlevel)
 
void drawPixel (int16_t x, int16_t y, uint16_t color)
 Draw to the screen/framebuffer/etc. Must be overridden in subclass.
 
bool getPixel (int16_t x, int16_t y)
 
uint8_t * getBuffer (void)
 
void oled_command (uint8_t c)
 
bool oled_commandList (const uint8_t *c, uint8_t n)
 
- Public Member Functions inherited from Adafruit_GFX
 Adafruit_GFX (int16_t w, int16_t h)
 
virtual void startWrite (void)
 
virtual void writePixel (int16_t x, int16_t y, uint16_t color)
 
virtual void writeFillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 
virtual void writeFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)
 
virtual void writeFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)
 
virtual void writeLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
 
virtual void endWrite (void)
 
virtual void setRotation (uint8_t r)
 
virtual void drawFastVLine (int16_t x, int16_t y, int16_t h, uint16_t color)
 
virtual void drawFastHLine (int16_t x, int16_t y, int16_t w, uint16_t color)
 
virtual void fillRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 
virtual void fillScreen (uint16_t color)
 
virtual void drawLine (int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
 
virtual void drawRect (int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
 
void drawCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 
void drawCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, uint16_t color)
 
void fillCircle (int16_t x0, int16_t y0, int16_t r, uint16_t color)
 
void fillCircleHelper (int16_t x0, int16_t y0, int16_t r, uint8_t cornername, int16_t delta, uint16_t color)
 
void drawTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
 
void fillTriangle (int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
 
void drawRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
 
void fillRoundRect (int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color)
 
void drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
 
void drawBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color, uint16_t bg)
 
void drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color)
 
void drawBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h, uint16_t color, uint16_t bg)
 
void drawXBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)
 
void drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h)
 
void drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, int16_t w, int16_t h)
 
void drawGrayscaleBitmap (int16_t x, int16_t y, const uint8_t bitmap[], const uint8_t mask[], int16_t w, int16_t h)
 
void drawGrayscaleBitmap (int16_t x, int16_t y, uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h)
 
void drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h)
 
void drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, int16_t w, int16_t h)
 
void drawRGBBitmap (int16_t x, int16_t y, const uint16_t bitmap[], const uint8_t mask[], int16_t w, int16_t h)
 
void drawRGBBitmap (int16_t x, int16_t y, uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h)
 
void drawChar (int16_t x, int16_t y, unsigned char c, uint16_t color, uint16_t bg, uint8_t size)
 
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)
 
void getTextBounds (const char *string, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
 
void getTextBounds (const __FlashStringHelper *s, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
 
void getTextBounds (const String &str, int16_t x, int16_t y, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
 
void setTextSize (uint8_t s)
 
void setTextSize (uint8_t sx, uint8_t sy)
 
void setFont (const GFXfont *f=NULL)
 
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 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.
 
size_t write (const char *str)
 
virtual size_t write (const uint8_t *buffer, size_t size)
 
size_t write (const char *buffer, size_t size)
 
- Public Member Functions inherited from Print
int getWriteError ()
 
void clearWriteError ()
 
size_t write (const char *str)
 
size_t write (const char *buffer, size_t size)
 
virtual int availableForWrite ()
 
size_t print (const __FlashStringHelper *)
 
size_t print (const String &)
 
size_t print (const char[])
 
size_t print (char)
 
size_t print (unsigned char, int=DEC)
 
size_t print (int, int=DEC)
 
size_t print (unsigned int, int=DEC)
 
size_t print (long, int=DEC)
 
size_t print (unsigned long, int=DEC)
 
size_t print (long long, int=DEC)
 
size_t print (unsigned long long, int=DEC)
 
size_t print (float, int=2)
 
size_t print (double, int=2)
 
size_t print (const Printable &)
 
size_t println (const __FlashStringHelper *)
 
size_t println (const String &s)
 
size_t println (const char[])
 
size_t println (char)
 
size_t println (unsigned char, int=DEC)
 
size_t println (int, int=DEC)
 
size_t println (unsigned int, int=DEC)
 
size_t println (long, int=DEC)
 
size_t println (unsigned long, int=DEC)
 
size_t println (long long, int=DEC)
 
size_t println (unsigned long long, int=DEC)
 
size_t println (float, int=2)
 
size_t println (double, int=2)
 
size_t println (const Printable &)
 
size_t println (void)
 
int printf (const char *format,...)
 
int printf (const __FlashStringHelper *format,...)
 
int vprintf (const __FlashStringHelper *format, va_list ap)
 
int vprintf (const char *format, va_list ap)
 
virtual void flush ()
 

Protected Member Functions

bool _init (uint8_t i2caddr=0x3C, bool reset=true)
 
- Protected Member Functions inherited from Adafruit_GFX
void charBounds (unsigned char c, int16_t *x, int16_t *y, int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy)
 
- Protected Member Functions inherited from Print
void setWriteError (int err=1)
 

Protected Attributes

Adafruit_SPIDevicespi_dev = NULL
 The SPI interface BusIO device.
 
Adafruit_I2CDevicei2c_dev = NULL
 The I2C interface BusIO device.
 
int32_t i2c_preclk = 400000
 Configurable 'high speed' I2C rate.
 
int32_t i2c_postclk = 100000
 Configurable 'low speed' I2C rate.
 
uint8_t * buffer = NULL
 Internal 1:1 framebuffer of display mem.
 
int16_t window_x1
 Dirty tracking window minimum x.
 
int16_t window_y1
 Dirty tracking window minimum y.
 
int16_t window_x2
 Dirty tracking window maximum x.
 
int16_t window_y2
 Dirty tracking window maximum y.
 
int dcPin
 The Arduino pin connected to D/C (for SPI)
 
int csPin
 The Arduino pin connected to CS (for SPI)
 
int rstPin
 The Arduino pin connected to reset (-1 if unused)
 
uint8_t _bpp = 1
 Bits per pixel color for this display.
 
- Protected Attributes inherited from Adafruit_GFX
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)
 
GFXfontgfxFont
 Pointer to special font.
 

Detailed Description

Class that stores state and functions for interacting with generic grayscale OLED displays.

Member Function Documentation

◆ drawPixel()

void Adafruit_GrayOLED::drawPixel ( int16_t x,
int16_t y,
uint16_t color )
virtual

Draw to the screen/framebuffer/etc. Must be overridden in subclass.

Parameters
xX coordinate in pixels
yY coordinate in pixels
color16-bit pixel color.

Implements Adafruit_GFX.

◆ invertDisplay()

void Adafruit_GrayOLED::invertDisplay ( bool i)
virtual

Reimplemented from Adafruit_GFX.


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