SSD1306 base class.
More...
#include <SSD1306Ascii.h>
◆ charWidth()
uint8_t SSD1306Ascii::charWidth |
( |
uint8_t |
c | ) |
|
Determine the width of a character.
- Parameters
-
- Returns
- Width of the character in pixels.
◆ clear()
void SSD1306Ascii::clear |
( |
uint8_t |
c0, |
|
|
uint8_t |
c1, |
|
|
uint8_t |
r0, |
|
|
uint8_t |
r1 |
|
) |
| |
Clear a region of the display.
- Parameters
-
[in] | c0 | Starting column. |
[in] | c1 | Ending column. |
[in] | r0 | Starting row; |
[in] | r1 | Ending row; |
- Note
- The final cursor position will be (c0, r0).
◆ clearField()
void SSD1306Ascii::clearField |
( |
uint8_t |
col, |
|
|
uint8_t |
row, |
|
|
uint8_t |
n |
|
) |
| |
Clear a field of n fieldWidth() characters.
- Parameters
-
[in] | col | Field start column.
|
[in] | row | Field start row.
|
[in] | n | Number of characters in the field. |
◆ clearToEOL()
void SSD1306Ascii::clearToEOL |
( |
| ) |
|
Clear the display to the end of the current line.
- Note
- The number of rows cleared will be determined by the height of the current font.
-
The cursor will be returned to the original position.
◆ col()
uint8_t SSD1306Ascii::col |
( |
| ) |
|
|
inline |
- Returns
- The current column in pixels.
◆ displayHeight()
uint8_t SSD1306Ascii::displayHeight |
( |
| ) |
|
|
inline |
- Returns
- The display hight in pixels.
◆ displayRemap()
void SSD1306Ascii::displayRemap |
( |
bool |
mode | ) |
|
Set display to normal or 180 degree remap mode.
- Parameters
-
[in] | mode | true for normal mode, false for remap mode. |
- Note
- Adafruit and many ebay displays use remap mode. Use normal mode to rotate these displays 180 degrees.
◆ displayRows()
uint8_t SSD1306Ascii::displayRows |
( |
| ) |
|
|
inline |
- Returns
- The display height in rows with eight pixels to a row.
◆ displayWidth()
uint8_t SSD1306Ascii::displayWidth |
( |
| ) |
|
|
inline |
- Returns
- The display width in pixels.
◆ fieldWidth()
size_t SSD1306Ascii::fieldWidth |
( |
uint8_t |
n | ) |
|
Width of a field in pixels.
- Parameters
-
[in] | n | Number of characters in the field. |
- Returns
- Width of the field.
◆ font()
const uint8_t* SSD1306Ascii::font |
( |
| ) |
|
|
inline |
- Returns
- The current font pointer.
◆ fontCharCount()
uint8_t SSD1306Ascii::fontCharCount |
( |
| ) |
|
- Returns
- The count of characters in a font.
◆ fontFirstChar()
char SSD1306Ascii::fontFirstChar |
( |
| ) |
|
- Returns
- The first character in a font.
◆ fontHeight()
uint8_t SSD1306Ascii::fontHeight |
( |
| ) |
|
- Returns
- The current font height in pixels.
◆ fontRows()
uint8_t SSD1306Ascii::fontRows |
( |
| ) |
|
|
inline |
- Returns
- The number of eight pixel rows required to display a character in the current font.
◆ fontWidth()
uint8_t SSD1306Ascii::fontWidth |
( |
| ) |
|
- Returns
- The maximum width of characters in the current font.
◆ init()
void SSD1306Ascii::init |
( |
const DevType * |
dev | ) |
|
Initialize the display controller.
- Parameters
-
[in] | dev | A display initialization structure. |
◆ letterSpacing()
uint8_t SSD1306Ascii::letterSpacing |
( |
| ) |
|
|
inline |
- Returns
- letter-spacing in pixels with magnification factor.
◆ magFactor()
uint8_t SSD1306Ascii::magFactor |
( |
| ) |
|
|
inline |
- Returns
- The character magnification factor.
◆ row()
uint8_t SSD1306Ascii::row |
( |
| ) |
|
|
inline |
- Returns
- the current row number with eight pixels to a row.
◆ setCol()
void SSD1306Ascii::setCol |
( |
uint8_t |
col | ) |
|
Set the current column number.
- Parameters
-
[in] | col | The desired column number in pixels. |
◆ setContrast()
void SSD1306Ascii::setContrast |
( |
uint8_t |
value | ) |
|
Set the display contrast.
- Parameters
-
[in] | value | The contrast level in th range 0 to 255. |
◆ setCursor()
void SSD1306Ascii::setCursor |
( |
uint8_t |
col, |
|
|
uint8_t |
row |
|
) |
| |
Set the cursor position.
- Parameters
-
[in] | col | The column number in pixels. |
[in] | row | the row number in eight pixel rows. |
◆ setFont()
void SSD1306Ascii::setFont |
( |
const uint8_t * |
font | ) |
|
Set the current font.
- Parameters
-
[in] | font | Pointer to a font table. |
◆ setLetterSpacing()
void SSD1306Ascii::setLetterSpacing |
( |
uint8_t |
pixels | ) |
|
|
inline |
Set letter-spacing. setFont() will restore default letter-spacing.
- Parameters
-
[in] | pixels | letter-spacing in pixels before magnification. |
◆ setRow()
void SSD1306Ascii::setRow |
( |
uint8_t |
row | ) |
|
Set the current row number.
- Parameters
-
[in] | row | the row number in eight pixel rows. |
◆ setScroll()
void SSD1306Ascii::setScroll |
( |
bool |
enable | ) |
|
Enable or disable scroll mode.
- Parameters
-
[in] | enable | true enable scroll on new line false disable scroll. |
- Note
- Scroll mode is only supported on 64 pixel high displays. Using setRow() or setCursor() will be unpredictable in scroll mode. You must use a font with an integral number of line on the display.
◆ ssd1306WriteCmd()
void SSD1306Ascii::ssd1306WriteCmd |
( |
uint8_t |
c | ) |
|
|
inline |
Write a command byte to the display controller.
- Parameters
-
- Note
- The byte will immediately be sent to the controller.
◆ ssd1306WriteRam()
void SSD1306Ascii::ssd1306WriteRam |
( |
uint8_t |
c | ) |
|
Write a byte to RAM in the display controller.
- Parameters
-
- Note
- The byte will immediately be sent to the controller.
◆ ssd1306WriteRamBuf()
void SSD1306Ascii::ssd1306WriteRamBuf |
( |
uint8_t |
c | ) |
|
Write a byte to RAM in the display controller.
- Parameters
-
- Note
- The byte may be buffered until a call to ssd1306WriteCmd or ssd1306WriteRam.
◆ strWidth()
size_t SSD1306Ascii::strWidth |
( |
const char * |
str | ) |
|
- Parameters
-
[in] | str | The pointer to string. |
- Returns
- the width of the string in pixels.
◆ write() [1/2]
size_t SSD1306Ascii::write |
( |
uint8_t |
c | ) |
|
Display a character.
- Parameters
-
[in] | c | The character to display. |
- Returns
- the value one.
◆ write() [2/2]
size_t SSD1306Ascii::write |
( |
const char * |
s | ) |
|
Display a string.
- Parameters
-
[in] | s | The string to display. |
- Returns
- The length of the string.
The documentation for this class was generated from the following files:
- Arduino/libraries/SSD1306Ascii/src/SSD1306Ascii.h
- Arduino/libraries/SSD1306Ascii/src/SSD1306Ascii.cpp