This document is a programmer guide for the FT800 series chip. This guide details the
chip features and procedures for use. For FT801 specific features and procedures,
please see the chapter FT801.
This document captures programming details of FT800 series chips including graphics
commands, widget commands and configurations to control FT800 series chips for
smooth and vibrant screen effects.
The FT800 series chips are graphics controllers with add-on features such as audio
playback and touch capabilities. They consist of a rich set of graphics objects (primitive
and widgets) that can be used for displaying various menus and screen shots for a range
of products including home appliances, toys, industrial machinery, home automation,
elevators, and many more.
1.1 Overview
This document will be useful to understand the command set and demonstrate the ease
of usage in the examples given for each specific instruction. In addition, it also covers
various power modes, audio, and touch features as well as their usage.
Information on pin settings, hardware model and hardware configuration can be found in
the FT800 data sheet (DS_FT800_Embedded_Video_Engine) or FT801 datasheet
(DS_FT801).
1.2 Scope
This document is targeted for software programmers and system designers to develop
graphical user interface (GUI) applications on any system processor with either an SPI or
I2C master port.
1.3 API reference definitions
Functionality and nomenclature of the APIs used in this document.
wr8() – write 8 bits to intended address location
wr16() – write 16 bits to intended address location
wr32() – write 32 bits to intended address location
wr8s() – write 8 bits string to intended address location
rd8() – read 8 bits from intended address location
rd16() – read 16 bits from intended address location
rd32() – read 32 bits from intended address location
rd8s() – read 8 bits string from intended address location
The FT800 appears to the host MCU as a memory-mapped SPI or I2C device. The host
communicates with the FT800 using Read or Write to 8MB address space.
Within this document, endianness of DL commands, co-processor engine commands,
register values read/write, input RGB bitmap data and ADPCM input data are in ‘Little Endian’ format.
2.1 General Software architecture
The software architecture can be broadly classified into layers such as custom
applications, graphics/GUI manager, video manger, audio manager, drivers etc. FT800
higher level graphics engine commands and co-processor engine widget commands are
part of the graphics/GUI manager. Control & data paths of video and audio are part of
video manager and audio manager. Communication between graphics/GUI manager and
the hardware is via the SPI or I2C driver.
Typically the display screen shot is constructed by the custom application based on the
framework exposed by the graphics/GUI manager.
And the REG_CSPREAD register changes color clock timing to reduce system noise.
GPIO bit 7 is used for the display enable pin of the LCD module. By setting the direction
of the GPIO bit to out direction, the display can be enabled by writing value of 1 into
GPIO bit 7 or the display can be disabled by writing a value of 0 into GPIO bit 7. By
default GPIO bit 7 direction is output and the value is 0.
Note: Refer to FT800 data sheet for information on display register set.
2.2.1 Horizontal timing
Figure 2: Horizontal Timing
REG_PCLK controls the frequency of PCLK. The register specifies a divisor for the main
48 MHz clock, so a value of 4 gives a 12 MHz PCLK. If REG_PCLK is zero, then all display
output is suspended. REG_PCLK_POL controls the polarity of PCLK. Zero means that
display data is clocked out on the rising edge of PCLK. One means data is clocked on the
falling edge.
The total number of PCLKs in a horizontal line is REG_HCYCLE. Within this horizontal line
are the scanned out pixels, REG_HSIZE in total. They start after REG_HOFFSET cycles.
Signal DE is high while pixels are being scanned out.
Horizontal sync timing on signal HSYNC is controlled by REG_HSYNC0 and REG_HSYNC1.
They specify the time at which HSYNC falls and rises respectively.
Vertical timing is specified in number of lines. The total number of lines in a frame is
REG_VCYCLE. There are REG_VSIZE rows of pixels in total. They start after
REG_VOFFSET cycles.
Vertical sync timing on signal VSYNC is controlled by REG_VSYNC0 and REG_VSYNC1.
They specify the lines at which VSYNC falls and rises respectively.
2.2.3 Signals updating timing control
With REG_CSPREAD disabled, all color signals are updated at the same time:
Figure 4: Pixel clocking with no CSPREAD
But with REG_CSPREAD enabled, the color signal timings are adjusted slightly so that
fewer signals change simultaneously:
For a display updating at 60Hz, there are 48000000/60= 800000 fast clocks per frame.
Setting the PCLK divisor REG_PCLK to 5 gives a PCLK frequency of 9.6 MHz and
800000/5= 160000PCLKs per frame.
For a 480 x 272 display, the typical horizontal period is 525 clocks, and vertical period is
286 lines. A little searching shows that a 548 x 292 size gives a period of 160016 clocks,
very close to the target. So with a REG_HCYCLE=548 and REG_VCYCLE=292 the display
frequency is almost exactly 60Hz. The other register settings can be set directly from the
display panel datasheet.
wr8(REG_VOL_SOUND,0xFF);//set the volume to maximum
wr16(REG_SOUND, (0x6C<<8) | 0x41);// C8 MIDI note on xylophone
wr8(REG_PLAY, 1); // play the sound
Sound_status = rd8(REG_PLAY);//1-play is going on, 0-play has finished
wr16(REG_SOUND,0x0);//configure silence as sound to be played
wr8(REG_PLAY,1);//play sound
Sound_status = rd8(REG_PLAY);//1-play is going on, 0-play has finished
3. Execute ”Initialization Sequence during the Boot UP” from steps 1 to 9
Initialization Sequence from Sleep Mode:
1. Send Host command “ACTIVE” to enable clock to FT800
2. Wait for at least 20ms
3. Execute “Initialization Sequence during Boot Up” from steps 5 to 8
Initialization sequence from standby mode:
Execute all the steps mentioned in “Initialization Sequence from Sleep Mode”
except waiting for at least 20ms in step 2.
Note: Refer to FT800 data sheet for information on power modes. Follow section 2.3 for
audio management during power down and reset operations.
2.3 Sound Synthesizer
Sample code to play C8 on the xylophone:
Code snippet 2 sound synthesizer play C8 on the xylophone
Sample code to check the status of sound play:
Code snippet 3 sound synthesizer check the status of sound playing
Sample code to stop sound play:
Code snippet 4 sound synthesizer stop playing sound
To avoid an audio pop sound on reset or power state change, trigger a "mute" sound,
and wait for it to complete (completion of sound play is when REG_PLAY contains a value
of 0). This sets the output value to 0 level. On reboot, the audio engine plays back the
"unmute" sound to drive the output to the half way level.
Note: Refer to FT800 data sheet for more information on sound synthesizer and audio
playback.
FT800 supports three types of audio format: 4 Bit IMA ADPCM, 8 Bit signed PCM, 8 Bit uLaw. For IMA ADPCM format, please note the byte order: within one byte, first sample
(4 bits) shall locate from bit 0 to bit 3, while the second sample (4 bits) shall locate from
bit 4 to bit 7.
For the audio data in FT800 RAM to play, FT800 requires the start address in
REG_PLAYBACK_START to be 64 bit (8 Bytes) aligned. In addition, the length of audio
data specified by REG_PLAYBACK_LENGTH is required to be 64 bit (8 Bytes) aligned.
To learn how to play back the audio data, please check the sample code below:
After the above drawing commands are loaded into display list RAM, register
REG_DLSWAP is required to be set to 0x02 in order to make the new display list active
on the next frame refresh.
Note:
The display list always starts at address RAM_DL
The address always increments by 4(bytes) as each command is 32 bit width.
Command CLEAR is recommended to be used before any other drawing
operation, in order to put FT800 graphics engine in a known state.
The end of the display list is always flagged with the command DISPLAY
2.5.2 Coordinate Plane
The figure below illustrates the graphics coordinate plane and its visible area.
The valid X and Y coordinate ranges from -1024 to 1023 in pixel precision, i.e., from
BEGIN with one of the primitive types
Input one or more vertices, which specify the placement of the primitive on
the screen
END to mark the end of the primitive
(note: In many examples the END command is not explicitly listed)
The primitive types that the graphics engine support are:
BITMAPS - rectangular pixel arrays, in various color formats
POINTS - anti-aliased points, point radius is 1-256 pixels
LINES - anti-aliased lines, with width from 0 to 4095 1/16th of pixel units.
(width is from center of the line to boundary)
LINE_STRIP - anti-aliased lines, connected head-to-tail
RECTS - round-cornered rectangles, curvature of the corners can be adjusted
using LINE_WIDTH.
EDGE_STRIP_A/B/L/R - edge strips
Examples
Draw points with varying radius from 5 pixels to 13 pixels with different colors:
The VERTEX2F command gives the location of the circle center.
Draw lines with varying sizes from 2 pixels to 6 pixels with different colors (line width
size is from center of the line till boundary):
dl( COLOR_RGB(128, 0, 0) );
dl( LINE_WIDTH(2 * 16) );
dl( BEGIN(LINES) );
dl( VERTEX2F(30 * 16,38 * 16) );
dl( VERTEX2F(30 * 16,63 * 16) );
dl( COLOR_RGB(0, 128, 0) );
dl( LINE_WIDTH(4 * 16) );
dl( VERTEX2F(60 * 16,25 * 16) );
dl( VERTEX2F(60 * 16,63 * 16) );
dl( COLOR_RGB(128, 128, 0) );
dl( LINE_WIDTH(6 * 16) );
dl( VERTEX2F(90 * 16, 13 * 16) );
dl( VERTEX2F(90 * 16, 63 * 16) );
The VERTEX2F commands are in pairs to define the start and finish point of the line.
Draw rectangle with sizes of 5x25, 10x38 and 15x50 dimensions (line width size is used
for corner curvature, LINE_WIDTH pixels are added on both directions in addition to
rectangle dimension):
dli = 0;// start writing the display list
dl(CLEAR(1, 1,1)); // clear screen
dl(BEGIN(BITMAPS)); // start drawing bitmaps
dl(VERTEX2II(220,110,31,'F'));// ascii F in font 31
dl(VERTEX2II(244,110,31,'T'));// ascii T
dl(VERTEX2II(270,110,31,'D'));// ascii D
dl(VERTEX2II(299,110,31,'I'));// ascii I
dl(END());
dl(COLOR_RGB(160,22,22));// change color to red
dl(POINT_SIZE(320));// set point size
dl(BEGIN(POINTS)); // start drawing points
dl(VERTEX2II(192,133,0,0)); // red point
dl(END());
dl(DISPLAY()); // display the image
dl(COLOR_RGB(255,64,64));// red at (200, 120)
dl(VERTEX2II(200,120,0,0));
dl(COLOR_RGB(64,180,64));// green at (216, 136)
dl(VERTEX2II(216,136,0,0));
dl(COLOR_RGB(255,255,64));// transparent yellow at (232, 152)
dl(COLOR_A(150));
dl(VERTEX2II(232,152,0,0));
The COLOR_RGB command changes the current drawing color, which colors the bitmap.
The COLOR_A command changes the current drawing alpha, changing the transparency
of the drawing: an alpha of 0 means fully transparent and an alpha of 255 is fully
opaque. Here a value of 150 gives a partially transparent effect.
2.5.7 VERTEX2II and VERTEX2F
The VERTEX2II command used above only allows positive screen coordinates. If the
bitmap is partially off screen, for example during a screen scroll, then it is necessary to
specify negative screen coordinates. The VERTEX2F command allows negative
coordinates. It also allows fractional coordinates, because it specifies screen (x,y) in
units of 1/16 of a pixel.
For example, drawing the same bitmap at screen position (-10,-10) using VERTEX2F:
//Read 64 bit registers to see if it is busy
while (rd32(REG_SCREENSHOT_BUSY) | rd32(REG_SCREENSHOT_BUSY + 4));
wr8(REG_SCREENSHOT_READ , 1);
for (int lx = 0; lx < SCREEN_WIDTH; lx ++) {
//Read 32 bit pixel value from RAM_SCREENSHOT //The pixel format is BGRA: Blue is in lowest address and Alpha
The code below demonstrates how to utilize the registers and RAM_SCREENSHOT to
capture the current screen with full pixel value. Each pixel is represented in 32 bits and
BGRA format. However, this process may cause the flicking and tearing effect.
Code Snippet 12 Screenshot with full pixel value
2.5.9 Performance
The graphics engine has no frame buffer: it uses dynamic compositing to build up each
display line during scan out. Because of this, there is a finite amount of time available to
draw each line. This time depends on the scan out parameters (REG_PCLK and
REG_HCYCLE) but is never less than 2048 internal clock cycles.
Some performance limits:
The display list length must be less than 2048 instructions, because the
graphics engine fetches display list commands one per clock.
The graphics engine performance rending pixels is 4 pixels per clock, for any
line with 2048 display commands the total pixels performance drawn must be
less than 8192.
For some bitmap formats, the drawing rate is 1 pixel per clock. These are
TEXT8X8, TEXTVGA and PALETTED.
For bilinear filtered pixels, the drawing rate is reduced to ¼ pixel per clock.
Most bitmap formats draw at 1 pixel per clock, and the above formats
(TEXT8X8, TEXTVGA and PALETTED) draw at 1 pixel every 4 clocks.
Bit 0 - 7 : These bits are set to divide the main clock for PCLK. If the typical
main clock was 48MHz and the value of these bits are 5, the PCLK will be 9.6
MHz. If the value of these bits are zero, there will be no PCLK output.
In this chapter, all the registers in the FT800 are classified into 5 groups: Graphics
Engine Registers, Audio Engine Registers, Touch Engine Registers, and Co-processor
Engine Registers as well as Miscellaneous Registers. This chapter gives the detailed
definition for each register. To view the register summary of the FT800, please check the
datasheet instead.
In addition, please note that all the reserved bits are read-only and shall be zero. All the
hexadecimal values are prefixed with 0x. Readers are strongly encouraged to crossreference the other chapters of this document for a better understanding.
Bit 0 : This bit controls the polarity of PCLK. If it is set to zero, PCLK polarity
is on the rising edge. If it is set to one, PCLK polarity is on the falling edge.
Reserved
REG_PCLK_POL Definition
R/W
311 0
Address: 0x102464
Reset Value: 0x1
Note: NONE
Bit 0 : This bit controls the transition of RGB signals with PCLK active clock
edge. When REG_CSPREAD=0, R[7:2],G[7:2] and B[7:2] signals change
following the active edge of PCLK. When REG_CSPREAD=1, R[7:2] changes a
PCLK clock early and B[7:2] a PCLK clock later, which helps reduce the system
noise .
Bit 0 - 3 : These bits are set to control the arrangement of output RGB pins,
which may help support different LCD panel. Please check the table above for
details.
Bit 0 : Set to 1 to enable dithering feature of output RGB signals. Set to 0 to
disable dithering feature. Reading 1 from this bit means dithering feature is
enabled. Reading 0 from this bit means dithering feature is disabled.
Reserved
Note: Please refer to REG_SWIZZLE and RGB pins mapping table for
details
REG_DITHER Definition
319 80
Address: 0x102458Reset Value: 0x1B6
Note: NONE
R/W
Reserved
Bit 0 - 8: These 9 bits are split into 3 groups for Red, Green and Blue color output
signals:
Bit 0 - 2: Blue color signal lines number. Reset value is 6.
Bit 3 - 5: Green Color signal lines number. Reset value is 6.
Bit 6 - 8: Red Color signal lines number. Reset value is 6.
Host can write these bits to control the numbers of output signals for each color.
Note: After rotation is turned on, please do the screen calibration
again
Bit 0: 180 degree screen Rotation switch. Writing this bit to 0 will turn
off the rotation functionality. Writing this bit to 1 will turn on the
rotation functionality and 180 degree rotation will take place at the next
frame rendered. Reading this bit will reflect the current rotation switch
Reserved
3110 90
Note: NONE
Bit0 - 9: The value of these bits specifies how many lines for signal VSYNC takes at the start of
new frame.
Bit0 - 9: These bits are the number of total PCLK cycles per horizontal line scan. The
default value is 548 and supposed to support 480x272 screen resolution display. Please
check the display panel specification for more details.
R/W
Reserved
310
Address: 0x102424
Reset Value: 0xFFFFFFFF
Note: NONE
R/W
Bit0 - 31: These bits are used to mask the value of RGB output signals. The result will be used
to caculate the CRC value which will be updated into REG_TAP_CRC.
Bit 0 - 1: These bits can be set by the host to val i date the dis play list buffer
of the FT800. The FT800 gra phics engine wil l determine when to render the
screen , depending on what values of these bits are set:
01: Graphics engine will render the screen immediately after current line
is scanned out. It may caus e teari ng effect.
10: Graphics engine wil l render the screen immediately after current
frame is s canned out. This i s recommended in most of ca s es.
00: Do not write this value into this register.
11: Do not write this value into this register.
These bits can be al so be read by the host to check the avai labili ty of the
display l i st buffer of the FT800. If the value is read as zero, the displ ay l i st
buffer of the FT800 i s safe and ready to wri te. Otherwise, the host needs to
wait till it becomes zero.
Note: Please note the difference between REG_TAG and REG_TOUCH_TAG. REG_TAG is
updated based on the X,Y given by REG_TAG_X and REG_TAG_Y. However, REG_TOUCH_TAG
is updated based on the current touching point given by FT800 touch engine.
Bit 0 - 7 : These bits are updated with tag value by FT800 graphics engine. The tag value
here is corresponding to the touching point coordinator given in REG_TAG_X and
REG_TAG_Y. Host can read this register to check which graphics object is touched.
Reserved
R/O
319 80
Address: 0x102474Reset Value: 0x0
Note: NONE
REG_TAG_Y Definition
Bit 0 - 8 : These bits are set by host as Y coordinate of touching point, which
will enable the host to query the tag value. This register shall be used
together with REG_TAG_X and REG_TAG. Normally, in the case the host has
already captured the touching point's coordinator, this register can be
updated to query the tag value of respective touching point.
Bit 0 - 8 : These bits are set by host as X coordinate of touching point, which
will enable host to query the tag value. This register shall be used together
with REG_TAG_Y and REG_TAG. Normally, in the case the host has already
captured the touching point's coordinator, this register can be updated to
query the tag value of the respective touching point.
Note: To know it is touched or not, please check the 31st bit of
REG_TOUCH_DIRECT_XY. FT800 touch engine will do the postprocessing for these Z1 and Z2 values and update the result in
REG_TOUCH_RZ.
Bit 0 - 9 : The 10 bit ADC value for touch screen resistance Z2.
Bit 16-25: The 10 bit ADC value for touch screen resistance Z1.
Bit 0 - 9 : The 10 bit ADC value for Y coordinate
Bit 16-25: The 10 bit ADC value for X coordinate.
Bit 31 : If this bit is zero, it means a touch is being sensed and the two
fields above contains the sensed data. If this bit is one, it means no
touch is being sensed and the data in the two fields above shall be
ignored.
Note: The valid tag value range is from 1 to 255 ,therefore the default value of this
register is zero, meaning there is no touch by default.
Bit 0 - 7 : These bits are set as the tag value of the specific graphics object on the
screen which is being touched. These bits are updated once when all the lines of
the current frame is scanned out to the screen.
Bit 8 - 31: These bits are reserved.
Note: Host can read this register to check the coordinates used by the touch
engine to update the tag register REG_TOUCH_TAG.
Bit 0 - 15 : The value of these bits are the Y coordinates of the touch screen,
which was used by the touch engine to look up the tag result.
Bit 16 - 31: The value of these bits are X coordinates of the touch screen, which
was used by the touch engine to look up the tag result.
Note: This register is the final computation output of the touch engine of the
FT800. It has been mapped into screen size.
Bit 0 - 15 : The value of these bits are the Y coordinates of the touch screen.
After doing calibration, it shall be within the height of the screen size. If the
touch screen is not being touched, it shall be 0x8000.
Bit 16 - 31: The value of these bits are the X coordinates of the touch screen.
After doing calibration, it shall be within the width of the screen size. If the
touch screen is not being touched, it shall be 0x8000.
Bit 0 - 15 : These bits are the resistance of touching on the touch screen . The valid
value is from 0 to 0x7FFF. The highest value(0x7FFF) means no touch and the lowest
value (0) menas the maximum pressure.
Bit 16 - 31: Reserved
RO
Reserved
3116 150
REG_TOUCH_RAW_XY Definition
Address: 0x102508
Note: The coordinates in this register have not mapped into the screen
coordinates. To get the screen coordinates, please refer to
REG_TOUCH_SCREEN_XY .
Bit 0 - 15 : These bits are the raw Y coordinates of the touch screen before going
through transformation matrix. The valid range is from 0 to 1023. If there is no
touch on screen, the value shall be 0xFFFF.
Bit 16 - 31: These bits are the raw X coordinates going through transformation
matrix. The valid range is from 0 to 1023. If there is no touch on screen, the value
shall be 0xFFFF.
Bit 0 - 15 : These bits control the touch screen resistance threshold. Host can
adjust the touch screen touching sensitivity by setting this register. The default
value after reset is 0xFFFF and it means the lightest touch will be accepted by the
touch engine of the FT800. The host can set this register by doing experiments. The
typical value is 1200.
R/W
Reserved
314 30
REG_TOUCH_OVERSAMPLE Definition
Address: 0x102500
Reset Value: 0x7
Bit 0 - 3 : These bits control the touch screen oversample factor. The higher value
of this register causes more accuracy with more power consumption, but may not
be necessary. The valid range is from 1 to 15.
Bit 0 - 3 : These bits control the touch screen settle time , in the unit of 6 clocks. The
default value is 3, meaning the settle time is 18 (3*6) system clock cycles.
R/W
Reserved
3116 150
REG_TOUCH_CHARGE Definition
Address: 0x1024F8
Reset Value: 0x1770
Note: .
Bit 0 - 15 : These bits control the touch-screen charge time, in the unit of 6 system
clocks. The default value after reset is 6000, i.e. the charge time will be 6000*6 clock
cycles.
Bit 0 : The host can set this bit to control the ADC sampling mode of the FT800,
as per:
0: Single Ended mode . It causes l ower power consumption but with le ss
accuracy.
1: Differe ntial Mode. It causes higher power consumpti on but with more
accuracy. The default mode after reset.
312 1 0
Bit 0 - 1 : The host can set these two bits to control the touch screen sampling
mode of the FT800 touch engine, as per:
00: Off mode. No sampling happens.
01: Single mode. Cause one single sample to occur.
10: Frame mode. Cause a sample at the start of each frame.
11: Continuous mode. Up to 1000 times per seconds. Default mode after
reset.
Note: Please refer to the datasheet sector "Sound Synthesizer" for the details of this
register.
Bit 0 : A write to this bit triggers the play of synthesized sound effect specified in
REG_SOUND.
Reading value 1 in this bit means the sound effect is playing. To stop the sound effect,
the host needs to select the silence sound effect by setting up REG_SOUND and set
this register to play.
Reserved
3116 150
R/W
REG_SOUND Definition
Address: 0x102484
Reset Value: 0x0000
Note: Please refer to the datasheet sector "Sound Synthesizer" for the details
of this register.
Bit 0 - 15 : These bits are used to select the synthesized sound effect. They
are split into two group Bit 0 - 7, Bit 8- 15.
Bit 0 - 7 : These bits define the sound effect. Some of them are pitch
adjustable and the pitch is defined in Bits 8 - 15. Some of them are not pitch
adjustable and the Bits 8 - 15 will be ignored.
Bit 8 - 15: The MIDI note for the sound effect defined in Bits 0 - 7.
Note: Please refer to the datasheet section "Audio Playback" for the details of
this register.
Reserved
Bit 0 : this bit controls the audio engine to play back the audio data in RAM_G
from the start address once it consumes all the data. A value of 1 means LOOP
is enabled, a value of 0 means LOOP is disabled.
Address: 0x1024B4
Reset Value: 0x0
Note: Please read the datasheet section "Audio Playback" for more details.
Bit 0 - 1 : These bits define the format of the audio data in RAM_G. FT800
supports:
00: Linear Sample format
01: uLaw Sample format
10: 4 bit IMA ADPCM Sample format
11: Undefined.
Note: Please read the datasheet section "Audio Playback" for more details.
Bit 0 - 15 : These bits specify the sampling fequency of audio playback data.
Units is in Hz.
Reserved
R/O
3120 190
Note: Please read the datasheet section "Audio Playback" for more details.
Bit 0 - 19 : These bits are updated by the FT800 audio engine while playing audio data
from RAM_G. It is the current audio data address which is playing back. The host can
read this register to check if the audio engine has consumed all the audio data.
Bit 0 - 13 : These bits indicate the offset from RAM_DL of a display list command
generated by the coprocessor engine. The coprocessor engine depends on these
bits to determine the address in the display list buffer of generated display list
commands. The coprocessor engine will update this register as long as the display
list commands are generated into the display list buffer. By setting this register
properly, the host can specify the starting address in the display list buffer for the
coprocessor engine to generate display commands. The valid value range is from 0
to 8195.
Address: 0x1024E8
Reset Value: 0x0
Note: FIFO size of command buffer is 4096 bytes and each co-processor
instruction is of 4 bytes in size. The value to be written into this register must
be 4 bytes aligned.
Bit 0 - 11 : These bits are updated by the host MCU to inform the coprocessor
engine of the ending address of valid data feeding into its FIFO. Typically, the
host will update this register after it has downloaded the coprocessor
commands into its FIFO. The valid range is from 0 to 4095, i.e. within the size
of the FIFO.
Note: The host shall not write into this register unless in error recovery case.
Its default value is zero after the coprocessor engine is reset.
Bit 0 - 11 : These bits are updated by the coprocessor engine as long as the
coprocessor engine fetched the command from its FIFO. The host can read
this register to determine the FIFO fullness of the coprocessor engine. The
valid value range is from 0 to 4095. In the case of error, the coprocessor
engine writes 0xFFF to this register.
Bit 0 - 7 : These bits define the backlight PWM output duty cycle. The valid
range is from 0 to 128. 0 means backlight complete off, 128 means backlight in
max brightness.
Bit 0 - 13 : These bits define the backlight PWM output frequency in HZ. The
default is 250 Hz after reset. The valid frequency is from 250Hz to 10000Hz.
R/W
Reserved
318 70
Note: Please read the datasheet section "Interrupts" for more details.
Bit 0 - 7 : These bits are used to mask the corresponding interrupt. 1 means to
enable the corresponding interrupt source, 0 means to disable the
corresponding interrupt source. After reset , all the interrupt source are eligible
to trigger interrupt by default.
Note: Please refer to the datasheet section "Interrupts" for the details of this
register.
Reserved
Bit 0 : The host can set this bit to 1 to enable the global interrupt of FT800. To
disable the global interrupt of FT800, the host can set this bit to 0.
Note: Please read the datasheet section "Interrupts" for more details.
Bit 0 - 7 : These bits are interrupt flags set by the FT800. The host can read these
bits to determine which interrupt takes place. These bits are cleared
automatically by reading. The host shall not write this register. After reset,
there are no interrupts happen by default , therefore, it is 0x00.
318 70
Note: Please read the datasheet section "General Purpose IO pins" for more
details.
Bit 0 - 7 : These bits are versatile. Bit 0 , 1, 7 are used to control GPIO pin values.
Bit 2 - 6 : These are used to configure the drive strength of the pins.
Bit 0 - 7 : These bits configure the direction of GPIO pins of the FT800. Bit 0 controls
the direction of GPIO0 and Bit 7 controls the direction of GPIO7. The bit value 1
means the GPIO pin is set as an output, otherwise it means an input. After reset, only
the GPIO7 is set to output by default.
R/W
Reserved
RW
311 0
Address: 0x10241CReset Value: 0x00
Bit 1 - 31: Reserved
Bit 0: Write this bit to 1 will set the coprocessor engines of the FT800
into the reset state. Write this bit to 0 will resume from reset state to
normal operational mode. If this bit is read as 1, the FT800 coprocessor
engines are in reset state. Otherwise, FT800 corpocessor engines are in
normal state.
Bit 0 : Set this bit to enable the readout of screenshot of selected Y line.
Bit 1~31: Reserved.
REG_SCREENSHOT_READ Definition
Note: After the REG_SCREENSHOT_BUSY register is clear, this register is required to
set before reading out the screenshot of selected Y lines. The screenshot resides in
RAM_SCREENSHOT and the format of each pixel is in 32 bit BGRA format: Blue channel is in
lowest address and Alpha is in highest address.
630
Address: 0x1024D8Reset Value: 0x0
Read Only
Bit 0~63: Screen shot busy flag. Any non-zero value in these 64 bits represents the busy
status of screen shot. Zero value in these 64 bits represents the screen shot is done.
REG_SCREENSHOT_BUSY Definition
Note: After the screen shot is started, host shall read this register to determine
when the screen shot is complete.
Bit 0 : Set this bit to start screen shot if screen shot is already enabled. Screen shot is
automatically stopped when screen shot is disabled.
Bit 1~31: Reserved.
REG_SCREENSHOT_START Definition
Reserved
319
Address: 0x102414
Reset Value: 0x000
Note: NONE
Bit 0~8 : The value of these 9 bits specifies the line number to capture in horizontal direction
when screen shot is enabled.
Bit 9~31: Reserved.
REG_SCREENSHOT_Y Definition
8 0
Reserved
R/W
R/W
311 0
Address: 0x102410
Reset Value: 0x0
Bit 0 : Set this bit to enable screen shot for current frame. Clear this bit to disable the screen
shot.
Bit 1-31: Reserved.
Bit0 - 31: These bits are set 0x2DC6C00 after reset, i.e. The main clock frequency is 48MHz by
default. The value is in HZ. If the host selects the alternative frequency by using host command
CLK36M, this register must be updated accordingly.
REG_FREQUENCY Definition
310
Address: 0x102408
Reset Value: 0x00000000
Read Only
Bit0 - 31: These bits are set to zero after reset. The register counts the number of FT800 main
clock cycles since reset. If the FT800 main clock's frequency is 48Mhz, it will wrap around after
about 89 seconds.
Bit0 - 31: These bits are set to zero after reset. The register counts the number of screen
frames. If the refresh rate is 60Hz, it will wrap up till about 828 days after reset.
REG_FRAMES Definition
318 70
Address: 0x102400
Reset Value: 0x7C
Bit0 - 7: These bits are the built-in register ID. The host can read it to determine if the chip is
FT800. The value shall always be 0x7C.
The graphics engine of FT800 takes the instructions from display list memory RAM_DL in
the form of commands. Each command is 4 bytes long and one display list can be filled
up to 2048 commands since the size of RAM_DL is 8K bytes. The graphics engine of the
FT800 performs respective operation according to the definition of commands.
4.1 Graphics State
The graphics state which controls drawing is stored in the graphics context. Individual
pieces of state can be changed by the appropriate display list commands (e.g.
COLOR_RGB) and the entire state can be saved and restored using the SAVE_CONTEXT
and RESTORE_CONTEXT commands.
Note that the bitmap drawing state is special: Although the bitmap handle is part of the
graphics context, the parameters for each bitmap handle are not part of the graphics
context. They are neither saved nor restored by SAVE_CONTEXT and
RESTORE_CONTEXT. These parameters are changed using the BITMAP_SOURCE,
BITMAP_LAYOUT, and BITMAP_SIZE commands. Once these parameters are set up, they
can be utilized at any display list until they were changed.
SAVE_CONTEXT and RESTORE_CONTEXT are comprised of a 4 level stack in addition to
the current graphics context. The table below details the various parameters in the
graphics context.
Each display list command in this section lists any graphics context it sets.
4.2 Command encoding
Each display list command has a 32-bit encoding. The most significant bits of the code
determine the command. Command parameters (if any) are present in the least
significant bits. Any bits marked reserved must be zero.
The graphics primitives supported by FT800 and their respective values are mentioned
below
Table 4 FT800 Graphics Primitives list
Various bitmap formats supported by FT800 and their respective values are mentioned
below
All primitives supported by the FT800 are defined in the table above. The primitive
to be drawn is selected by the BEGIN command. Once the primitive is selected, it will be
valid till the new primitive is selected by the BEGIN command.
Please note that the primitive drawing operation will not be performed until
VERTEX2II or VERTEX2F is executed.
Bitmap handle. The initial value is 0. The valid value range is from 0 to 31.
Description
Handles 16 to 31 are defined by the FT800 for built-in font and handle 15 is
defined in the co-processor engine commands CMD_GRADIENT, CMD_BUTTON and
CMD_KEYS. Users can define new bitmaps using handles from 0 to 14. If there is
no co-processor engine command CMD_GRADIENT, CMD_BUTTON and CMD_KEYS in
the current display list, users can even define a bitmap using handle 15.
Graphics context
The value of handle is part of the graphics context, as described in section 4.1
BARGRAPH - render data as a bar graph. Looks up the x coordinate in a byte array, then
gives an opaque pixel if the byte value is less than y, otherwise a transparent pixel. The
result is a bar graph of the bitmap data. A maximum of 256x256 size bitmap can be
drawn using the BARGRAPH format. Orientation, width and height of the graph can be
altered using the bitmap transform matrix.
TEXT8X8 - lookup in a fixed 8x8 font. The bitmap is a byte array present in the graphics
ram and each byte indexes into an internal 8x8 CP437 [2] font (inbuilt font bitmap
handles 16 & 17 are used for drawing TEXT8X8 format). The result is that the bitmap
acts like a character grid. A single bitmap can be drawn which covers all or part of the
display; each byte in the bitmap data corresponds to one 8x8 pixel character cell.
TEXTVGA – lookup in a fixed 8x16 font with TEXTVGA syntax. The bitmap is a TEXTVGA
array present in the graphics ram, each element indexes into an internal 8x16 CP437 [2]
font (inbuilt font bitmap handles 18 & 19 are used for drawing TEXTVGA format with
control information such as background color, foreground color and cursor etc). The
result is that the bitmap acts like a TEXTVGA grid. A single bitmap can be drawn which
covers all or part of the display; each TEXTVGA data type in the bitmap corresponds to
one 8x16 pixel character cell.
PALETTED - bitmap bytes are indices into a palette table. By using a palette table which contains 32-bit RGBA colors - a significant amount of memory can be saved. The
256 color palette is stored in a dedicated 1K (256x4) byte RAM_PAL.
linestride
Bitmap linestride, in bytes. Please note the alignment requirement which is
described below.
height
Bitmap height, in lines
Description
The bitmap formats supported are L1, L4, L8, RGB332, ARGB2, ARGB4, ARGB1555,
RGB565 and Palette.
For L1 format, the line stride must be a multiple of 8 bits; For L4 format the line
stride must be multiple of 2 nibbles. (Aligned to byte)
For more details about alignment, please refer to the figures below:
Specify the screen drawing of bitmaps for the current handle
Encoding
Parameters
filter
Bitmap filtering mode, one of NEAREST or BILINEAR
The value of NEAREST is 0 and the value of BILINEAR is 1.
wrapx
Bitmap x wrap mode, one of REPEAT or BORDER
The value of BORDER is 0 and the value of REPEAT is 1.
wrapy
Bitmap y wrap mode, one of REPEAT or BORDER
width
Drawn bitmap width, in pixels
height
Drawn bitmap height, in pixels
Description
This command controls the drawing of bitmaps: the on-screen size of the bitmap,
the behavior for wrapping, and the filtering function. Please note that if wrapx or
wrapy is REPEAT then the corresponding memory layout dimension
(BITMAP_LAYOUT line stride or height) must be power of two, otherwise the result is
undefined.
For parameter width and height, the value from 1 to 511 means the bitmap width
and height in pixel. The value of zero means the 512 pixels in width or height.
Specify the A coefficient of the bitmap transform matrix.
Encoding
Parameters
a
Coefficient A of the bitmap transform matrix, in signed 8.8 bit fixed-point
form. The initial value is 256.
Description
BITMAP_TRANSFORM_A-F coefficients are used to perform bitmap transform
functionalities such as scaling, rotation and translation. These are similar to openGL
transform functionality.
Examples
A value of 0.5 (128) causes the bitmap appear double width: