SSD1306 I2C Display Driver
1.2.1
This library is developed to control SSD1306 I2C OLED Display
|
Macros | |
#define | ssd1306_drawCanvas(x, y, w, h, buf) ssd1306_drawBuffer(x, y, w, h, buf) |
Functions | |
void | ssd1306_setPos (uint8_t x, uint8_t y) |
void | ssd1306_sendData (uint8_t data) |
void | ssd1306_fillScreen (uint8_t fill_Data) |
void | ssd1306_clearScreen () |
void | ssd1306_negativeMode () |
void | ssd1306_positiveMode () |
void | ssd1306_charF6x8 (uint8_t x, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) |
void | ssd1306_setFont6x8 (const uint8_t *progmemFont) |
void | ssd1306_putPixel (uint8_t x, uint8_t y) |
void | ssd1306_putPixels (uint8_t x, uint8_t y, uint8_t pixels) |
void | ssd1306_drawRect (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) |
void | ssd1306_drawHLine (uint8_t x1, uint8_t y1, uint8_t x2) |
void | ssd1306_drawVLine (uint8_t x1, uint8_t y1, uint8_t y2) |
void | ssd1306_drawBuffer (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf) |
void | ssd1306_drawBitmap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf) |
void | ssd1306_clearBlock (uint8_t x, uint8_t y, uint8_t w, uint8_t h) |
void | ssd1306_drawSpriteEx (uint8_t x, uint8_t y, uint8_t w, const uint8_t *sprite) |
void | ssd1306_drawSprite (SPRITE *sprite) |
void | ssd1306_eraseSprite (SPRITE *sprite) |
void | ssd1306_eraseTrace (SPRITE *sprite) |
SPRITE | ssd1306_createSprite (uint8_t x, uint8_t y, uint8_t w, const uint8_t *data) |
void | ssd1306_replaceSprite (SPRITE *sprite, const uint8_t *data) |
#define ssd1306_drawCanvas | ( | x, | |
y, | |||
w, | |||
h, | |||
buf | |||
) | ssd1306_drawBuffer(x, y, w, h, buf) |
Draws bitmap, located in SRAM, on the display Each byte represents 8 vertical pixels.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
w | - width of bitmap in pixels |
h | - height of bitmap in pixels (must be divided by 8) |
buf | - pointer to data, located in SRAM: each byte represents 8 vertical pixels. |
void ssd1306_charF6x8 | ( | uint8_t | x, |
uint8_t | y, | ||
const char | ch[], | ||
EFontStyle | style = STYLE_NORMAL |
||
) |
Prints text to screen using font 6x8.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
ch | - NULL-terminated string to print |
style | - font style (EFontStyle), normal by default. |
Definition at line 134 of file ssd1306.cpp.
void ssd1306_clearBlock | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
uint8_t | h | ||
) |
Fills block with black pixels
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
w | - width of block in pixels |
h | - height of block in pixels (must be divided by 8) |
Definition at line 274 of file ssd1306.cpp.
void ssd1306_clearScreen | ( | ) |
Fills screen with zero-byte
Definition at line 108 of file ssd1306.cpp.
SPRITE ssd1306_createSprite | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
const uint8_t * | data | ||
) |
Creates sprite object. Sprite height is fixed to 8 pixels
x | - horizontal position in pixels |
y | - vertical position in pixels |
w | - width of sprite in pixels |
data | - pointer to data, located in Flash: each byte represents 8 vertical pixels. |
Definition at line 401 of file ssd1306.cpp.
void ssd1306_drawBitmap | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
uint8_t | h, | ||
const uint8_t * | buf | ||
) |
Draws bitmap, located in Flash, on the display
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
w | - width of bitmap in pixels |
h | - height of bitmap in pixels (must be divided by 8) |
buf | - pointer to data, located in Flash: each byte represents 8 vertical pixels. |
Definition at line 252 of file ssd1306.cpp.
void ssd1306_drawBuffer | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
uint8_t | h, | ||
const uint8_t * | buf | ||
) |
Draws bitmap, located in SRAM, on the display Each byte represents 8 vertical pixels.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
w | - width of bitmap in pixels |
h | - height of bitmap in pixels (must be divided by 8) |
buf | - pointer to data, located in SRAM: each byte represents 8 vertical pixels. |
Definition at line 231 of file ssd1306.cpp.
void ssd1306_drawHLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2 | ||
) |
Draws horizontal line
x1 | - left boundary in pixels |
y1 | - position Y in pixels |
x2 | - right boundary in pixels |
Definition at line 199 of file ssd1306.cpp.
void ssd1306_drawRect | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | x2, | ||
uint8_t | y2 | ||
) |
Draws rectangle
x1 | - left boundary in pixel units |
y1 | - top boundary in pixel units |
x2 | - right boundary in pixel units |
y2 | - bottom boundary int pixel units |
Definition at line 223 of file ssd1306.cpp.
void ssd1306_drawSprite | ( | SPRITE * | sprite | ) |
Draws sprite on the display. Position can be changed by updating x and y fields of SPRITE structure.
sprite | - pointer to SPRITE structure |
Definition at line 309 of file ssd1306.cpp.
void ssd1306_drawSpriteEx | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | w, | ||
const uint8_t * | sprite | ||
) |
Draws bitmap, located in Flash, on the display. This sprite must have wx8 size
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
w | - width in pixels |
sprite | - pointer to data, located in Flash: each byte represents 8 vertical pixels. |
Definition at line 296 of file ssd1306.cpp.
void ssd1306_drawVLine | ( | uint8_t | x1, |
uint8_t | y1, | ||
uint8_t | y2 | ||
) |
Draws vertical line
x1 | - position X in pixels |
y1 | - top boundary in pixels |
y2 | - bottom boundary in pixels |
Definition at line 210 of file ssd1306.cpp.
void ssd1306_eraseSprite | ( | SPRITE * | sprite | ) |
Clears sprite from the display leaving black rectangle.
sprite | - pointer to SPRITE structure |
Definition at line 338 of file ssd1306.cpp.
void ssd1306_eraseTrace | ( | SPRITE * | sprite | ) |
Clears some sprite parts in old position on the display.
sprite | - pointer to SPRITE structure |
Definition at line 362 of file ssd1306.cpp.
void ssd1306_fillScreen | ( | uint8_t | fill_Data | ) |
Fills screen with pattern byte
Definition at line 93 of file ssd1306.cpp.
void ssd1306_negativeMode | ( | ) |
All drawing functions start to work in negative mode. Old picture on the display remains unchanged.
Definition at line 421 of file ssd1306.cpp.
void ssd1306_positiveMode | ( | ) |
All drawing functions start to work in positive (default) mode. Old picture on the display remains unchanged.
Definition at line 426 of file ssd1306.cpp.
void ssd1306_putPixel | ( | uint8_t | x, |
uint8_t | y | ||
) |
Put single pixel on the LCD.
x | - horizontal position in pixels |
y | - vertical position in pixels |
Definition at line 181 of file ssd1306.cpp.
void ssd1306_putPixels | ( | uint8_t | x, |
uint8_t | y, | ||
uint8_t | pixels | ||
) |
Puts eight vertical pixels on the LCD at once.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
pixels | - bit-pixels to draw on display |
Definition at line 190 of file ssd1306.cpp.
void ssd1306_replaceSprite | ( | SPRITE * | sprite, |
const uint8_t * | data | ||
) |
Replaces image of the sprite with different data. The width must be the same as the width of original sprite image
sprite | - pointer to SPRITE structure |
data | - pointer to data, located in Flash: each byte represents 8 vertical pixels. |
Definition at line 406 of file ssd1306.cpp.
void ssd1306_sendData | ( | uint8_t | data | ) |
Sends byte data to SSD1306 controller memory. Performs 3 operations at once: ssd1306_dataStart(); ssd1306_sendByte( data ); ssd1306_endTransmission();
data | - byte to send to the controller memory |
Definition at line 86 of file ssd1306.cpp.
void ssd1306_setFont6x8 | ( | const uint8_t * | progmemFont | ) |
Function allows to set another font for the library. By default, the font supports only first 128 - 32 ascii chars. First 32 chars of ascii table are non-printable, and removed from the font table to reduce flash memory consumption. Default font doesn't support russian characters. Using this function you can implement your own fonts. First font char must be started with <space> image.
progmemFont | - font to setup located in Flash area |
Definition at line 176 of file ssd1306.cpp.
void ssd1306_setPos | ( | uint8_t | x, |
uint8_t | y | ||
) |
Set position in terms of display.
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
Definition at line 67 of file ssd1306.cpp.