u8g2.txt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. U8glib V2: Name and project goals
  2. https://github.com/olikraus/u8g2
  3. U8g2 = Universal 8bit Graphics
  4. [U]niversal: Support for many displays ans development platforms
  5. [8]bit: Initial focus had been 8 bit microcontroller systems
  6. [g]raphics": U8g2 is a graphics library with focus on monochrome graphics displays
  7. [2]: Second generation and successor of u8glib
  8. U8glib V2 Goals
  9. - Support for monochrome LCDs and OLEDs
  10. - Focus on "monochrome"
  11. - Low memory footprint
  12. U8glib V2: Features and Limitations
  13. - Full Memory Buffer
  14. - 3-wire-SPI
  15. - Support for Arduino Libraries SPI and TWI
  16. - Unicode Support
  17. Unicode plane 0 (Basic Multilingual Plane, BMP, glyphs with 0x0000-0xffff)
  18. is fully supported.
  19. Limitation: Unicode planes > 0 are not supported
  20. - UTF-8 Support
  21. 2 and 3 byte sequences are detected and handled.
  22. Limitation:
  23. Behavior for sequences with more than 3 bytes is unknown.
  24. - Large number of fonts
  25. - Compilation speed improved (font data)
  26. - "Text only" sub library: U8x8
  27. - Hardware supported display flip
  28. - Better hardware support: Tested with avr, esp8266 and sam architectures.
  29. u8g vs. u8g2
  30. Major Changes (Code rework required)
  31. - The name of the include file has changed: Use
  32. #include "U8g2lib.h"
  33. - The native type for pixel coordinates has changed to u8g2_uint_t
  34. Use the following line to redefine this at the beginning of your code
  35. typedef u8g2_uint_t u8g_uint_t;
  36. - Old Arduino IDE 00xx (before 1.00) is not supported any more.
  37. ARDUINO macro must be >= 100
  38. - begin() must be called (this was optional in U8glib)
  39. - constructor contains name of communicaton interface and
  40. also contains the display orientation as first argument
  41. - u8g2.drawStr90 does not exist any more, use
  42. void u8g2_SetFontDirection(u8g2_t *u8g2, uint8_t dir);
  43. - "P" versions of the string functions are not yet implemented.
  44. This includes drawStrP(), getStrWidthP(), etc
  45. Use the print function with the F() macro instead.
  46. - In U8glib font transparency was defined in the .begin() statement. This is now
  47. handled by setFontMode().
  48. - Screen rotation is handled by the constructor in u8g2
  49. The functions undoRotation, setRot90, setRot180 and setRot270 are
  50. replaced by the first argument of the constructor
  51. - Screen scaling is not there in u8g2
  52. It is completly removed, there are no corresponding function in u8g2
  53. for undoScale() and setScale2x2().
  54. - setColorEntry(), setHiColor(), setHiColorByRGB(), setRGB: Not supported any more
  55. (u8g2 focus are monochrome displays, use Ucglib instead)
  56. - getMode(): Is not available any more because there is only one monochrome mode.
  57. - setDefaultForegroundColor(), setDefaultBackgroundColor() and
  58. setDefaultMidColor() are not required any more. These functions do not
  59. exist in U8g2. Use setDrawColor() instead.
  60. - getFontLineSpacing() and setFontLineSpacingFactor() are not supported any more.
  61. - getStrPixelWidth() is replaced by getStrWidth()
  62. - setHardwareBackup() not supported any more. Might be implemented later
  63. - Cursor functions are not available. This includes:
  64. setCursorFont(), setCursorStyle(), setCursorPos(), setCursorColor(),
  65. enableCursor(), disableCursor(), drawCursor()
  66. - Virtual screen handling is not supported:
  67. setVirtualScreenDimension(), addToVirtualScreen()
  68. Minor Changes (Code update might be required)
  69. - U8g2 drawTriangle() expects signed arguments (u8glib expects unsigned arguments)
  70. - U8g2 has different font names. Some of the old font names are known to u8g2 and are
  71. mapped automatically. If the font name is unknown, please choose a different font from the font list.
  72. Change Notes (No code change required)
  73. - sleepOn(), sleepOff(): supported, but better user setPowerSave()
  74. - setColorIndex() and getColorIndex() are renamed to setDrawColor() and
  75. getDrawColor(). The old names are still supported.
  76. - getFontAscent() and getFontDescent() are renamed to getAscent() and getDescent()
  77. The old names are still supported.
  78. - Signal names are renamed in the constructor calls:
  79. U8glib sck == U8g2 clock
  80. U8glib mosi == U8g2 data
  81. U8glib a0 == U8g2 dc
  82. - getHeight() renamed to getDisplayHeight(), old name still exists
  83. - getWidth() renamed to getDisplayWidth(), old name still exists