#include <tiny_ssd1306.h>
|
| TinySSD1306 (InitFunction lcd) |
|
void | begin () |
|
void | beginI2C (int8_t scl=-1, int8_t sda=-1, uint8_t addr=0) |
|
void | beginI2CEmbedded (int8_t scl=-1, int8_t sda=-1, uint8_t addr=0) |
|
void | beginI2CWire (int8_t scl=-1, int8_t sda=-1, uint8_t addr=0) |
|
void | beginSPI (int8_t csPin=-1, int8_t dcPin=-1) |
| Initializes default custom spi interface and lcd display. More...
|
|
void | off () |
|
void | on () |
|
void | invertMode () |
|
void | normalMode () |
|
uint8_t | height () |
|
uint8_t | width () |
|
void | setCursor (uint8_t x, uint8_t y) |
|
void | fill (uint8_t fill_Data) |
|
void | clear () |
|
void | negativeMode () |
|
void | positiveMode () |
|
uint8_t | charF6x8 (uint8_t x, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) |
|
uint8_t | charF12x16 (uint8_t xpos, uint8_t y, const char ch[], EFontStyle style=STYLE_NORMAL) |
|
uint8_t | charF6x8_eol (uint8_t left, uint8_t y, const char ch[], EFontStyle style, uint8_t right) |
|
void | putPixel (uint8_t x, uint8_t y) |
|
void | putPixels (uint8_t x, uint8_t y, uint8_t pixels) |
|
void | drawRect (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) |
|
void | drawHLine (uint8_t x1, uint8_t y1, uint8_t x2) |
|
void | drawVLine (uint8_t x1, uint8_t y1, uint8_t y2) |
|
void | drawBuffer (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf) |
|
void | drawBitmap (uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *buf) |
|
void | clearBlock (uint8_t x, uint8_t y, uint8_t w, uint8_t h) |
|
virtual size_t | write (uint8_t ch) |
|
TinySSD1306 represents object to work with LCD display. Easy to use:
void setup()
{
lcd.beginI2C();
lcd.clear();
lcd.charF6x8(0,0,"Hello");
}
Definition at line 62 of file tiny_ssd1306.h.
void TinySSD1306::begin |
( |
| ) |
|
|
inline |
Initializes lcd display. SPI or i2c interface should be initializes prior to calling this method.
Definition at line 77 of file tiny_ssd1306.h.
void TinySSD1306::beginI2C |
( |
int8_t |
scl = -1 , |
|
|
int8_t |
sda = -1 , |
|
|
uint8_t |
addr = 0 |
|
) |
| |
|
inline |
Initializes default custom i2c interface and lcd display. Refer to ssd1306_i2cInitEx() for details.
- Parameters
-
scl | - i2c clock pin. Use -1 if you don't need to change default pin number |
sda | - i2c data pin. Use -1 if you don't need to change default pin number |
addr | - i2c address of lcd display. Use 0 to leave default |
- See also
- ssd1306_i2cInitEx()
Definition at line 91 of file tiny_ssd1306.h.
void TinySSD1306::beginI2CEmbedded |
( |
int8_t |
scl = -1 , |
|
|
int8_t |
sda = -1 , |
|
|
uint8_t |
addr = 0 |
|
) |
| |
|
inline |
Initializes i2c Wire library interface and lcd display. Refer to ssd1306_i2cInit_Embedded() for details. This API is available only if Wire library is supported for selected board.
- Parameters
-
scl | - i2c clock pin. Use -1 if you don't need to change default pin number |
sda | - i2c data pin. Use -1 if you don't need to change default pin number |
addr | - i2c address of lcd display. Use 0 to leave default |
- See also
- ssd1306_i2cInit_Embedded()
Definition at line 108 of file tiny_ssd1306.h.
void TinySSD1306::beginI2CWire |
( |
int8_t |
scl = -1 , |
|
|
int8_t |
sda = -1 , |
|
|
uint8_t |
addr = 0 |
|
) |
| |
|
inline |
Initializes i2c Wire library interface and lcd display. Refer to beginI2CWire() for details. This API is available only if embedded i2c is supported for selected board.
- Parameters
-
scl | - i2c clock pin. Use -1 if you don't need to change default pin number |
sda | - i2c data pin. Use -1 if you don't need to change default pin number |
addr | - i2c address of lcd display. Use 0 to leave default |
- See also
- beginI2CWire()
Definition at line 126 of file tiny_ssd1306.h.
void TinySSD1306::beginSPI |
( |
int8_t |
csPin = -1 , |
|
|
int8_t |
dcPin = -1 |
|
) |
| |
|
inline |
Initializes default custom spi interface and lcd display.
Initializes default custom i2c interface and lcd display.
- Parameters
-
csPin | - chip enable pin to LCD slave (-1 if not used) |
dcPin | - data/command pin to control LCD dc (required) |
Definition at line 141 of file tiny_ssd1306.h.
uint8_t TinySSD1306::charF12x16 |
( |
uint8_t |
xpos, |
|
|
uint8_t |
y, |
|
|
const char |
ch[], |
|
|
EFontStyle |
style = STYLE_NORMAL |
|
) |
| |
|
inline |
Prints text to screen using double size font 12x16.
- Parameters
-
xpos | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
ch | - NULL-terminated string to print |
style | - font style (EFontStyle). |
- Returns
- number of chars in string
Definition at line 262 of file tiny_ssd1306.h.
uint8_t TinySSD1306::charF6x8 |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
const char |
ch[], |
|
|
EFontStyle |
style = STYLE_NORMAL |
|
) |
| |
|
inline |
Prints text to screen using font 6x8.
- Parameters
-
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. |
- Returns
- number of chars in string
Definition at line 247 of file tiny_ssd1306.h.
uint8_t TinySSD1306::charF6x8_eol |
( |
uint8_t |
left, |
|
|
uint8_t |
y, |
|
|
const char |
ch[], |
|
|
EFontStyle |
style, |
|
|
uint8_t |
right |
|
) |
| |
|
inline |
Prints text to screen using set font. If real text ends before right boundary, the remaining part on the display will be erased till right boundary.
- Parameters
-
left | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
ch | - NULL-terminated string to print |
style | - font style (EFontStyle), normal by default. |
right | - right boundary of the text to output |
- Returns
- number of chars in string
Definition at line 282 of file tiny_ssd1306.h.
void TinySSD1306::clear |
( |
| ) |
|
Fills screen with zero-byte
void TinySSD1306::clearBlock |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
w, |
|
|
uint8_t |
h |
|
) |
| |
|
inline |
Fills block with black pixels
- Parameters
-
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) |
- Note
- usually this method is used to erase bitmap on the screen.
Definition at line 403 of file tiny_ssd1306.h.
void TinySSD1306::drawBitmap |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
w, |
|
|
uint8_t |
h, |
|
|
const uint8_t * |
buf |
|
) |
| |
|
inline |
Draws bitmap, located in Flash, on the display
- Parameters
-
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 390 of file tiny_ssd1306.h.
void TinySSD1306::drawBuffer |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
w, |
|
|
uint8_t |
h, |
|
|
const uint8_t * |
buf |
|
) |
| |
|
inline |
Draws bitmap, located in SRAM, on the display Each byte represents 8 vertical pixels.
uint8_t buffer[3] = { 0xFF, 0x81, 0xFF };
lcd.drawBuffer(10, 1, 3, 8, buffer);
- Parameters
-
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 376 of file tiny_ssd1306.h.
void TinySSD1306::drawHLine |
( |
uint8_t |
x1, |
|
|
uint8_t |
y1, |
|
|
uint8_t |
x2 |
|
) |
| |
|
inline |
Draws horizontal line
- Parameters
-
x1 | - left boundary in pixels |
y1 | - position Y in pixels |
x2 | - right boundary in pixels |
Definition at line 344 of file tiny_ssd1306.h.
void TinySSD1306::drawRect |
( |
uint8_t |
x1, |
|
|
uint8_t |
y1, |
|
|
uint8_t |
x2, |
|
|
uint8_t |
y2 |
|
) |
| |
|
inline |
Draws rectangle
- Parameters
-
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 333 of file tiny_ssd1306.h.
void TinySSD1306::drawVLine |
( |
uint8_t |
x1, |
|
|
uint8_t |
y1, |
|
|
uint8_t |
y2 |
|
) |
| |
|
inline |
Draws vertical line
- Parameters
-
x1 | - position X in pixels |
y1 | - top boundary in pixels |
y2 | - bottom boundary in pixels |
Definition at line 355 of file tiny_ssd1306.h.
void TinySSD1306::fill |
( |
uint8_t |
fill_Data | ) |
|
|
inline |
Fills screen with pattern byte.
- Parameters
-
fill_Data | - pattern to fill display with. |
Definition at line 211 of file tiny_ssd1306.h.
uint8_t TinySSD1306::height |
( |
| ) |
|
|
inline |
void TinySSD1306::invertMode |
( |
| ) |
|
|
inline |
Switches display to inverse mode. LCD will display 0-pixels as white, and 1-pixels as black.
Definition at line 167 of file tiny_ssd1306.h.
void TinySSD1306::negativeMode |
( |
| ) |
|
|
inline |
All drawing functions start to work in negative mode. Old picture on the display remains unchanged.
Definition at line 225 of file tiny_ssd1306.h.
void TinySSD1306::normalMode |
( |
| ) |
|
|
inline |
void TinySSD1306::off |
( |
| ) |
|
|
inline |
void TinySSD1306::positiveMode |
( |
| ) |
|
|
inline |
All drawing functions start to work in positive (default) mode. Old picture on the display remains unchanged.
Definition at line 234 of file tiny_ssd1306.h.
void TinySSD1306::putPixel |
( |
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
|
inline |
Put single pixel on the LCD.
- Warning
- Please, take into account that there is no way to read data from ssd1306, thus since each byte contains 8 pixels, all other pixels in the same byte will be cleared on the display. Use TinySSD1306::putPixels() instead. If you need to have buffered output, please, refer to NanoCanvas.
- Parameters
-
x | - horizontal position in pixels |
y | - vertical position in pixels |
Definition at line 302 of file tiny_ssd1306.h.
void TinySSD1306::putPixels |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
pixels |
|
) |
| |
|
inline |
Puts eight vertical pixels on the LCD at once.
lcd.putPixels(10,2,0xFF);
lcd.putPixels(32,3,0x0F);
- Parameters
-
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
pixels | - bit-pixels to draw on display |
Definition at line 321 of file tiny_ssd1306.h.
void TinySSD1306::setCursor |
( |
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
|
inline |
Sets position in terms of display for text output (Print class).
- Parameters
-
x | - horizontal position in pixels |
y | - vertical position in blocks (pixels/8) |
Definition at line 201 of file tiny_ssd1306.h.
uint8_t TinySSD1306::width |
( |
| ) |
|
|
inline |
virtual size_t TinySSD1306::write |
( |
uint8_t |
ch | ) |
|
|
virtual |
Writes single character to the display
- Parameters
-
The documentation for this class was generated from the following file: