An interface to communicate with the OLED display.
More...
#include <oled.h>
|
void | Init (uint8_t width, uint8_t height) |
|
void | GoToLine (uint8_t line) |
|
void | Clear () |
|
void | ClearLine () |
|
void | WriteByte (uint8_t page, uint8_t column, uint8_t byte) |
|
void | WriteByteArray (uint8_t page, uint8_t column, uint8_t *byte_array, uint8_t length) |
|
void | Repaint () |
|
void | SetNumberOfLines (uint8_t number_of_lines) |
|
void | WriteBitmap (uint8_t **pixels, uint8_t bitmap_width, uint8_t bitmap_height, uint8_t x, uint8_t y, bool is_progmem) |
|
void | SetFont (uint8_t *font, uint8_t width, uint8_t height) |
|
void | WriteLine (char *string, uint8_t length, uint8_t line, uint8_t offset) |
|
uint8_t | GetYCoordinateFromLineNumber (uint8_t line) |
|
uint8_t | GetMaxLineCharacters () |
|
| Stream (uint16_t input_stream_size, uint16_t output_stream_size) |
|
virtual void | Write (uint8_t *string, uint16_t size) |
|
virtual uint16_t | Read (uint8_t *string, uint16_t size) |
|
virtual bool | ReadByte (uint8_t &byte) |
|
virtual void | WriteByte (uint8_t byte) |
|
virtual uint8_t | GetAvailableWriteBytes () |
|
virtual uint8_t | GetAvailableReadBytes () |
|
virtual bool | CheckInputOverflowFlag () |
|
virtual bool | CheckOutputOverflowFlag () |
|
virtual uint16_t | GetInputBufferLength () |
|
virtual uint16_t | GetOutputBufferLength () |
|
virtual void | FlushInputBuffer () |
|
virtual void | FlushOutputBuffer () |
|
|
| OLED () |
|
virtual void | WriteByteToOLED (volatile uint8_t *address, uint8_t data) |
|
void | GetBitmapForCharacter (char character, uint8_t *&character_bitmap) |
|
virtual uint16_t | ReadFromBuffer (uint8_t *buffer, uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty, uint8_t *string, uint16_t &string_size) |
|
virtual void | WriteToBuffer (uint8_t *buffer, uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty, bool &overflow_flag, uint8_t *string, uint16_t &string_size, void(*cb)(Stream *stream)) |
|
virtual bool | ReadByteFromBuffer (uint8_t &byte, uint8_t *buffer, uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty) |
|
virtual void | WriteByteToBuffer (uint8_t *buffer, uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty, bool &overflow_flag, uint8_t &byte, void(*cb)(Stream *stream)) |
|
virtual void | WriteByteToInputStream (uint8_t &byte) |
|
virtual bool | ReadByteFromOutputStream (uint8_t &byte) |
|
virtual void | WriteToInputStream (uint8_t *string, uint16_t size) |
|
virtual uint16_t | ReadFromOutputStream (uint8_t *string, uint16_t size) |
|
virtual uint16_t | CalculateLength (uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty) |
|
virtual void | FlushStream (uint16_t &start_index, uint16_t &stop_index, uint16_t &buffer_size, bool &empty) |
|
An interface to communicate with the OLED display.
§ OLED()
§ Clear()
§ ClearLine()
§ GetBitmapForCharacter()
void OLED::GetBitmapForCharacter |
( |
char |
character, |
|
|
uint8_t *& |
character_bitmap |
|
) |
| |
|
protected |
Fetches a pointer to PROGMEM for the bitmap for the given font and character. Emphasis on that it points to PROGMEM.
§ GetMaxLineCharacters()
uint8_t OLED::GetMaxLineCharacters |
( |
| ) |
|
Returns how wide a line is in characters.
- Returns
- How wide a line is in characters.
§ GetYCoordinateFromLineNumber()
uint8_t OLED::GetYCoordinateFromLineNumber |
( |
uint8_t |
line | ) |
|
Returns the y coordinate of the line.
- Parameters
-
line | The line to find the y coordinate of. |
- Returns
- The y coordinate of the line.
§ GoToLine()
void OLED::GoToLine |
( |
uint8_t |
line | ) |
|
Sets the line pointer.
- Parameters
-
§ Init()
void OLED::Init |
( |
uint8_t |
width, |
|
|
uint8_t |
height |
|
) |
| |
Initializes the whole screen.
- Parameters
-
width | The width of the screen in pixels. |
height | The height of the screen in pixels. |
§ Repaint()
§ SetFont()
void OLED::SetFont |
( |
uint8_t * |
font, |
|
|
uint8_t |
width, |
|
|
uint8_t |
height |
|
) |
| |
Sets the font to be used when writing to the screen.
- Parameters
-
font | A pointer to the font. Put this on the PROGMEM only if possible to save RAM space. |
width | The width of the font in pixels. |
height | The height of the font in pixels. |
§ SetNumberOfLines()
void OLED::SetNumberOfLines |
( |
uint8_t |
number_of_lines | ) |
|
Sets the number of lines. Not to be confused with number of pages.
- Parameters
-
number_of_lines | The number of lines. |
§ WriteBitmap()
void OLED::WriteBitmap |
( |
uint8_t ** |
pixels, |
|
|
uint8_t |
bitmap_width, |
|
|
uint8_t |
bitmap_height, |
|
|
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
bool |
is_progmem |
|
) |
| |
Writes a pixel matrix to the given x and y position on the display.
- Parameters
-
pixels | A double pointer to the matrix. |
bitmap_width | The width of the bitmap in pixels. |
bitmap_height | The height of the bitmap in pixels. |
x | The starting position, x direction. |
y | The starting position, y direction. |
is_progmem | A bool that indicates where the pixel array is located. |
§ WriteByte()
void OLED::WriteByte |
( |
uint8_t |
page, |
|
|
uint8_t |
column, |
|
|
uint8_t |
byte |
|
) |
| |
Writes a byte to the given page and column. This is a helper function mainly used for debugging.
- Parameters
-
page | Which page to be written to. |
page | Which column to be written to. |
byte | The byte to be written. |
§ WriteByteArray()
void OLED::WriteByteArray |
( |
uint8_t |
page, |
|
|
uint8_t |
column, |
|
|
uint8_t * |
byte_array, |
|
|
uint8_t |
length |
|
) |
| |
Writes a byte array starting at the given page and column. This is a helper function mainly used for debugging.
- Parameters
-
page | Which page to be written to. |
page | Which column to be written to first. |
byte_array | Bytes to be written. |
length | The length of the byte array (number of columns). |
§ WriteByteToOLED()
virtual void OLED::WriteByteToOLED |
( |
volatile uint8_t * |
address, |
|
|
uint8_t |
data |
|
) |
| |
|
inlineprotectedvirtual |
Writes a single byte to the OLED. This can be implemented using the external memory interface or using whatever other technology like for instance the SCP.
- Parameters
-
address | The address to write to. |
data | The data to write. |
Reimplemented in OLED_SCP, and OLED_memory.
§ WriteLine()
void OLED::WriteLine |
( |
char * |
string, |
|
|
uint8_t |
length, |
|
|
uint8_t |
line, |
|
|
uint8_t |
offset |
|
) |
| |
Writes a string to the given line.
- Parameters
-
string | The string to be written. |
length | Length of the string. |
line | The line to write to. |
offset | The offset from the left, in characters. |
§ current_line
uint8_t OLED::current_line = 0 |
|
protected |
The current line to write to.
§ display_height
uint8_t OLED::display_height = 0 |
|
protected |
Height of display in pixels.
§ display_width
uint8_t OLED::display_width = 0 |
|
protected |
Width of the display in pixels.
§ font
uint8_t* OLED::font = nullptr |
|
protected |
The font to use for writing.
§ font_height
uint8_t OLED::font_height |
|
protected |
Height of the font in pixels.
§ font_width
Width of the font in pixels.
§ matrix
The display buffer. There is also a buffer on the OLED controller, such that this implements a dual buffer.
§ number_of_lines
uint8_t OLED::number_of_lines = 0 |
|
protected |
Number of lines. Not to be confused with number of pages.
§ number_of_pages
uint8_t OLED::number_of_pages = 0 |
|
protected |
§ oled_command
volatile uint8_t* OLED::oled_command = (volatile uint8_t*)0x8000 |
|
protected |
A pointer to where the OLED_COMMAND address space starts.
§ oled_data
volatile uint8_t* OLED::oled_data = (volatile uint8_t*)0x8100 |
|
protected |
A pointer to where the OLED_DATA address space starts.
§ pixels_per_line
uint8_t OLED::pixels_per_line |
|
protected |
The number of pixels per line.
The documentation for this class was generated from the following files:
- lib/oled/oled.h
- lib/oled/oled.cpp