SSD1306Ascii
Public Member Functions | List of all members
SSD1306Ascii Class Referenceabstract

SSD1306 base class. More...

#include <SSD1306Ascii.h>

Inheritance diagram for SSD1306Ascii:
Inheritance graph
[legend]
Collaboration diagram for SSD1306Ascii:
Collaboration graph
[legend]

Public Member Functions

uint8_t charWidth (uint8_t c)
 Determine the width of a character. More...
 
void clear ()
 Clear the display and set the cursor to (0, 0).
 
void clear (uint8_t c0, uint8_t c1, uint8_t r0, uint8_t r1)
 Clear a region of the display. More...
 
void clearToEOL ()
 Clear the display to the end of the current line. More...
 
uint8_t col ()
 
uint8_t displayHeight ()
 
uint8_t displayRows ()
 
uint8_t displayWidth ()
 
uint8_t fontHeight ()
 
uint8_t fontRows ()
 
uint8_t fontWidth ()
 
void home ()
 Set the cursor position to (0, 0).
 
void init (const DevType *dev)
 Initialize the display controller. More...
 
uint8_t magFactor ()
 
uint8_t row ()
 
void set1X ()
 Set the character magnification factor to one.
 
void set2X ()
 Set the character magnification factor to two.
 
void setCol (uint8_t col)
 Set the current column number. More...
 
void setContrast (uint8_t value)
 Set the display contrast. More...
 
void setCursor (uint8_t col, uint8_t row)
 Set the cursor position. More...
 
void setFont (const uint8_t *font)
 Set the current font. More...
 
void setRow (uint8_t row)
 Set the current row number. More...
 
void setScroll (bool enable)
 Enable or disable scroll mode. More...
 
void ssd1306WriteCmd (uint8_t c)
 Write a command byte to the display controller. More...
 
void ssd1306WriteRam (uint8_t c)
 Write a byte to RAM in the display controller. More...
 
void ssd1306WriteRamBuf (uint8_t c)
 Write a byte to RAM in the display controller. More...
 
size_t write (uint8_t c)
 Display a character. More...
 
size_t write (const char *s)
 Display a string. More...
 

Detailed Description

SSD1306 base class.

Member Function Documentation

uint8_t SSD1306Ascii::charWidth ( uint8_t  c)

Determine the width of a character.

Parameters
[in]cCharacter code.
Returns
Width of the character in pixels.
void SSD1306Ascii::clear ( uint8_t  c0,
uint8_t  c1,
uint8_t  r0,
uint8_t  r1 
)

Clear a region of the display.

Parameters
[in]c0Starting column.
[in]c1Ending column.
[in]r0Starting row;
[in]r1Ending row;
Note
The final cursor position will be (c0, r0).
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.
uint8_t SSD1306Ascii::col ( )
inline
Returns
The current column in pixels.
uint8_t SSD1306Ascii::displayHeight ( )
inline
Returns
The display hight in pixels.
uint8_t SSD1306Ascii::displayRows ( )
inline
Returns
The display height in rows with eight pixels to a row.
uint8_t SSD1306Ascii::displayWidth ( )
inline
Returns
The display width in pixels.
uint8_t SSD1306Ascii::fontHeight ( )
Returns
The current font height in pixels.
uint8_t SSD1306Ascii::fontRows ( )
inline
Returns
The number of eight pixel rows required to display a character in the current font.
uint8_t SSD1306Ascii::fontWidth ( )
Returns
The maximum width of characters in the current font.
void SSD1306Ascii::init ( const DevType dev)

Initialize the display controller.

Parameters
[in]devA display initialization structure.
uint8_t SSD1306Ascii::magFactor ( )
inline
Returns
The character magnification factor.
uint8_t SSD1306Ascii::row ( )
inline
Returns
the current row number with eight pixels to a row.
void SSD1306Ascii::setCol ( uint8_t  col)

Set the current column number.

Parameters
[in]colThe desired column number in pixels.
void SSD1306Ascii::setContrast ( uint8_t  value)

Set the display contrast.

Parameters
[in]valueThe contrast level in th range 0 to 255.
void SSD1306Ascii::setCursor ( uint8_t  col,
uint8_t  row 
)

Set the cursor position.

Parameters
[in]colThe column number in pixels.
[in]rowthe row number in eight pixel rows.
void SSD1306Ascii::setFont ( const uint8_t *  font)
inline

Set the current font.

Parameters
[in]fontPointer to a font table.
void SSD1306Ascii::setRow ( uint8_t  row)

Set the current row number.

Parameters
[in]rowthe row number in eight pixel rows.
void SSD1306Ascii::setScroll ( bool  enable)

Enable or disable scroll mode.

Parameters
[in]enabletrue 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.
void SSD1306Ascii::ssd1306WriteCmd ( uint8_t  c)
inline

Write a command byte to the display controller.

Parameters
[in]cThe command byte.
Note
The byte will immediately be sent to the controller.
void SSD1306Ascii::ssd1306WriteRam ( uint8_t  c)

Write a byte to RAM in the display controller.

Parameters
[in]cThe data byte.
Note
The byte will immediately be sent to the controller.
void SSD1306Ascii::ssd1306WriteRamBuf ( uint8_t  c)

Write a byte to RAM in the display controller.

Parameters
[in]cThe data byte.
Note
The byte may be buffered until a call to ssd1306WriteCmd or ssd1306WriteRam.
size_t SSD1306Ascii::write ( uint8_t  c)

Display a character.

Parameters
[in]cThe character to display.
Returns
the value one.
size_t SSD1306Ascii::write ( const char *  s)

Display a string.

Parameters
[in]sThe string to display.
Returns
The length of the string.

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