Library for FT810 EVE chip
Fork of FT810 by
Diff: src/FT_GPU_Hal.cpp
- Revision:
- 10:4c10e6aeb239
- Parent:
- 8:b5a41d1581ad
- Child:
- 11:435747a1f2ae
--- a/src/FT_GPU_Hal.cpp Thu Dec 22 20:19:22 2016 +0000 +++ b/src/FT_GPU_Hal.cpp Sat Sep 16 18:34:14 2017 +0000 @@ -1,15 +1,6 @@ -/* mbed Library for FTDI FT800 Enbedded Video Engine "EVE" - * based on Original Code Sample from FTDI - * ported to mbed by Peter Drescher, DC2PD 2014 - * Released under the MIT License: http://mbed.org/license/mit - * 19.09.14 changed to shorter function names - * FTDI was using very long names. - * Ft_App_Flush_Co_Buffer -> Flush_Co_Buffer ... */ - #include "FT_Platform.h" #include "mbed.h" #include "FT_LCD_Type.h" -//Serial pc(USBTX, USBRX); FT800::FT800(PinName mosi, PinName miso, @@ -33,7 +24,7 @@ ft_bool_t FT800::Bootup(void){ -// terminal.printf("Bootup() entered\r\n"); + //pc.printf("Bootup() entered\r\n"); Open(); BootupConfig(); @@ -68,11 +59,8 @@ Sleep(500); //Read Register ID to check if FT800 is ready. chipid = Rd8( REG_ID); -// chipid = Rd8(0x0C0000); -// pc.printf("ID%08X\n", chipid); while(chipid != 0x7C) - - + // Speed up _spi.frequency(30000000); // 30 Mhz SPI clock DC // _spi.frequency(20000000); // 20 Mhz SPI clock DC @@ -102,13 +90,20 @@ Wr8( REG_SWIZZLE, DispSwizzle); DispPCLKPol = my_DispPCLKPol; Wr8( REG_PCLK_POL, DispPCLKPol); - Wr8( REG_CSPREAD, 0); + Wr8( REG_CSPREAD, 0); DispPCLK = my_DispPCLK; Wr8( REG_PCLK, DispPCLK);//after this display is visible on the LCD + + ft_uint8_t temp = Rd8(REG_PCLK); + if (temp!=DispPCLK){DigitalOut led(LED1); led=1;} + Serial pc(SERIAL_TX, SERIAL_RX); + ft_uint8_t chipid1 = Rd8(0x0C0000); + pc.printf("ID:%08X\n", chipid1); 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); + //Wr16( REG_PWM_DUTY, 0); //#else Wr16( REG_PWM_DUTY, 127); //#endif @@ -122,8 +117,8 @@ Wr16( REG_PCLK, DispPCLK); /* Touch configuration - configure the resistance value to 1200 - this value is specific to customer requirement and derived by experiment */ -// Wr16( REG_TOUCH_RZTHRESH,2400); - Wr16( REG_TOUCH_RZTHRESH,0xFFFF); + Wr16( REG_TOUCH_RZTHRESH,1200); +// Wr16( REG_TOUCH_RZTHRESH,0xFFFF); }