24 #ifndef _Adafruit_GRAYOLED_H_ 25 #define _Adafruit_GRAYOLED_H_ 28 #if !defined(__AVR_ATtiny85__) && !defined(__AVR_ATtiny84__) 30 #include <Adafruit_GFX.h> 31 #include <Adafruit_I2CDevice.h> 32 #include <Adafruit_SPIDevice.h> 36 #define GRAYOLED_SETCONTRAST 0x81 37 #define GRAYOLED_NORMALDISPLAY 0xA6 38 #define GRAYOLED_INVERTDISPLAY 0xA7 40 #define MONOOLED_BLACK 0 41 #define MONOOLED_WHITE 1 42 #define MONOOLED_INVERSE 2 51 int8_t rst_pin = -1, uint32_t preclk = 400000,
52 uint32_t postclk = 100000);
54 int8_t sclk_pin, int8_t dc_pin, int8_t rst_pin,
57 int8_t dc_pin, int8_t rst_pin, int8_t cs_pin,
58 uint32_t bitrate = 8000000UL);
70 void drawPixel(int16_t x, int16_t y, uint16_t color);
78 bool _init(uint8_t i2caddr = 0x3C,
bool reset =
true);
97 TwoWire *_theWire = NULL;
100 #endif // end __AVR_ATtiny85__ __AVR_ATtiny84__ 101 #endif // _Adafruit_GrayOLED_H_ uint8_t _bpp
Bits per pixel color for this display.
Definition: Adafruit_GrayOLED.h:95
int16_t window_x2
Dirty tracking window maximum x.
Definition: Adafruit_GrayOLED.h:86
int csPin
The Arduino pin connected to CS (for SPI)
Definition: Adafruit_GrayOLED.h:91
bool _init(uint8_t i2caddr=0x3C, bool reset=true)
Allocate RAM for image buffer, initialize peripherals and pins. Note that subclasses must call this b...
Definition: Adafruit_GrayOLED.cpp:225
Definition: Adafruit_GFX.h:18
virtual void display(void)=0
The function that sub-classes define that writes out the buffer to the display over I2C or SPI...
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 ...
Definition: Adafruit_GrayOLED.cpp:286
int16_t window_y1
Dirty tracking window minimum y.
Definition: Adafruit_GrayOLED.h:86
Adafruit_SPIDevice * spi_dev
The SPI interface BusIO device.
Definition: Adafruit_GrayOLED.h:80
bool oled_commandList(const uint8_t *c, uint8_t n)
Issue multiple bytes of commands OLED, using I2C or hard/soft SPI as needed.
Definition: Adafruit_GrayOLED.cpp:188
int16_t window_y2
Dirty tracking window maximum y.
Definition: Adafruit_GrayOLED.h:86
int16_t window_x1
Dirty tracking window minimum x.
Definition: Adafruit_GrayOLED.h:86
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)
Constructor for I2C-interfaced OLED displays.
Definition: Adafruit_GrayOLED.cpp:65
void invertDisplay(bool i)
Enable or disable display invert mode (white-on-black vs black-on-white). Handy for testing! ...
Definition: Adafruit_GrayOLED.cpp:408
void setContrast(uint8_t contrastlevel)
Adjust the display contrast.
Definition: Adafruit_GrayOLED.cpp:418
uint8_t * buffer
Internal 1:1 framebuffer of display mem.
Definition: Adafruit_GrayOLED.h:84
~Adafruit_GrayOLED(void)
Destructor for Adafruit_GrayOLED object.
Definition: Adafruit_GrayOLED.cpp:151
void clearDisplay(void)
Clear contents of display buffer (set all pixels to off).
Definition: Adafruit_GrayOLED.cpp:345
uint8_t * getBuffer(void)
Get base address of display buffer for direct reading or writing.
Definition: Adafruit_GrayOLED.cpp:392
int rstPin
The Arduino pin connected to reset (-1 if unused)
Definition: Adafruit_GrayOLED.h:91
int32_t i2c_preclk
Configurable 'high speed' I2C rate.
Definition: Adafruit_GrayOLED.h:82
bool getPixel(int16_t x, int16_t y)
Return color of a single pixel in display buffer.
Definition: Adafruit_GrayOLED.cpp:365
Class that stores state and functions for interacting with generic grayscale OLED displays...
Definition: Adafruit_GrayOLED.h:48
int32_t i2c_postclk
Configurable 'low speed' I2C rate.
Definition: Adafruit_GrayOLED.h:83
void oled_command(uint8_t c)
Issue single command byte to OLED, using I2C or hard/soft SPI as needed.
Definition: Adafruit_GrayOLED.cpp:169
int dcPin
The Arduino pin connected to D/C (for SPI)
Definition: Adafruit_GrayOLED.h:91
Adafruit_I2CDevice * i2c_dev
The I2C interface BusIO device.
Definition: Adafruit_GrayOLED.h:81