|
TR-mbed 1.0
|
#include <SSD1308.h>
Public Member Functions | |
| SSD1308 (mbed::I2C *i2c, uint8_t address=SSD1308_DEF_SA) | |
| Constructor. | |
| void | initialize () |
| High level Init, most settings remain at Power-On reset value. | |
| void | clearDisplay () |
| clear the display | |
| void | fillDisplay (uint8_t pattern=0x00, uint8_t start_page=0, uint8_t end_page=MAX_PAGE, uint8_t start_col=0, uint8_t end_col=MAX_COL) |
| fill the display | |
| void | writeBitmap (uint8_t *data, uint8_t start_page=0, uint8_t end_page=MAX_PAGE, uint8_t start_col=0, uint8_t end_col=MAX_COL) |
| write a bitmap to the display | |
| void | writeProgressBar (uint8_t page, uint8_t col, int percentage) |
| write a level meter to the display, Width is (PRG_MAX_SCALE + 2) pixels | |
| void | writeLevelBar (uint8_t page, uint8_t col, int percentage) |
| write a level meter to the display, Width is (PRG_MAX_SCALE + 2) pixels | |
| void | setInverted (bool inverted) |
| int | writeChar (char chr) |
| Write single character to the display using the 8x8 fontable. | |
| void | writeBigChar (uint8_t row, uint8_t col, char chr) |
| Write large character (16x24 font) | |
| void | writeString (uint8_t row, uint8_t col, const char *txt) |
| Write a string to the display using the 8x8 font. | |
| virtual int | _putc (int value) |
| virtual int | _getc () |
| void | setHorizontalAddressingMode () |
| Set Horizontal Addressing Mode (cursor incr left-to-right, top-to-bottom) | |
| void | setVerticalAddressingMode () |
| Set Vertical Addressing Mode (cursor incr top-to-bottom, left-to-right) | |
| void | setPageAddressingMode () |
| Set Page Addressing Mode (cursor incr left-to-right) | |
| void | setMemoryAddressingMode (uint8_t mode) |
| Set Addressing Mode. | |
| void | setColumnStartForPageAddressingMode (uint8_t column) |
| Set Column Start (for Page Addressing Mode only) | |
| void | setPageStartForPageAddressingMode (uint8_t page) |
| Set Page Start (for Page Addressing Mode only) | |
| void | setColumnAddress (uint8_t start, uint8_t end) |
| void | setPageAddress (uint8_t start, uint8_t end) |
| void | setDisplayStartLine (uint8_t line) |
| Set Display StartLine, takes one byte, 0x00-0x3F. | |
| void | setContrastControl (uint8_t contrast) |
| Set Contrast. | |
| void | setEntireDisplayOn () |
| Shows All Pixels On. | |
| void | setEntireDisplayRAM () |
| Shows Pixels as RAM content. | |
| void | setEntireDisplay (bool on) |
| Shows Pixels On or as RAM content. | |
| void | setMultiplexRatio (uint8_t lines) |
| void | setInternalIref () |
| Sets Internal Iref. | |
| void | setExternalIref () |
| Sets External Iref (default) | |
| void | setDisplayOn () |
| Enable Display. | |
| void | setDisplayOff () |
| Disable Display. | |
| void | setDisplayPower (bool on) |
| Enable or Disable Display. | |
| void | setDisplayNormal () |
| Show White pixels on Black background. | |
| void | setDisplayInverse () |
| Show Black pixels on White background. | |
| void | setDisplayBlink (bool on) |
| Blink display by fading in and out over a set number of frames. | |
| void | setDisplayFade (bool on) |
| Fade out display in set number of frames. | |
| void | setDisplayFlip (bool left, bool down) |
| Display Flip (Left/Right, Up/Down) | |
| void | setDisplayOffset (uint8_t offset) |
| void | setDisplayClock (uint8_t divideRatio, uint8_t oscFreq) |
| void | setPrechargePeriod (uint8_t phase1, uint8_t phase2) |
| void | setVcomhDeselectLevel (uint8_t level) |
| void | nop () |
| void | setContinuousHorizontalScroll (bool left, uint8_t start_page, uint8_t end_page, uint8_t interval) |
| Horizontal scroll by one column per interval. | |
| void | setContinuousVerticalAndHorizontalScroll (bool left, uint8_t start_page, uint8_t end_page, uint8_t offset, uint8_t interval) |
| Horizontal and Vertical scroll by one column per interval. | |
| void | setDisplayScroll (bool on) |
| Activate or Deactivate Horizontal and Vertical scroll. | |
| void | setVerticalScrollArea (uint8_t topRowsFixed, uint8_t scrollRows) |
| Set Vertical scroll area. | |
Class to control an SSD1308 based oled Display
Example:
| SSD1308::SSD1308 | ( | mbed::I2C * | i2c, |
| uint8_t | address = SSD1308_DEF_SA |
||
| ) |
Constructor.
| I2C | &i2c reference to i2c, |
| uint8_t | deviceAddress slaveaddress (8bit to use for the controller (0x78 by default, assumes D/C# (pin 13) grounded) |
| I2C | *i2c reference to i2c |
| uint8_t | deviceAddress slaveaddress |
|
inlinevirtual |
| void SSD1308::clearDisplay | ( | ) |
clear the display
| void SSD1308::fillDisplay | ( | uint8_t | pattern = 0x00, |
| uint8_t | start_page = 0, |
||
| uint8_t | end_page = MAX_PAGE, |
||
| uint8_t | start_col = 0, |
||
| uint8_t | end_col = MAX_COL |
||
| ) |
fill the display
| uint8_t | pattern fillpattern vertical patch or 8 bits |
| uint8_t | start_page begin page (0..MAX_PAGE) |
| uint8_t | end_page end page (start_page..MAX_PAGE) |
| uint8_t | start_col begin column (0..MAX_COL) |
| uint8_t | end_col end column (start_col..MAX_COL) |
| void SSD1308::initialize | ( | ) |
High level Init, most settings remain at Power-On reset value.
| void SSD1308::nop | ( | ) |
| void SSD1308::setColumnAddress | ( | uint8_t | start, |
| uint8_t | end | ||
| ) |
| uint8_t | start startcolumn (valid range 0..MAX_COL) |
| uint8_t | end endcolumn (valid range start..MAX_COL) |
| void SSD1308::setColumnStartForPageAddressingMode | ( | uint8_t | column | ) |
Set Column Start (for Page Addressing Mode only)
| uint8_t | column column start (valid range 0..MAX_COLS) |
| uint8_t | column column start (valid range 0..MAX_COL) |
| void SSD1308::setContinuousHorizontalScroll | ( | bool | left, |
| uint8_t | start_page, | ||
| uint8_t | end_page, | ||
| uint8_t | interval | ||
| ) |
Horizontal scroll by one column per interval.
| bool | left select Left/Right scroll |
| uint8_t | start_page begin page (0..MAX_PAGE) |
| uint8_t | end_page end page (start_page..MAX_PAGE) |
| uint8_t | interval scroll interval in frames (see codes above) |
| void SSD1308::setContinuousVerticalAndHorizontalScroll | ( | bool | left, |
| uint8_t | start_page, | ||
| uint8_t | end_page, | ||
| uint8_t | offset, | ||
| uint8_t | interval | ||
| ) |
Horizontal and Vertical scroll by one column per interval.
| bool | left select Left/Right scroll |
| uint8_t | start_page begin page (0..MAX_PAGE) |
| uint8_t | end_page end page (start_page..MAX_PAGE) |
| uint8_t | offset vert offset (0x01..0x63) |
| uint8_t | interval scroll interval in frames (see codes above) |
| void SSD1308::setContrastControl | ( | uint8_t | contrast | ) |
Set Contrast.
| uint8_t | contrast (valid range 0x00 (lowest) - 0xFF (highest)) |
| void SSD1308::setDisplayBlink | ( | bool | on | ) |
Blink display by fading in and out over a set number of frames.
| bool | on |
| void SSD1308::setDisplayClock | ( | uint8_t | divideRatio, |
| uint8_t | oscFreq | ||
| ) |
| void SSD1308::setDisplayFade | ( | bool | on | ) |
Fade out display in set number of frames.
| bool | on |
| void SSD1308::setDisplayFlip | ( | bool | left, |
| bool | down | ||
| ) |
Display Flip (Left/Right, Up/Down)
| bool | left flip Left/Right |
| bool | down flip Up/Down |
| void SSD1308::setDisplayInverse | ( | ) |
Show Black pixels on White background.
| void SSD1308::setDisplayNormal | ( | ) |
Show White pixels on Black background.
| void SSD1308::setDisplayOff | ( | ) |
Disable Display.
| void SSD1308::setDisplayOffset | ( | uint8_t | offset | ) |
| void SSD1308::setDisplayOn | ( | ) |
Enable Display.
| void SSD1308::setDisplayPower | ( | bool | on | ) |
Enable or Disable Display.
| bool | on |
| void SSD1308::setDisplayScroll | ( | bool | on | ) |
Activate or Deactivate Horizontal and Vertical scroll.
Note: after deactivating scrolling, the RAM data needs to be rewritten
| bool | on activate scroll |
| void SSD1308::setDisplayStartLine | ( | uint8_t | line | ) |
Set Display StartLine, takes one byte, 0x00-0x3F.
| uint8_t | line startline (valid range 0..MAX_ROWS) |
| void SSD1308::setEntireDisplay | ( | bool | on | ) |
Shows Pixels On or as RAM content.
| bool | on (true is All on, false is RAM content) |
| void SSD1308::setEntireDisplayOn | ( | ) |
Shows All Pixels On.
| void SSD1308::setEntireDisplayRAM | ( | ) |
Shows Pixels as RAM content.
| void SSD1308::setExternalIref | ( | ) |
Sets External Iref (default)
| void SSD1308::setHorizontalAddressingMode | ( | ) |
Set Horizontal Addressing Mode (cursor incr left-to-right, top-to-bottom)
| void SSD1308::setInternalIref | ( | ) |
Sets Internal Iref.
|
inline |
| void SSD1308::setMemoryAddressingMode | ( | uint8_t | mode | ) |
Set Addressing Mode.
| uint8_t | mode |
| void SSD1308::setMultiplexRatio | ( | uint8_t | lines | ) |
| void SSD1308::setPageAddress | ( | uint8_t | start, |
| uint8_t | end | ||
| ) |
| uint8_t | start startpage (valid range 0..MAX_PAGE) |
| uint8_t | end endpage (valid range start..MAX_PAGE) |
| void SSD1308::setPageAddressingMode | ( | ) |
Set Page Addressing Mode (cursor incr left-to-right)
| void SSD1308::setPageStartForPageAddressingMode | ( | uint8_t | page | ) |
Set Page Start (for Page Addressing Mode only)
| uint8_t | page page start (valid range PAGE0 - PAGE7) |
| void SSD1308::setPrechargePeriod | ( | uint8_t | phase1, |
| uint8_t | phase2 | ||
| ) |
| void SSD1308::setVcomhDeselectLevel | ( | uint8_t | level | ) |
| void SSD1308::setVerticalAddressingMode | ( | ) |
Set Vertical Addressing Mode (cursor incr top-to-bottom, left-to-right)
| void SSD1308::setVerticalScrollArea | ( | uint8_t | topRowsFixed, |
| uint8_t | scrollRows | ||
| ) |
Set Vertical scroll area.
| uint8_t | topRowsFixed fixed rows (0..MAX_ROW) |
| uint8_t | scrollRowsoffset scroll rows (topRowsFixed..MAX_ROW) |
| uint8_t | topRowsFixed fixed rows (0..MAX_ROW) |
| uint8_t | scrollRowsoffset scroll rows (topRowsFixed..ROWS) |
| void SSD1308::writeBigChar | ( | uint8_t | row, |
| uint8_t | col, | ||
| char | chr | ||
| ) |
Write large character (16x24 font)
| uint8_t | row row number (0...MAX_ROW) |
| uint8_t | col column number (0...MAX_COL) |
| char | chr Used for displaying numbers 0 - 9 and '+', '-', '.' |
| void SSD1308::writeBitmap | ( | uint8_t * | data, |
| uint8_t | start_page = 0, |
||
| uint8_t | end_page = MAX_PAGE, |
||
| uint8_t | start_col = 0, |
||
| uint8_t | end_col = MAX_COL |
||
| ) |
write a bitmap to the display
| uint8_t* | data pointer to bitmap |
| uint8_t | start_page begin page (0..MAX_PAGE) |
| uint8_t | end_page end page (start_page..MAX_PAGE) |
| uint8_t | start_col begin column (0..MAX_COL) |
| uint8_t | end_col end column (start_col..MAX_COL) |
| int SSD1308::writeChar | ( | char | chr | ) |
Write single character to the display using the 8x8 fontable.
Start at current cursor location
| char | chr character to write |
| void SSD1308::writeLevelBar | ( | uint8_t | page, |
| uint8_t | col, | ||
| int | percentage | ||
| ) |
write a level meter to the display, Width is (PRG_MAX_SCALE + 2) pixels
| uint8_t | page begin page (0..MAX_PAGE) |
| uint8_t | col begin column (0..MAX_COL) |
| int | percentage value (0..100) |
| void SSD1308::writeProgressBar | ( | uint8_t | page, |
| uint8_t | col, | ||
| int | percentage | ||
| ) |
write a level meter to the display, Width is (PRG_MAX_SCALE + 2) pixels
| uint8_t | page begin page (0..MAX_PAGE) |
| uint8_t | col begin column (0..MAX_COL) |
| int | percentage value (0..100) |
| void SSD1308::writeString | ( | uint8_t | row, |
| uint8_t | col, | ||
| const char * | text | ||
| ) |
Write a string to the display using the 8x8 font.
Start at selected cursor location, text will wrap around until it is done
| uint8_t | row row number (0...ROWS/FONT_HEIGHT) |
| uint8_t | col column number (0...COLUMNS/FONT_WIDTH) |
| const | char * text pointer to text |