mirror of
https://github.com/Valeh2012/PersonalVotingMachine
synced 2024-11-25 18:31:00 +02:00
111 lines
4.1 KiB
Plaintext
111 lines
4.1 KiB
Plaintext
|
|
U8glib V2: Name and project goals
|
|
|
|
https://github.com/olikraus/u8g2
|
|
|
|
U8g2 = Universal 8bit Graphics
|
|
|
|
[U]niversal: Support for many displays ans development platforms
|
|
[8]bit: Initial focus had been 8 bit microcontroller systems
|
|
[g]raphics": U8g2 is a graphics library with focus on monochrome graphics displays
|
|
[2]: Second generation and successor of u8glib
|
|
|
|
|
|
U8glib V2 Goals
|
|
|
|
- Support for monochrome LCDs and OLEDs
|
|
- Focus on "monochrome"
|
|
- Low memory footprint
|
|
|
|
|
|
U8glib V2: Features and Limitations
|
|
|
|
- Full Memory Buffer
|
|
- 3-wire-SPI
|
|
- Support for Arduino Libraries SPI and TWI
|
|
|
|
- Unicode Support
|
|
Unicode plane 0 (Basic Multilingual Plane, BMP, glyphs with 0x0000-0xffff)
|
|
is fully supported.
|
|
Limitation: Unicode planes > 0 are not supported
|
|
- UTF-8 Support
|
|
2 and 3 byte sequences are detected and handled.
|
|
Limitation:
|
|
Behavior for sequences with more than 3 bytes is unknown.
|
|
|
|
- Large number of fonts
|
|
|
|
- Compilation speed improved (font data)
|
|
|
|
- "Text only" sub library: U8x8
|
|
|
|
- Hardware supported display flip
|
|
|
|
- Better hardware support: Tested with avr, esp8266 and sam architectures.
|
|
|
|
|
|
u8g vs. u8g2
|
|
|
|
Major Changes (Code rework required)
|
|
|
|
- The name of the include file has changed: Use
|
|
#include "U8g2lib.h"
|
|
- The native type for pixel coordinates has changed to u8g2_uint_t
|
|
Use the following line to redefine this at the beginning of your code
|
|
typedef u8g2_uint_t u8g_uint_t;
|
|
|
|
- Old Arduino IDE 00xx (before 1.00) is not supported any more.
|
|
ARDUINO macro must be >= 100
|
|
- begin() must be called (this was optional in U8glib)
|
|
- constructor contains name of communicaton interface and
|
|
also contains the display orientation as first argument
|
|
- u8g2.drawStr90 does not exist any more, use
|
|
void u8g2_SetFontDirection(u8g2_t *u8g2, uint8_t dir);
|
|
- "P" versions of the string functions are not yet implemented.
|
|
This includes drawStrP(), getStrWidthP(), etc
|
|
Use the print function with the F() macro instead.
|
|
- In U8glib font transparency was defined in the .begin() statement. This is now
|
|
handled by setFontMode().
|
|
- Screen rotation is handled by the constructor in u8g2
|
|
The functions undoRotation, setRot90, setRot180 and setRot270 are
|
|
replaced by the first argument of the constructor
|
|
- Screen scaling is not there in u8g2
|
|
It is completly removed, there are no corresponding function in u8g2
|
|
for undoScale() and setScale2x2().
|
|
- setColorEntry(), setHiColor(), setHiColorByRGB(), setRGB: Not supported any more
|
|
(u8g2 focus are monochrome displays, use Ucglib instead)
|
|
- getMode(): Is not available any more because there is only one monochrome mode.
|
|
- setDefaultForegroundColor(), setDefaultBackgroundColor() and
|
|
setDefaultMidColor() are not required any more. These functions do not
|
|
exist in U8g2. Use setDrawColor() instead.
|
|
- getFontLineSpacing() and setFontLineSpacingFactor() are not supported any more.
|
|
- getStrPixelWidth() is replaced by getStrWidth()
|
|
- setHardwareBackup() not supported any more. Might be implemented later
|
|
- Cursor functions are not available. This includes:
|
|
setCursorFont(), setCursorStyle(), setCursorPos(), setCursorColor(),
|
|
enableCursor(), disableCursor(), drawCursor()
|
|
- Virtual screen handling is not supported:
|
|
setVirtualScreenDimension(), addToVirtualScreen()
|
|
|
|
Minor Changes (Code update might be required)
|
|
|
|
- U8g2 drawTriangle() expects signed arguments (u8glib expects unsigned arguments)
|
|
- U8g2 has different font names. Some of the old font names are known to u8g2 and are
|
|
mapped automatically. If the font name is unknown, please choose a different font from the font list.
|
|
|
|
Change Notes (No code change required)
|
|
|
|
- sleepOn(), sleepOff(): supported, but better user setPowerSave()
|
|
- setColorIndex() and getColorIndex() are renamed to setDrawColor() and
|
|
getDrawColor(). The old names are still supported.
|
|
- getFontAscent() and getFontDescent() are renamed to getAscent() and getDescent()
|
|
The old names are still supported.
|
|
- Signal names are renamed in the constructor calls:
|
|
U8glib sck == U8g2 clock
|
|
U8glib mosi == U8g2 data
|
|
U8glib a0 == U8g2 dc
|
|
- getHeight() renamed to getDisplayHeight(), old name still exists
|
|
- getWidth() renamed to getDisplayWidth(), old name still exists
|
|
|
|
|