MicroView Arduino Library - MicroView Class Reference


MicroView Class Reference
Inheritance diagram for MicroView:

Public Member Functions

void begin (void)
 Initialisation of MicroView Library. More...
 
void end (void)
 Power off the OLED display. More...
 
virtual size_t write (uint8_t)
 Override Arduino's Print. More...
 
void command (uint8_t c)
 Send 1 command byte. More...
 
void command (uint8_t c1, uint8_t c2)
 Send 2 command bytes. More...
 
void command (uint8_t c1, uint8_t c2, uint8_t c3)
 Send 3 command bytes. More...
 
void data (uint8_t c)
 SPI data. More...
 
void setColumnAddress (uint8_t add)
 Set SSD1306 column address. More...
 
void setPageAddress (uint8_t add)
 Set SSD1306 page address. More...
 
void clear (uint8_t mode)
 Clear screen buffer or SSD1306's memory. More...
 
void clear (uint8_t mode, uint8_t c)
 Clear or replace screen buffer or SSD1306's memory with a character. More...
 
void invert (boolean inv)
 Invert display. More...
 
void contrast (uint8_t contrast)
 Set contrast. More...
 
void display (void)
 Transfer display memory. More...
 
void setCursor (uint8_t x, uint8_t y)
 Set cursor position. More...
 
void pixel (uint8_t x, uint8_t y)
 Draw pixel. More...
 
void pixel (uint8_t x, uint8_t y, uint8_t color, uint8_t mode)
 Draw pixel with color and mode. More...
 
void line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1)
 Draw line. More...
 
void line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode)
 Draw line with color and mode. More...
 
void lineH (uint8_t x, uint8_t y, uint8_t width)
 Draw horizontal line. More...
 
void lineH (uint8_t x, uint8_t y, uint8_t width, uint8_t color, uint8_t mode)
 Draw horizontal line with color and mode. More...
 
void lineV (uint8_t x, uint8_t y, uint8_t height)
 Draw vertical line. More...
 
void lineV (uint8_t x, uint8_t y, uint8_t height, uint8_t color, uint8_t mode)
 Draw vertical line with color and mode. More...
 
void rect (uint8_t x, uint8_t y, uint8_t width, uint8_t height)
 Draw rectangle. More...
 
void rect (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode)
 Draw rectangle with color and mode. More...
 
void rectFill (uint8_t x, uint8_t y, uint8_t width, uint8_t height)
 Draw filled rectangle. More...
 
void rectFill (uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode)
 Draw filled rectangle with color and mode. More...
 
void circle (uint8_t x, uint8_t y, uint8_t radius)
 Draw circle. More...
 
void circle (uint8_t x, uint8_t y, uint8_t radius, uint8_t color, uint8_t mode)
 Draw circle with color and mode. More...
 
void circleFill (uint8_t x0, uint8_t y0, uint8_t radius)
 Draw filled circle. More...
 
void circleFill (uint8_t x0, uint8_t y0, uint8_t radius, uint8_t color, uint8_t mode)
 Draw filled circle with color and mode. More...
 
void drawChar (uint8_t x, uint8_t y, uint8_t c)
 Draw character. More...
 
void drawChar (uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode)
 Draw character with color and mode. More...
 
void drawBitmap (void)
 
uint8_t getLCDWidth (void)
 Get LCD width. More...
 
uint8_t getLCDHeight (void)
 Get LCD height. More...
 
void setColor (uint8_t color)
 Set color. More...
 
void setDrawMode (uint8_t mode)
 Set draw mode. More...
 
uint8_t * getScreenBuffer (void)
 Get pointer to screen buffer. More...
 
uint8_t getFontWidth (void)
 Get font width. More...
 
uint8_t getFontHeight (void)
 Get font height. More...
 
uint8_t getTotalFonts (void)
 Get total fonts. More...
 
uint8_t getFontType (void)
 Get font type. More...
 
uint8_t setFontType (uint8_t type)
 Set font type. More...
 
uint8_t getFontStartChar (void)
 Get font starting character. More...
 
uint8_t getFontTotalChar (void)
 Get font total characters. More...
 
void scrollRight (uint8_t start, uint8_t stop)
 Right scrolling. More...
 
void scrollLeft (uint8_t start, uint8_t stop)
 Left scrolling. More...
 
void scrollVertRight (uint8_t start, uint8_t stop)
 
void scrollVertLeft (uint8_t start, uint8_t stop)
 
void scrollStop (void)
 Stop scrolling. More...
 
void flipVertical (boolean flip)
 Vertical flip. More...
 
void flipHorizontal (boolean flip)
 Horizontal flip. More...
 
