Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /****************************************************************************************
- *
- * FTDIChip FT811 with Chipkit uC32 - Version 1.0
- *
- ****************************************************************************************
- * File Name: FT81x.h
- * Purpose: This header file contains the display list and graphics processor
- * commands for the FTDI FT81x series graphics controllers.
- * MCU: Chipkit uC32 (or Arduino)
- *
- * Software License Agreement
- *
- * This code is provided as an example only and is not guaranteed.
- * The developer of the final application incorporating any parts of this
- * sample project is responsible for ensuring its safe and correct operation
- * and for any consequences resulting from its use.
- *
- ****************************************************************************************/
- #define FT_DL_SIZE (8*1024) //8KB Display List buffer size
- #define FT_CMD_FIFO_SIZE (4*1024) //4KB coprocessor Fifo size
- #define FT_CMD_SIZE (4) //4 byte per coprocessor command of EVE
- // FT811 Chip Commands - use with cmdWrite
- #define FT800_ACTIVE 0x00 // Initializes FT800
- #define FT800_STANDBY 0x41 // Place FT800 in Standby (clk running)
- #define FT800_SLEEP 0x42 // Place FT800 in Sleep (clk off)
- #define FT800_PWRDOWN 0x50 // Place FT800 in Power Down (core off)
- #define FT800_CLKEXT 0x44 // Select external clock source
- #define FT800_CLK48M 0x62 // Select 48MHz PLL
- #define FT800_CLK36M 0x61 // Select 36MHz PLL
- #define FT800_CORERST 0x68 // Reset core - all registers default
- // COLOURS defined here (optional)
- #define RED 0xFF0000UL // Red
- #define GREEN 0x00FF00UL // Green
- #define BLUE 0x0000FFUL // Blue
- #define WHITE 0xFFFFFFUL // White
- #define BLACK 0x000000UL // Black
- #define YELLOW 0xffff00UL // Yellow
- #define MAGENTA 0x00ffffUL // Magenta
- #define SILVER 0xC0C0C0UL // Silver
- #define DARK_RED 0x8B0000UL // Dark Red
- // FT81x Registers
- // -- Register Name Address (hex) Reset value
- #define REG_ID 0x302000UL // 7Ch
- #define REG_FRAMES 0x302004UL // 0
- #define REG_CLOCK 0x302008UL // 0
- #define REG_FREQUENCY 0x30200CUL // 60000000
- #define REG_RENDERMODE 0x302010UL // 0
- #define REG_SNAPY 0x302014UL // 0
- #define REG_SNAPSHOT 0x302018UL
- #define REG_SNAPFORMAT 0x30201CUL // 20h
- #define REG_CPURESET 0x302020UL // 2
- #define REG_TAP_CRC 0x302024UL
- #define REG_TAP_MASK 0x302028UL // FFFFFFFFh
- #define REG_HCYCLE 0x30202CUL // 224h
- #define REG_HOFFSET 0x302030UL // 02Bh
- #define REG_HSIZE 0x302034UL // 1E0h
- #define REG_HSYNC0 0x302038UL // 000h
- #define REG_HSYNC1 0x30203CUL // 029h
- #define REG_VCYCLE 0x302040UL // 124h
- #define REG_VOFFSET 0x302044UL // 00Ch
- #define REG_VSIZE 0x302048UL // 110h
- #define REG_VSYNC0 0x30204CUL // 000h
- #define REG_VSYNC1 0x302050UL // 00Ah
- #define REG_DLSWAP 0x302054UL // 0
- #define REG_ROTATE 0x302058UL // 0
- #define REG_OUTBITS 0x30205CUL // 1B6h/000h
- #define REG_DITHER 0x302060UL // 1
- #define REG_SWIZZLE 0x302064UL // 0
- #define REG_CSPREAD 0x302068UL / / 1
- #define REG_PCLK_POL 0x30206CUL // 0
- #define REG_PCLK 0x302070UL // 0
- #define REG_TAG_X 0x302074UL // 0
- #define REG_TAG_Y 0x302078UL // 0
- #define REG_TAG 0x30207CUL // 0
- #define REG_VOL_PB 0x302080UL // FFh
- #define REG_VOL_SOUND 0x302084UL // FFh
- #define REG_SOUND 0x302088UL // 0
- #define REG_PLAY 0x30208CUL // 0h
- #define REG_GPIO_DIR 0x302090UL // 80h
- #define REG_GPIO 0x302094UL // 00h
- #define REG_GPIOX_DIR 0x302098UL // 8000h
- #define REG_GPIOX 0x30209CUL // 0080h
- #define REG_INT_FLAGS 0x3020A8UL // 00h
- #define REG_INT_EN 0x3020AcUL // 0
- #define REG_INT_MASK 0x3020B0UL // FFh
- #define REG_PLAYBACK_START 0x3020B4UL // 0
- #define REG_PLAYBACK_LENGTH 0x3020B8UL // 0
- #define REG_PLAYBACK_READPTR 0x3020BCUL
- #define REG_PLAYBACK_FREQ 0x3020C0UL // 8000
- #define REG_PLAYBACK_FORMAT 0x3020C4UL // 0
- #define REG_PLAYBACK_LOOP 0x3020C8UL // 0
- #define REG_PLAYBACK_PLAY 0x3020CCUL // 0
- #define REG_PWM_HZ 0x3020D0UL // 250
- #define REG_PWM_DUTY 0x3020D4UL // 128
- #define REG_MACRO_0 0x3020D8UL // 0
- #define REG_MACRO_1 0x3020DCUL // 0
- #define REG_CMD_READ 0x3020F8UL // 0
- #define REG_CMD_WRITE 0x3020FCUL // 0
- #define REG_CMD_DL 0x302100UL // 0
- #define REG_TOUCH_MODE 0x302104UL // 3
- #define REG_TOUCH_ADC_MODE 0x302108UL // 1
- #define REG_CTOUCH_EXTENDED 0x302108UL // 1
- #define REG_TOUCH_CHARGE 0x30210CUL // 9000
- #define REG_TOUCH_SETTLE 0x302110UL // 3
- #define REG_TOUCH_OVERSAMPLE 0x302114UL // 7
- #define REG_TOUCH_RZTHRESH 0x302118UL // FFFFh
- #define REG_TOUCH_RAW_XY 0x30211CUL
- #define REG_CTOUCH_TOUCH1_XY 0x30211CUL
- #define REG_TOUCH_RZ 0x302120UL
- #define REG_CTOUCH_TOUCH4_Y 0x302124UL
- #define REG_TOUCH_SCREEN_XY 0x302128UL
- #define REG_CTOUCH_TOUCH0_XY 0x302128UL
- #define REG_TOUCH_TAG_XY 0x302128UL
- #define REG_TOUCH_TAG 0x30212CUL
- #define REG_TOUCH_TAG1_XY 0x302130UL
- #define REG_TOUCH_TAG1 0x302134UL
- #define REG_TOUCH_TAG2_XY 0x302138UL
- #define REG_TOUCH_TAG2 0x30213CUL
- #define REG_TOUCH_TAG3_XY 0x302140UL
- #define REG_TOUCH_TAG3 0x302144UL
- #define REG _TOUCH_TAG4_XY 0x302148UL
- #define REG_TOUCH_TAG4 0x30214CUL
- #define REG_TOUCH_TRANSFORM_A 0x302150UL // 00010000h
- #define REG_TOUCH_TRANSFORM_B 0x302154UL // 00000000h
- #define REG_TOUCH_TRANSFORM_C 0x302158UL // 00000000h
- #define REG_TOUCH_TRANSFORM_D 0x30215CUL // 00000000h
- #define REG_TOUCH_TRANSFORM_E 0x302160UL // 00010000h
- #define REG_TOUCH_TRANSFORM_F 0x302164UL // 00000000h
- #define REG_TOUCH_CONFIG 0x302168UL
- #define REG_CTOUCH_TOUCH4_X 0x30216CUL
- #define REG_BIST_EN 0x302174UL // 0
- #define REG_TRIM 0x302180UL
- #define REG_ANA_COMP 0x302184UL
- #define REG_SPI_WIDTH 0x302188UL
- #define REG_TOUCH_DIRECT_XY 0x30218CUL
- #define REG_CTOUCH_TOUCH2_XY 0x30218CUL
- #define REG_TOUCH_DIRECT_Z1Z2 0x302190UL
- #define REG_CTOUCH_TOUCH3_XY 0x302190UL
- #define REG_DATESTAMP 0x302564UL
- #define REG_CMDB_SPACE 0x302574UL // FFCh
- #define REG_CMDB_WRITE 0x302578UL
- // FT81x Memory Map Addresses
- // -- Register Name Start Addr. End Address Description
- #define RAM_G 0x000000UL // 0x0FFFFF 1024 kB Graphics RAM
- #define RAM_DL 0x300000UL // 0x301FFF 8 kB Display List RAM
- #define RAM_REG 0x302000UL // 0x302FFF 4 kB Registers
- #define RAM_CMD 0x308000UL // 0x308FFF 4 kb Command Buffer
- #define RAM_PAL 0x102000UL //
- #define ROM_FONT 0x1E0000UL // 0x2FFFFB 1152 kB Font table and bitmap
- #define ROM_FONT_ADDR 0x2FFFFCUL // 0x2FFFFF 4 B Font table pointer address
- // Display list commands to be embedded in Graphics Processor
- #define DL_ALPHA_FUNC 0x09000000UL // requires OR'd arguments
- #define DL_BITMAP_HANDLE 0x05000000UL // requires OR'd arguments
- #define DL_BITMAP_LAYOUT 0x07000000UL // requires OR'd arguments
- #define DL_BITMAP_SIZE 0x08000000UL // requires OR'd arguments
- #define DL_BITMAP_SOURCE 0x01000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_A 0x15000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_B 0x16000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_C 0x17000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_D 0x18000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_E 0x19000000UL // requires OR'd arguments
- #define DL_BITMAP_TFORM_F 0x1A000000UL // requires OR'd arguments
- #define DL_BLEND_FUNC 0x0B000000UL // requires OR'd arguments
- #define DL_BEGIN 0x1F000000UL // requires OR'd arguments
- #define DL_CALL 0x1D000000UL // requires OR'd arguments
- #define DL_CLEAR 0x26000000UL // requires OR'd arguments
- #define DL_CELL 0x06000000UL // requires OR'd arguments
- #define DL_CLEAR_RGB 0x02000000UL // requires OR'd arguments
- #define DL_CLEAR_STENCIL 0x11000000UL // requires OR'd arguments
- #define DL_CLEAR_TAG 0x12000000UL // requires OR'd arguments
- #define DL_COLOR_A 0x0F000000UL // requires OR'd arguments
- #define DL_COLOR_MASK 0x20000000UL // requires OR'd arguments
- #define DL_COLOR_RGB 0x04000000UL // requires OR'd arguments
- #define DL_DISPLAY 0x00000000UL
- #define DL_END 0x21000000UL
- #define DL_JUMP 0x1E000000UL // requires OR'd arguments
- #define DL_LINE_WIDTH 0x0E000000UL // requires OR'd arguments
- #define DL_MACRO 0x25000000UL // requires OR'd arguments
- #define DL_POINT_SIZE 0x0D000000UL // requires OR'd arguments
- #define DL_RESTORE_CONTEXT 0x23000000UL
- #define DL_RETURN 0x24000000UL
- #define DL_SAVE_CONTEXT 0x22000000UL
- #define DL_SCISSOR_SIZE 0x1C000000UL // requires OR'd arguments
- #define DL_SCISSOR_XY 0x1B000000UL // requires OR'd arguments
- #define DL_STENCIL_FUNC 0x0A000000UL // requires OR'd arguments
- #define DL_STENCIL_MASK 0x13000000UL // requires OR'd arguments
- #define DL_STENCIL_OP 0x0C000000UL // requires OR'd arguments
- #define DL_TAG 0x03000000UL // requires OR'd arguments
- #define DL_TAG_MASK 0x14000000UL // requires OR'd arguments
- #define DL_VERTEX2F 0x40000000UL // requires OR'd arguments
- #define DL_VERTEX2II 0x02000000UL // requires OR'd arguments
- // Command and register value options
- #define CLR_COL 0x4
- #define CLR_STN 0x2
- #define CLR_TAG 0x1
- #define DECR 4UL
- #define DECR_WRAP 7UL
- #define DLSWAP_DONE 0UL
- #define DLSWAP_FRAME 2UL
- #define DLSWAP_LINE 1UL
- #define DST_ALPHA 3UL
- #define EDGE_STRIP_A 7UL
- #define EDGE_STRIP_B 8UL
- #define EDGE_STRIP_L 6UL
- #define EDGE_STRIP_R 5UL
- #define EQUAL 5UL
- #define GEQUAL 4UL
- #define GREATER 3UL
- #define INCR 3UL
- #define INCR_WRAP 6UL
- #define INT_CMDEMPTY 32UL
- #define INT_CMDFLAG 64UL
- #define INT_CONVCOMPLETE 128UL
- #define INT_PLAYBACK 16UL
- #define INT_SOUND 8UL
- #define INT_SWAP 1UL
- #define INT_TAG 4UL
- #define INT_TOUCH 2UL
- #define INVERT 5UL
- #define KEEP 1UL
- #define L1 1UL
- #define L4 2UL
- #define L8 3UL
- #define LEQUAL 2UL
- #define LESS 1UL
- #define LINEAR_SAMPLES 0UL
- #define LINES 3UL
- #define LINE_STRIP 4UL
- #define NEAREST 0UL
- #define NEVER 0UL
- #define NOTEQUAL 6UL
- #define ONE 1UL
- #define ONE_MINUS_DST_ALPHA 5UL
- #define ONE_MINUS_SRC_ALPHA 4UL
- #define OPT_CENTER 1536UL // 0x6000
- #define OPT_CENTERX 512UL // 0x0200
- #define OPT_CENTERY 1024UL // 0x0400
- #define OPT_FLAT 256UL // 0x0100
- #define OPT_MONO 1UL
- #define OPT_NOBACK 4096UL // 0x1000
- #define OPT_NODL 2UL
- #define OPT_NOHANDS 49152UL // 0xC168
- #define OPT_NOHM 16384UL // 0x4000
- #define OPT_NOPOINTER 16384UL // 0x4000
- #define OPT_NOSECS 32768UL // 0x8000
- #define OPT_NOTICKS 8192UL // 0x2000
- #define OPT_RIGHTX 2048UL // 0x0800
- #define OPT_SIGNED 256UL // 0x0100
- #define PALETTED 8UL
- #define PLAYCOLOR 0x00a0a080
- #define FTPOINTS 2UL // "POINTS" is a reserved word
- #define RECTS 9UL
- #define REPEAT 1UL
- #define REPLACE 2UL
- #define RGB332 4UL
- #define RGB565 7UL
- #define SRC_ALPHA 2UL
- #define TEXT8X8 9UL
- #define TEXTVGA 10UL
- #define TOUCHMODE_CONTINUOUS 3UL
- #define TOUCHMODE_FRAME 2UL
- #define TOUCHMODE_OFF 0UL
- #define TOUCHMODE_ONESHOT 1UL
- #define ULAW_SAMPLES 1UL
- #define ZERO 0UL
- #define ADC_DIFFERENTIAL 1UL
- #define ADC_SINGLE_ENDED 0UL
- #define ADPCM_SAMPLES 2UL
- #define ALWAYS 7UL
- #define ARGB1555 0UL
- #define ARGB2 5UL
- #define ARGB4 6UL
- #define BARGRAPH 11UL
- #define BILINEAR 1UL
- #define BITMAPS 1UL
- #define BORDER 0UL
- #define CMDBUF_SIZE 4096UL
- #define CMD_APPEND 4294967070UL
- #define CMD_BGCOLOR 4294967049UL
- #define CMD_BITMAP_TRANSFORM 4294967073UL
- #define CMD_BUTTON 4294967053UL
- #define CMD_CALIBRATE 4294967061UL
- #define CMD_CLOCK 4294967060UL
- #define CMD_COLDSTART 4294967090UL
- #define CMD_CRC 4294967043UL
- #define CMD_CSKETCH 4294967093UL
- #define CMD_DIAL 4294967085UL
- #define CMD_DLSTART 4294967040UL
- #define CMD_EXECUTE 4294967047UL
- #define CMD_FGCOLOR 4294967050UL
- #define CMD_GAUGE 4294967059UL
- #define CMD_GETMATRIX 4294967091UL
- #define CMD_GETPOINT 4294967048UL
- #define CMD_GETPROPS 4294967077UL
- #define CMD_GETPTR 4294967075UL
- #define CMD_GRADCOLOR 4294967092UL
- #define CMD_GRADIENT 4294967051UL
- #define CMD_HAMMERAUX 4294967044UL
- #define CMD_IDCT_DELETED 4294967046UL
- #define CMD_INFLATE 4294967074UL
- #define CMD_INTERRUPT 4294967042UL
- #define CMD_INT_RAMSHARED 4294967101UL
- #define CMD_INT_SWLOADIMAGE 4294967102UL
- #define CMD_KEYS 4294967054UL
- #define CMD_LOADIDENTITY 4294967078UL
- #define CMD_LOADIMAGE 4294967076UL
- #define CMD_LOGO 4294967089UL
- #define CMD_MARCH 4294967045UL
- #define CMD_MEDIAFIFO 4294967097UL
- #define CMD_MEMCPY 4294967069UL
- #define CMD_MEMCRC 4294967064UL
- #define CMD_MEMSET 4294967067UL
- #define CMD_MEMWRITE 4294967066UL
- #define CMD_MEMZERO 4294967068UL
- #define CMD_NUMBER 4294967086UL
- #define CMD_PLAYVIDEO 4294967098UL
- #define CMD_PROGRESS 4294967055UL
- #define CMD_REGREAD 4294967065UL
- #define CMD_ROMFONT 4294967103UL
- #define CMD_ROTATE 4294967081UL
- #define CMD_SCALE 4294967080UL
- #define CMD_SCREENSAVER 4294967087UL
- #define CMD_SCROLLBAR 4294967057UL
- #define CMD_SETBASE 4294967096UL
- #define CMD_SETBITMAP 4294967107UL
- #define CMD_SETFONT 4294967083UL
- #define CMD_SETFONT2 4294967099UL
- #define CMD_SETMATRIX 4294967082UL
- #define CMD_SETROTATE 4294967094UL
- #define CMD_SETSCRATCH 4294967100UL
- #define CMD_SKETCH 4294967088UL
- #define CMD_SLIDER 4294967056UL
- #define CMD_SNAPSHOT 4294967071UL
- #define CMD_SNAPSHOT2 4294967095UL
- #define CMD_SPINNER 4294967062UL
- #define CMD_STOP 4294967063UL
- #define CMD_SWAP 4294967041UL
- #define CMD_SYNC 4294967106UL
- #define CMD_TEXT 4294967052UL
- #define CMD_TOGGLE 4294967058UL
- #define CMD_TOUCH_TRANSFORM 4294967072UL
- #define CMD_TRACK 4294967084UL
- #define CMD_TRANSLATE 4294967079UL
- #define CMD_VIDEOFRAME 4294967105UL
- #define CMD_VIDEOSTART 4294967104UL
- #define DECR 4UL
- #define DLSWAP_DONE 0UL
- #define DLSWAP_FRAME 2UL
- #define DLSWAP_LINE 1UL
- #define DST_ALPHA 3UL
- #define EDGE_STRIP_A 7UL
- #define EDGE_STRIP_B 8UL
- #define EDGE_STRIP_L 6UL
- #define EDGE_STRIP_R 5UL
- #define EQUAL 5UL
- #define GEQUAL 4UL
- #define GREATER 3UL
- #define INCR 3UL
- #define INT_CMDEMPTY 32UL
- #define INT_CMDFLAG 64UL
- #define INT_CONVCOMPLETE 128UL
- #define INT_G8 18UL
- #define INT_L8C 12UL
- #define INT_PLAYBACK 16UL
- #define INT_SOUND 8UL
- #define INT_SWAP 1UL
- #define INT_TAG 4UL
- #define INT_TOUCH 2UL
- #define INT_VGA 13UL
- #define INVERT 5UL
- #define KEEP 1UL
- #define L1 1UL
- #define L2 17UL
- #define L4 2UL
- #define L8 3UL
- #define LEQUAL 2UL
- #define LESS 1UL
- #define LINEAR_SAMPLES 0UL
- #define LINES 3UL
- #define LINE_STRIP 4UL
- #define NEAREST 0UL
- #define NEVER 0UL
- #define NOTEQUAL 6UL
- #define ONE 1UL
- #define ONE_MINUS_DST_ALPHA 5UL
- #define ONE_MINUS_SRC_ALPHA 4UL
- #define OPT_CENTER 1536UL
- #define OPT_CENTERX 512UL
- #define OPT_CENTERY 1024UL
- #define OPT_FLAT 256UL
- #define OPT_FULLSCREEN 8UL
- #define OPT_MEDIAFIFO 16UL
- #define OPT_MONO 1UL
- #define OPT_NOBACK 4096UL
- #define OPT_NODL 2UL
- #define OPT_NOHANDS 49152UL
- #define OPT_NOHM 16384UL
- #define OPT_NOPOINTER 16384UL
- #define OPT_NOSECS 32768UL
- #define OPT_NOTEAR 4UL
- #define OPT_NOTICKS 8192UL
- #define OPT_RIGHTX 2048UL
- #define OPT_SIGNED 256UL
- #define OPT_SOUND 32UL
- #define PALETTED 8UL
- #define PALETTED4444 15UL
- #define PALETTED565 14UL
- #define PALETTED8 16UL
- #define FTPOINTS 2UL
- #define RAM_CMD 3178496UL
- #define RAM_DL 3145728UL
- #define RAM_G 0UL
- #define RAM_REG 3153920UL
- #define RAM_ROMSUB 3186688UL
- #define RECTS 9UL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement