Display
This driver is for the display that comes with the MR-CANHUBK344 board. It is a 128x32 OLED display with a SSD1306 chip with I2c. The chip is also found in 128x64 I2c displays, and the driver is easy to port for them. The display is strongly recommended for easier debugging.
The driver divides the pixels into 4 lines of 16 characters each using an 8x8 character fontmap. You can print text, positive and negative integers, waveforms and vectors with this driver. The driver keeps a buffer of all the display’s pixels.
Initialization
Parameters:
· FontmapRotations: How many times should the fontmap be rotated. This parameter should be kept as 1 in most circumstances.
Printing text
Parameters:
· DisplayLine: The line on which to print the text.
· Text[16]: The actual text to print.
· TextLength: The length of the text to print.
· TextOffset: How many positions from the start of the line (left) to skip before printing the text.
Printing integers
Parameters:
· DisplayLine: The line on which to print the number.
· Value: The actual number to print.
· TextLength: How many digits to print. If this parameter is larger than the number of digits the number has, it will be completed with blank spaces. If it is smaller, the number will be cropped to fit.
· TextOffset: How many positions from the start of the line (left) to skip before printing the number.
Printing waveforms
Parameters:
· DisplayLine: The line on which to start printing the waveform.
· Values[128]: The actual values to print. The values must be in the 0-100 range.
· ValuesCount: How many values to print. This also determines how many pixels the waveform will occupy horizontally on the display.
· LinesSpan: How many lines should the waveform occupy vertically, starting from the DisplayLine parameter and going down. The waveform will be scaled automatically to fit.
Printing vectors
Clearing the display
This function clears the display’s buffer. It still needs a refresh to see the changes.
Refreshing the display
This function sends to the display the current buffer.
Last updated