Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of FT800_3 by
Diff: FT_Gpu_Hal.h
- Revision:
- 7:a69ac4d39afd
- Parent:
- 6:16e22c789f7d
- Child:
- 8:4601ccd8a927
diff -r 16e22c789f7d -r a69ac4d39afd FT_Gpu_Hal.h --- a/FT_Gpu_Hal.h Tue Feb 10 23:32:22 2015 +0000 +++ b/FT_Gpu_Hal.h Wed Feb 24 14:04:34 2016 +0000 @@ -15,21 +15,21 @@ * ported to mbed by Peter Drescher, DC2PD 2014 * */ - + #ifndef FT_GPU_HAL_H #define FT_GPU_HAL_H - + #include "mbed.h" #include "FT_DataTypes.h" - + typedef enum { FT_GPU_I2C_MODE = 0, FT_GPU_SPI_MODE, - + FT_GPU_MODE_COUNT, FT_GPU_MODE_UNKNOWN = FT_GPU_MODE_COUNT } FT_GPU_HAL_MODE_E; - + typedef enum { OPENED, READING, @@ -38,28 +38,28 @@ STATUS_COUNT, STATUS_ERROR = STATUS_COUNT } FT_GPU_HAL_STATUS_E; - + typedef struct { ft_uint8_t reserved; } Ft_Gpu_App_Context_t; - + typedef struct { /* Total number channels for libmpsse */ ft_uint32_t TotalChannelNum; } Ft_Gpu_HalInit_t; - + typedef enum { FT_GPU_READ = 0, FT_GPU_WRITE, } FT_GPU_TRANSFERDIR_T; - - + + typedef struct { ft_uint32_t length; //IN and OUT ft_uint32_t address; ft_uint8_t *buffer; } Ft_Gpu_App_Transfer_t; - + class FT800 { public: @@ -69,19 +69,19 @@ PinName ss, PinName intr, PinName pd); - + private: SPI _spi; - DigitalOut _ss; - DigitalOut _pd; - InterruptIn _f800_isr; + DigitalOut _ss; + DigitalOut _pd; + InterruptIn _f800_isr; public: /* Global used for buffer optimization */ //Ft_Gpu_Hal_Context_t host,*phost; Ft_Gpu_App_Context_t app_header; ft_uint16_t cmd_fifo_wp; //coprocessor fifo write pointer ft_uint16_t dl_buff_wp; //display command memory write pointer - FT_GPU_HAL_STATUS_E status; //OUT + FT_GPU_HAL_STATUS_E status; //OUT ft_void_t* hal_handle; //IN/OUT ft_uint32_t CmdBuffer_Index; ft_uint32_t DlBuffer_Index; @@ -98,40 +98,40 @@ ft_uint8_t DispPCLK; ft_char8_t DispSwizzle; ft_char8_t DispPCLKPol; - - + + ft_void_t BootupConfig(void); ft_bool_t Bootup(void); - - + + /*The basic APIs Level 1*/ ft_bool_t Init( ); ft_bool_t Open( ); - + /*The APIs for reading/writing transfer continuously only with small buffer system*/ ft_void_t StartTransfer(FT_GPU_TRANSFERDIR_T rw,ft_uint32_t addr); ft_uint8_t Transfer8(ft_uint8_t value); ft_uint16_t Transfer16(ft_uint16_t value); ft_uint32_t Transfer32(ft_uint32_t value); ft_void_t EndTransfer( ); - + /*Read & Write APIs for both burst and single transfer,depending on buffer size*/ ft_void_t Read(Ft_Gpu_App_Transfer_t *transfer); ft_void_t Write(Ft_Gpu_App_Transfer_t *transfer); - + ft_void_t Close(); ft_void_t DeInit(); - + /*Helper function APIs Read*/ ft_uint8_t Rd8(ft_uint32_t addr); ft_uint16_t Rd16(ft_uint32_t addr); ft_uint32_t Rd32(ft_uint32_t addr); - + /*Helper function APIs Write*/ ft_void_t Wr8(ft_uint32_t addr, ft_uint8_t v); ft_void_t Wr16(ft_uint32_t addr, ft_uint16_t v); ft_void_t Wr32(ft_uint32_t addr, ft_uint32_t v); - + /*******************************************************************************/ /*******************************************************************************/ /*APIs for coprocessor Fifo read/write and space management*/ @@ -142,11 +142,11 @@ ft_void_t ResetCmdFifo(); ft_void_t CheckCmdBuffer(ft_uint16_t count); ft_void_t ResetDLBuffer(); - + ft_void_t StartCmdTransfer(FT_GPU_TRANSFERDIR_T rw, ft_uint16_t count); ft_void_t Powercycle(ft_bool_t up); - - + + /*******************************************************************************/ /*******************************************************************************/ /*APIs for Host Commands*/ @@ -159,16 +159,16 @@ FT_GPU_PLL_36M = 0x61, FT_GPU_PLL_24M = 0x64, } FT_GPU_PLL_FREQ_T; - + typedef enum { FT_GPU_ACTIVE_M = 0x00, FT_GPU_STANDBY_M = 0x41,//default FT_GPU_SLEEP_M = 0x42, FT_GPU_POWERDOWN_M = 0x50, } FT_GPU_POWER_MODE_T; - + #define FT_GPU_CORE_RESET (0x68) - + ft_int32_t hal_strlen(const ft_char8_t *s); ft_void_t Sleep(ft_uint16_t ms); ft_void_t ClockSelect(FT_GPU_PLL_SOURCE_T pllsource); @@ -184,7 +184,7 @@ ft_uint8_t TransferString(const ft_char8_t *string); ft_void_t HostCommand(ft_uint8_t cmd); ft_int32_t Dec2Ascii(ft_char8_t *pSrc,ft_int32_t value); - + ft_void_t Text(ft_int16_t x, ft_int16_t y, ft_int16_t font, ft_uint16_t options, const ft_char8_t* s); ft_void_t Number(ft_int16_t x, ft_int16_t y, ft_int16_t font, ft_uint16_t options, ft_int32_t n); ft_void_t LoadIdentity(); @@ -230,9 +230,9 @@ ft_void_t Snapshot(ft_uint32_t ptr); ft_void_t ScreenSaver(); ft_void_t Memcrc(ft_uint32_t ptr, ft_uint32_t num, ft_uint32_t result); - + ft_void_t Logo(); - + ft_void_t SendCmd( ft_uint32_t cmd); ft_void_t SendStr( const ft_char8_t *s); ft_void_t StartFunc( ft_uint16_t count); @@ -240,9 +240,9 @@ ft_void_t TouchTransform( ft_int32_t x0, ft_int32_t y0, ft_int32_t x1, ft_int32_t y1, ft_int32_t x2, ft_int32_t y2, ft_int32_t tx0, ft_int32_t ty0, ft_int32_t tx1, ft_int32_t ty1, ft_int32_t tx2, ft_int32_t ty2, ft_uint16_t result); ft_void_t BitmapTransform( ft_int32_t x0, ft_int32_t y0, ft_int32_t x1, ft_int32_t y1, ft_int32_t x2, ft_int32_t y2, ft_int32_t tx0, ft_int32_t ty0, ft_int32_t tx1, ft_int32_t ty1, ft_int32_t tx2, ft_int32_t ty2, ft_uint16_t result); ft_void_t MemCrc( ft_uint32_t ptr, ft_uint32_t num, ft_uint32_t result); - + ft_uint16_t fifo_Freespace( ); - + ft_void_t DL(ft_uint32_t cmd); ft_void_t WrDlCmd_Buffer(ft_uint32_t cmd); ft_void_t Flush_DL_Buffer(); @@ -250,18 +250,18 @@ ft_void_t fadeout(); ft_void_t fadein(); ft_void_t DLSwap(ft_uint8_t DL_Swap_Type); - - ft_void_t Sound_ON(); - ft_void_t Sound_OFF(); - - int Load_jpg(char* filename, ft_int16_t* x_size, ft_int16_t* y_size); - ft_void_t Calibrate(); - ft_void_t read_calibrate(ft_uint8_t data[24]); - ft_void_t write_calibrate(ft_uint8_t data[24]); - - ft_uint32_t color_rgb(ft_uint8_t red,ft_uint8_t green, ft_uint8_t blue); - ft_uint32_t clear_color_rgb(ft_uint8_t red,ft_uint8_t green, ft_uint8_t blue); - + + ft_void_t Sound_ON(); + ft_void_t Sound_OFF(); + + int Load_jpg(char* filename, ft_int16_t* x_size, ft_int16_t* y_size); + ft_void_t Calibrate(); + ft_void_t read_calibrate(ft_uint8_t data[24]); + ft_void_t write_calibrate(ft_uint8_t data[24]); + + ft_uint32_t color_rgb(ft_uint8_t red,ft_uint8_t green, ft_uint8_t blue); + ft_uint32_t clear_color_rgb(ft_uint8_t red,ft_uint8_t green, ft_uint8_t blue); + }; // end of class - + #endif /*FT_GPU_HAL_H*/ \ No newline at end of file