void checkComm (void)
 Listen for serial command. More...
 
void doCmd (uint8_t index)
 Parse command. More...
 

Member Function Documentation

void MicroView::begin ( void  )

Initialisation of MicroView Library.

Setup IO pins for SPI port then send initialisation commands to the SSD1306 controller inside the OLED.

void MicroView::checkComm ( void  )

Listen for serial command.

Instruct the MicroView to check for serial command from the UART.

void MicroView::circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius 
)

Draw circle.

Draw circle with radius using current fore color and current draw mode at x,y of the screen buffer.

void MicroView::circle ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  color,
uint8_t  mode 
)

Draw circle with color and mode.

Draw circle with radius using color and mode at x,y of the screen buffer.

void MicroView::circleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius 
)

Draw filled circle.

Draw filled circle with radius using current fore color and current draw mode at x,y of the screen buffer.

void MicroView::circleFill ( uint8_t  x0,
uint8_t  y0,
uint8_t  radius,
uint8_t  color,
uint8_t  mode 
)

Draw filled circle with color and mode.

Draw filled circle with radius using color and mode at x,y of the screen buffer. Uses the Bresenham circle algorithm with a few modifications to paint the circle without overlapping draw operations.

void MicroView::clear ( uint8_t  mode)

Clear screen buffer or SSD1306's memory.

To clear GDRAM inside the LCD controller, pass in the variable mode = ALL and to clear screen page buffer pass in the variable mode = PAGE.

void MicroView::clear ( uint8_t  mode,
uint8_t  c 
)

Clear or replace screen buffer or SSD1306's memory with a character.

To clear GDRAM inside the LCD controller, pass in the variable mode = ALL with c character and to clear screen page buffer, pass in the variable mode = PAGE with c character.

void MicroView::command ( uint8_t  c)

Send 1 command byte.

Send 1 command byte via SPI to SSD1306 controller.

void MicroView::command ( uint8_t  c1,
uint8_t  c2 
)

Send 2 command bytes.

Send 2 command bytes via SPI to SSD1306 controller.

void MicroView::command ( uint8_t  c1,
uint8_t  c2,
uint8_t  c3 
)

Send 3 command bytes.

Send 3 command bytes via SPI to SSD1306 controller.

void MicroView::contrast ( uint8_t  contrast)

Set contrast.

OLED contrast value from 0 to 255. Note: Contrast level is not very obvious.

void MicroView::data ( uint8_t  c)

SPI data.

Send 1 data byte via SPI to SSD1306 controller.

void MicroView::display ( void  )

Transfer display memory.

Bulk move the screen buffer to the SSD1306 controller's memory so that images/graphics drawn on the screen buffer will be displayed on the OLED.

void MicroView::doCmd ( uint8_t  cmdCount)

Parse command.

Command stored in serCmd array will be parsed to performed draw functions.

void MicroView::drawChar ( uint8_t  x,
uint8_t  y,
uint8_t  c 
)

Draw character.

Draw character c using current color and current draw mode at x,y.

void MicroView::drawChar ( uint8_t  x,
uint8_t  y,
uint8_t  c,
uint8_t  color,
uint8_t  mode 
)

Draw character with color and mode.

Draw character c using color and draw mode at x,y.

void MicroView::end ( void  )

Power off the OLED display.

Reset display control signals and prepare the SSD1306 controller for power off, then power off the 3.3V regulator.

void MicroView::flipHorizontal ( boolean  flip)

Horizontal flip.

Flip the graphics on the OLED horizontally.

void MicroView::flipVertical ( boolean  flip)

Vertical flip.

Flip the graphics on the OLED vertically.

uint8_t MicroView::getFontHeight ( void  )

Get font height.

The current font's height return as byte.

uint8_t MicroView::getFontStartChar ( void  )

Get font starting character.

Return the starting ASCII character of the currnet font, not all fonts start with ASCII character 0. Custom fonts can start from any ASCII character.

uint8_t MicroView::getFontTotalChar ( void  )

Get font total characters.

Return the total characters of the current font.

uint8_t MicroView::getFontType ( void  )

Get font type.

Return the font type number of the current font.

uint8_t MicroView::getFontWidth ( void  )

Get font width.

The cucrrent font's width return as byte.

uint8_t MicroView::getLCDHeight ( void  )

Get LCD height.

The height of the LCD return as byte.

uint8_t MicroView::getLCDWidth ( void  )

Get LCD width.

The width of the LCD return as byte.

uint8_t * MicroView::getScreenBuffer ( void  )

Get pointer to screen buffer.

Return a pointer to the start of the RAM screen buffer for direct access.

