ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Ö§Ô®¶Ù³§³¢µÄǶÈëʽͼÐβÙ×÷»·¾³
STUDENTS¡¯ INFORMATION TECHNOLOGY CONFERENCE
2016, Taiwan
John Chou
luckyjoou@gmail.com
About me
1
? From the opposite bank¡­Neihu(?
? Bachelor degree in Optoelectronics
? Now obtaining master degree in EE at NCKU
? Love music, soccer, photography,¡­
? Personal website: joouis.com
Intro
2
? Why do this work?
? Good one is not free.
? Free one is not good enough.
? Using HTML&CSS is better!
Ö§Ô®¶Ù³§³¢µÄǶÈëʽͼÐβÙ×÷»·¾³
3
30·Ö犸㶮ǶÈëʽˆDÐÎÔÚÖvʲüN
Outline
4
A.Draw: from basic to advanced
B.GUI: from classic to modern
C.Future work and welcome
Part A. Draw: from basic to advanced
5
Draw: Liquid-crystal display
6
? Liquid-crystal display(LCD)
? From opaque to transparent when applying an electric field.
? Requiring external light to produce a visible image.
? Types:
? Passive-matrix: TN, STN, ¡­
? Active-matrix: TFT(IPS, VA, ¡­)
Picture source
Draw: Liquid-crystal display
7
? What you should know
Draw: Liquid-crystal display
8
? What you actually see is
Draw: MCU
9
? STM32F429ZI key features:
? Core: ARM? 32-bit Cortex?-M4 CPU with FPU, frequency up to 180 MHz
? Memories: Up to 2 MB of Flash memory
? LCD-TFT controller up to XGA resolution with dedicated Chrom-ART
Accelerator? for enhanced graphic content creation (DMA2D)
? Up to 168 I/O ports with interrupt capability
? Up to 21 communication interfaces
Draw: VRAM
10
? It seems that we can draw pics after we initialize the
peripherals..
? But do this math work first:
Suppose we want to control a 2.4" QVGA(240*320) TFT
LCD, RGB565(2 btyes per pixel), how much bytes will be
needed per frame?
Draw: VRAM
11
? 240*320*2 = 153,600 btyes
? STM32F429ZI only have 192KB ram to use!!!
? So we need external ram, often call it Video Ram, which
was once commonly used to storage the framebuffer in
some graphics adapters.
? Then based on above, if TFT controller updates 240*320
pixels @60Hz?
? 153,600*60 = 9 MB/s (around 10-50% load on SDRAM)
Draw: Double buffering
12
? Double buffering:
Draw: UGUI
13
? We always want to stand on the shoulder of open source projects.
Draw: Font library
14
? Like this:
Draw: Font library
15
? And the output like this:
Draw: Raster and Vector Graphics
16
? In computer graphics, a raster graphics image is a dot matrix
data structure representing a generally rectangular grid of
pixels
? Color mode: RGB565, RGB888, ARGB32
Draw: Vector Graphics
17
? If you open an svg file you will see that path elements are
specified using a graphical operation format that looks
something like this
Draw: TWIN
18
? A vector graphics framework for embedded system
? Its author is Keith Packard, who was named as ¡°the person
behind most of the improvements made on the open source desktop
in the last ten years at least¡± in 2011.
Draw: Spline in TWIN
19
? B¨¦zier curve is a kind of spline.
? And can be defined as:
Draw: Spline in TWIN
20
? Alogrithm in TWIN: De Casteljau's algorithm
Draw: Transition
21
? Translation
? (Uniform) Scaling
? Rotation
? Rotate matrix(counterclockwise)
? Counterclockwise, ¦Èangle
Draw: Comparison between Bitmap & Vector
22
? Bitmap/raster graphics
? Pre-rendered. At run time,
basically just a data copy.
? Hard to do
? Zoom
? Rotate
? Color change
? Dynamic backgrounds
? But much faster and can make
heavy use of DMA transfers.
? Arithmetic/vector graphics
? Run-time calculations and pixel
plotting by MCU.
EASY
? Not really an option in this
context.
Part B. GUI: from classic to modern
23
GUI: Classic Embedded UI
24
GUI: Modern Embedded UI
25
? What users expect¡­
GUI: Modern Embedded UI
26
? Features£º
? Transparency
? Alpha-blending
? Anti-aliased fonts and kerning
? Touch Gestures
? Animations
? Screen transition
? High resolution displays
? High frame rate
GUI: Modern Embedded UI
27
? It is not all about technology.
GUI: SPA Style
28
? Single-page application
? A web application or website that fits on a single web page
with the goal of providing a more fluent UX similar to a
desktop application.
GUI: Challenges
29
? MCU Load:
? Large amount of data
? UI is just a (small) part of the system
? Limit Pixel Redraws:
? Only draw the areas that actually change
? Only draw pixels that are actually visible
? Memory Usage: Internal and external RAM usage
? High-end Look & Feel
Part C. Future work
30
Future work: DSL
31
Domain-specific language ¡­ Well, just think about HTML
Future work
32
? Support vector graphics (ongoing)
? Web UI style (SPA)
? Support DSL
? Optimization for low memory cost
Welcome
33
? BSD License
? With documenting, see here
? Github
Reference
34
? STM32F429I-DISCO schematics
? RM0090: STM32F405/415, STM32F407/417, STM32F427/437 and STM32F429/439
advanced ARM?-based 32-bit MCUs
? Wikipedia: Vector graphics
? Bezier
? Modern GUI on Limited Hardware - Jesper Hedegaard; Mj?lner Informatics
Thanks for listening !
Special thanks to Jserv and SITCON !
35

More Related Content

Ö§Ô®¶Ù³§³¢µÄǶÈëʽͼÐβÙ×÷»·¾³