User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 203
www.energymicro.com
Figure 14.38. EBI TFT Alpha Blending and Masking
EBI_AD
EBI_TFTMASK EBI_TFTALPHA
EBI_TFTPIXEL
EBI_TFTPIXEL0 EBI_TFTPIXEL1
Mask
Check
Alpha Blend
EBI_AD
AHB WDATA
COLOR1SRC
blend
COLOR0
COLOR1
mask m atch
external = (MASKBLEND = = EMASK) or (MASKBLEND = = EALPHA) or (MASKBLEND = = EMASKEALPHA)
blend = (MASKBLEND = = IALPHA) or (MASKBLEND = = EALPHA)
external
0 1
0 1
0
1
mask m atch
0 1
14.3.17.1 Alpha blending
Automatic alpha blending can be performed on AHB data written to or via the EBI. Alpha blending can
be enabled for either internal or external writes by setting the MASKBLEND bitfield in the EBI_TFTCTRL
register. Internal writes are writes to the internal EBI_TFTPIXEL0 register. External writes are writes to
the external device attached to the bank defined in the BANKSEL bitfield of the EBI_TFTCTRL register.
Alpha blending works on two data items: a foreground Color0 = {R0, G0, B0} and a background Color1
= {R1, G1, B1}. These data items are encoded in either 565 RGB or 555 RGB format as defined in the
RGBMODE bitfield of the EBI_TFTCTRL register. In case that the 555 RGB format is used, only the
15 least significant bits of Color0 and Color1 are used for the alpha blending operation itself. The most
significant bit of the foreground Color0 is passed on unmodified as the most significant bit of the alpha
blending result. Alpha blending is performed according to formula Equation 14.3 (p. 203) .
EBI Alpha Blending Equation
AlphaBlend(Color0, Color1) = (({R0, G0, B0} x EBI_TFTALPHA)
+ ({R1, G1, B1} x (256 - EBI_TFTALPHA))) / 256
(14.3)
The 9-bit alpha blending factor is defined in the EBI_TFTALPHA register. The maximum allowed value
for EBI_TFTALPHA is 256. An alpha value of 0 corresponds to a fully transparent color, whereas an alpha
value of 256 corresponds to a fully opague color. The RGB Color0 data is taken from either the internal
write data (written to EBI_TFTPIXEL0) or from the external write data (written to bank BANKSEL). The