uint8_t MicroView::getTotalFonts ( void  )

Get total fonts.

Return the total number of fonts loaded into the MicroView's flash memory.

void MicroView::invert ( boolean  inv)

Invert display.

The WHITE color of the display will turn to BLACK and the BLACK will turn to WHITE.

void MicroView::line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1 
)

Draw line.

Draw line using current fore color and current draw mode from x0,y0 to x1,y1 of the screen buffer.

void MicroView::line ( uint8_t  x0,
uint8_t  y0,
uint8_t  x1,
uint8_t  y1,
uint8_t  color,
uint8_t  mode 
)

Draw line with color and mode.

Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer.

void MicroView::lineH ( uint8_t  x,
uint8_t  y,
uint8_t  width 
)

Draw horizontal line.

Draw horizontal line using current fore color and current draw mode from x,y to x+width,y of the screen buffer.

void MicroView::lineH ( uint8_t  x,
uint8_t  y,
uint8_t  width,
uint8_t  color,
uint8_t  mode 
)

Draw horizontal line with color and mode.

Draw horizontal line using color and mode from x,y to x+width,y of the screen buffer.

void MicroView::lineV ( uint8_t  x,
uint8_t  y,
uint8_t  height 
)

Draw vertical line.

Draw vertical line using current fore color and current draw mode from x,y to x,y+height of the screen buffer.

void MicroView::lineV ( uint8_t  x,
uint8_t  y,
uint8_t  height,
uint8_t  color,
uint8_t  mode 
)

Draw vertical line with color and mode.

Draw vertical line using color and mode from x,y to x,y+height of the screen buffer.

void MicroView::pixel ( uint8_t  x,
uint8_t  y 
)

Draw pixel.

Draw pixel using the current fore color and current draw mode in the screen buffer's x,y position.

void MicroView::pixel ( uint8_t  x,
uint8_t  y,
uint8_t  color,
uint8_t  mode 
)

Draw pixel with color and mode.

Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode.

void MicroView::rect ( uint8_t  x,
uint8_t  y,
uint8_t  width,
uint8_t  height 
)

Draw rectangle.

Draw rectangle using current fore color and current draw mode from x,y to x+width,y+height of the screen buffer.

void MicroView::rect ( uint8_t  x,
uint8_t  y,
uint8_t  width,
uint8_t  height,
uint8_t  color,
uint8_t  mode 
)

Draw rectangle with color and mode.

Draw rectangle using color and mode from x,y to x+width,y+height of the screen buffer.

void MicroView::rectFill ( uint8_t  x,
uint8_t  y,
uint8_t  width,
uint8_t  height 
)

Draw filled rectangle.

Draw filled rectangle using current fore color and current draw mode from x,y to x+width,y+height of the screen buffer.

void MicroView::rectFill ( uint8_t  x,
uint8_t  y,
uint8_t  width,
uint8_t  height,
uint8_t  color,
uint8_t  mode 
)

Draw filled rectangle with color and mode.

Draw filled rectangle using color and mode from x,y to x+width,y+height of the screen buffer.

void MicroView::scrollLeft ( uint8_t  start,
uint8_t  stop 
)

Left scrolling.

Set row start to row stop on the OLED to scroll left. Refer to http://learn.microview.io/intro/general-overview-of-microview.html for explanation of the rows.

void MicroView::scrollRight ( uint8_t  start,
uint8_t  stop 
)

Right scrolling.

Set row start to row stop on the OLED to scroll right. Refer to http://learn.microview.io/intro/general-overview-of-microview.html for explanation of the rows.

void MicroView::scrollStop ( void  )

Stop scrolling.

Stop the scrolling of graphics on the OLED.

void MicroView::setColor ( uint8_t  color)

Set color.

Set the current draw's color. Only WHITE and BLACK available.

void MicroView::setColumnAddress ( uint8_t  add)

Set SSD1306 column address.

Send column address command and address to the SSD1306 OLED controller.

void MicroView::setCursor ( uint8_t  x,
uint8_t  y 
)

Set cursor position.

MicroView's cursor position to x,y.

void MicroView::setDrawMode ( uint8_t  mode)

Set draw mode.

Set current draw mode with NORM or XOR.

uint8_t MicroView::setFontType ( uint8_t  type)

Set font type.

Set the current font type number, ie changing to different fonts base on the type provided.

void MicroView::setPageAddress ( uint8_t  add)

Set SSD1306 page address.

Send page address command and address to the SSD1306 OLED controller.

size_t MicroView::write ( uint8_t  c)
virtual

Override Arduino's Print.

Arduino's print overridden so that we can use uView.print().