Library for FT810 EVE chip
Fork of FT810 by
Diff: src/FT_GPU_Hal.cpp
- Revision:
- 11:435747a1f2ae
- Parent:
- 10:4c10e6aeb239
diff -r 4c10e6aeb239 -r 435747a1f2ae src/FT_GPU_Hal.cpp --- a/src/FT_GPU_Hal.cpp Sat Sep 16 18:34:14 2017 +0000 +++ b/src/FT_GPU_Hal.cpp Sat Sep 16 23:40:11 2017 +0000 @@ -37,34 +37,14 @@ ft_uint8_t chipid; /* Do a power cycle for safer side */ Powercycle( FT_TRUE); - /* - 7/8/16: Curt added the sleep delay below... - */ -// Sleep(30); - - /* Set the clk to external clock */ - HostCommand( FT_GPU_EXTERNAL_OSC); - Sleep(10); - - /* Access address 0 to wake up the FT800 */ + HostCommand(FT_GPU_EXTERNAL_OSC); HostCommand( FT_GPU_ACTIVE_M); - Sleep(500); - /* Switch PLL output to 48MHz */ -// HostCommand( FT_GPU_PLL_48M); - Sleep(10); - - /* Do a core reset for safer side */ - HostCommand( FT_GPU_CORE_RESET); - Sleep(500); - //Read Register ID to check if FT800 is ready. - chipid = Rd8( REG_ID); + //Read Register ID to check if FT811 is ready. + chipid = Rd8(REG_ID); while(chipid != 0x7C) - // Speed up - _spi.frequency(30000000); // 30 Mhz SPI clock DC -// _spi.frequency(20000000); // 20 Mhz SPI clock DC -// _spi.frequency(12000000); // 12 Mhz SPI clock + /* Configuration of LCD display */ DispHCycle = my_DispHCycle; Wr16( REG_HCYCLE, DispHCycle); @@ -94,6 +74,11 @@ DispPCLK = my_DispPCLK; Wr8( REG_PCLK, DispPCLK);//after this display is visible on the LCD + // Speed up + _spi.frequency(30000000); // 30 Mhz SPI clock DC +// _spi.frequency(20000000); // 20 Mhz SPI clock DC +// _spi.frequency(12000000); // 12 Mhz SPI clock + ft_uint8_t temp = Rd8(REG_PCLK); if (temp!=DispPCLK){DigitalOut led(LED1); led=1;} Serial pc(SERIAL_TX, SERIAL_RX); @@ -102,13 +87,12 @@ Wr16( REG_PWM_HZ, 10000); pc.printf("ID:%08X\n", Rd16(REG_PWM_HZ)); -//#ifdef Inv_Backlite // turn on backlite - //Wr16( REG_PWM_DUTY, 0); -//#else + Wr16( REG_PWM_DUTY, 127); -//#endif - Wr8( REG_GPIO_DIR,0x82); //| Rd8( REG_GPIO_DIR)); - Wr8( REG_GPIO,0x080); //| Rd8( REG_GPIO)); + //Wr8( REG_GPIO_DIR,0x82); //| Rd8( REG_GPIO_DIR)); + //Wr8( REG_GPIO,0x080); //| Rd8( REG_GPIO)); + Wr8( REG_GPIO_DIR,0x82| Rd8( REG_GPIO_DIR)); + Wr8( REG_GPIO,0x80| Rd8( REG_GPIO)); Wr32( RAM_DL, CLEAR(1,1,1)); Wr32( RAM_DL+4, DISPLAY()); @@ -118,8 +102,6 @@ /* Touch configuration - configure the resistance value to 1200 - this value is specific to customer requirement and derived by experiment */ Wr16( REG_TOUCH_RZTHRESH,1200); -// Wr16( REG_TOUCH_RZTHRESH,0xFFFF); - }