44#ifdef BT8XXEMU_PLATFORM
48 EVE_emuMain(int32_t argc, char *argv[]) \
64#if defined(BT81XA_ENABLE)
68#if defined(BT81X_ENABLE)
72#define PROGMEM eve_progmem
73#define PROGMEM_CONST eve_progmem_const
75#define FIFO_SIZE_MASK EVE_FIFO_SIZE_MASK
76#define FIFO_BYTE_ALIGNMENT_MASK EVE_FIFO_BYTE_ALIGNMENT_MASK
81#define uchar8_t uint8_t
98#define FT800_SEL_PIN 0
105#define DispWidth phost->Width
106#define DispHeight phost->Height
108#define GPU_HAL_MODE_E EVE_MODE_T
109#define GPU_I2C_MODE EVE_MODE_I2C
110#define GPU_SPI_MODE EVE_MODE_SPI
112#define GPU_HAL_STATUS_E EVE_STATUS_T
113#define GPU_HAL_CLOSED EVE_STATUS_CLOSED
114#define GPU_HAL_OPENED EVE_STATUS_OPENED
115#define GPU_HAL_READING EVE_STATUS_READING
116#define GPU_HAL_WRITING EVE_STATUS_WRITING
117#define GPU_HAL_STATUS_ERROR EVE_STATUS_ERROR
119#define GPU_TRANSFERDIR_T EVE_TRANSFER_T
120#define GPU_READ EVE_TRANSFER_READ
121#define GPU_WRITE EVE_TRANSFER_WRITE
123#define Gpu_Hal_Callback_t EVE_Callback
124#define Gpu_Hal_Config_t EVE_HalParameters
126#define EVE_FIFO_SIZE_MASK EVE_CMD_FIFO_MASK
127#define EVE_FIFO_BYTE_ALIGNMENT_MASK EVE_CMD_FIFO_ALIGNMENT_MASK
134#define Gpu_Hal_Context_t EVE_HalContext
135#define hal_config Parameters
136#define spi_clockrate_khz SpiClockrateKHz
137#define pdn_pin_no PowerDownPin
138#define spi_cs_pin_no SpiCsPin
139#define cmd_fifo_wp CmdWp
142#define channel_no MpsseChannelNo
144#define channel_no SpiCsPin
147#define MSVC_PLATFORM_SPI_LIBFT4222 1
148#define MSVC_PLATFORM_SPI_LIBMPSSE 2
150#define BootupConfig EVE_Util_bootupConfig
193#define Gpu_Hal_Close EVE_Hal_close
194#define Gpu_Hal_DeInit EVE_Hal_release
196#define Gpu_Hal_ESD_Idle EVE_Hal_idle
198#define Gpu_Hal_StartTransfer EVE_Hal_startTransfer
199#define Gpu_Hal_Transfer8 EVE_Hal_transfer8
200#define Gpu_Hal_Transfer16 EVE_Hal_transfer16
201#define Gpu_Hal_Transfer32 EVE_Hal_transfer32
202#define Gpu_Hal_EndTransfer EVE_Hal_endTransfer
204#define Gpu_Hal_Rd8 EVE_Hal_rd8
205#define Gpu_Hal_Rd16 EVE_Hal_rd16
206#define Gpu_Hal_Rd32 EVE_Hal_rd32
207#define Gpu_Hal_Wr8 EVE_Hal_wr8
208#define Gpu_Hal_Wr16 EVE_Hal_wr16
209#define Gpu_Hal_Wr32 EVE_Hal_wr32
211#define Gpu_Hal_WrMem EVE_Hal_wrMem
212#define Gpu_Hal_WrMem_ProgMem EVE_Hal_wrProgMem
213#define Gpu_Hal_WrMemFromFlash EVE_Hal_wrProgMem
225#define Gpu_Hal_WrCmd32 EVE_Cmd_wr32
230#define Gpu_Hal_WrCmdBuf EVE_Cmd_wrMem
231#define Gpu_Hal_WrCmdBuf_nowait EVE_Cmd_wrMem
233#define Gpu_Hal_WrCmdBuf_ProgMem EVE_Cmd_wrProgMem
234#define Gpu_Hal_WrCmdBufFromFlash EVE_Cmd_wrProgMem
239#define Gpu_Hal_WaitCmdFifoEmpty EVE_Cmd_waitFlush
240#define Gpu_Hal_WaitCmdfifo_empty EVE_Cmd_waitFlush
245#define Gpu_Hal_WaitCmdFreespace EVE_Cmd_waitSpace
261#pragma deprecated(Gpu_CoCmd_SendCmd)
262#pragma deprecated(Gpu_Copro_SendCmd)
263#pragma deprecated(Gpu_CoCmd_StartFrame)
264#pragma deprecated(Gpu_CoCmd_EndFrame)
265#pragma deprecated(Gpu_CoCmd_StartFunc)
266#pragma deprecated(Gpu_CoCmd_EndFunc)
269#define Gpu_CoCmd_SendCmd EVE_Cmd_wr32
275#define Gpu_CoCmd_SendStr(phost, str) EVE_Cmd_wrString(phost, str, EVE_CMD_STRING_MAX)
276#define Gpu_CoCmd_SendStr_S EVE_Cmd_wrString
277#define Gpu_CoCmd_StartFrame(phost) eve_noop()
278#define Gpu_CoCmd_EndFrame(phost) eve_noop()
280#define Gpu_Copro_SendCmd Gpu_CoCmd_SendCmd
282#define Gpu_CoCmd_StartFunc(phost, size) EVE_Cmd_startFunc(phost)
283#define Gpu_CoCmd_EndFunc(phost, size) EVE_Cmd_endFunc(phost)
285#define Gpu_Fonts EVE_Gpu_Fonts
286#define Gpu_Fonts_t EVE_Gpu_Fonts
287#define Gpu_FontsExt EVE_Gpu_FontsExt
288#define Gpu_FontsExt_t EVE_Gpu_FontsExt
289#define GPU_NUMCHAR_PERFONT EVE_GPU_NUMCHAR_PERFONT
290#define GPU_FONT_TABLE_SIZE EVE_GPU_FONT_TABLE_SIZE
296#define GPU_INTERNAL_OSC EVE_INTERNAL_OSC
297#define GPU_EXTERNAL_OSC EVE_EXTERNAL_OSC
298#define GPU_PLL_SOURCE_T EVE_PLL_SOURCE_T
300#define GPU_PLL_48M EVE_PLL_48M
301#define GPU_PLL_36M EVE_PLL_36M
302#define GPU_PLL_24M EVE_PLL_24M
303#define GPU_PLL_FREQ_T EVE_PLL_FREQ_T
305#define GPU_ACTIVE_M EVE_ACTIVE_M
306#define GPU_STANDBY_M EVE_STANDBY_M
307#define GPU_SLEEP_M EVE_SLEEP_M
308#define GPU_POWERDOWN_M EVE_POWERDOWN_M
309#define GPU_POWER_MODE_T EVE_POWER_MODE_T
311#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
312#define GPU_SYSCLK_DEFAULT EVE_SYSCLK_DEFAULT
313#define GPU_SYSCLK_72M EVE_SYSCLK_72M
314#define GPU_SYSCLK_60M EVE_SYSCLK_60M
315#define GPU_SYSCLK_48M EVE_SYSCLK_48M
316#define GPU_SYSCLK_36M EVE_SYSCLK_36M
317#define GPU_SYSCLK_24M EVE_SYSCLK_24M
318#define GPU_81X_PLL_FREQ_T EVE_81X_PLL_FREQ_T
320#define GPU_5MA EVE_5MA
321#define GPU_10MA EVE_10MA
322#define GPU_15MA EVE_15MA
323#define GPU_20MA EVE_20MA
324#define GPU_81X_GPIO_DRIVE_STRENGTH_T EVE_81X_GPIO_DRIVE_STRENGTH_T
326#define GPU_GPIO0 EVE_GPIO0
327#define GPU_GPIO1 EVE_GPIO1
328#define GPU_GPIO2 EVE_GPIO2
329#define GPU_GPIO3 EVE_GPIO3
330#define GPU_GPIO4 EVE_GPIO4
331#define GPU_DISP EVE_DISP
333#define GPU_VSYNC_HSYNC EVE_VSYNC_HSYNC
334#define GPU_PCLK EVE_PCLK
335#define GPU_BACKLIGHT EVE_BACKLIGHT
336#define GPU_R_G_B EVE_R_G_B
337#define GPU_AUDIO_L EVE_AUDIO_L
338#define GPU_INT_N EVE_INT_N
339#define GPU_TOUCHWAKE EVE_TOUCHWAKE
340#define GPU_SCL EVE_SCL
341#define GPU_SDAEVE_SDA
342#define GPU_SPI_MISO_MOSI_IO2_IO3 EVE_SPI_MISO_MOSI_IO2_IO3
343#define GPU_81X_GPIO_GROUP_T EVE_81X_GPIO_GROUP_T
345#define GPU_81X_RESET_ACTIVE EVE_81X_RESET_ACTIVE
346#define GPU_81X_RESET_REMOVAL EVE_81X_RESET_REMOVAL
349#define GPU_CORE_RESET EVE_CORE_RESET
351#define COCMD_FAULT(rp) EVE_CMD_FAULT(rp)
353#define GPU_SPI_NUMCHANNELS_T EVE_SPI_CHANNELS_T
354#define GPU_SPI_SINGLE_CHANNEL EVE_SPI_SINGLE_CHANNEL
355#define GPU_SPI_DUAL_CHANNEL EVE_SPI_DUAL_CHANNEL
356#define GPU_SPI_QUAD_CHANNEL EVE_SPI_QUAD_CHANNEL
358#define GPU_SPI_NUMDUMMYBYTES uint8_t
359#define GPU_SPI_ONEDUMMY 1
360#define GPU_SPI_TWODUMMY 2
362#define SPI_SINGLE_CHANNEL EVE_SPI_SINGLE_CHANNEL
363#define SPI_DUAL_CHANNEL EVE_SPI_DUAL_CHANNEL
364#define SPI_QUAD_CHANNEL EVE_SPI_QUAD_CHANNEL
366#define SPI_ONE_DUMMY_BYTE EVE_SPI_ONE_DUMMY_BYTE
367#define SPI_TWO_DUMMY_BYTE EVE_SPI_TWO_DUMMY_BYTES
369#define ft_delay EVE_sleep
371#define Gpu_Hal_WaitLogo_Finish EVE_Cmd_waitLogo
385#define Gpu_Hal_Sleep EVE_sleep
387#define Gpu_HostCommand EVE_Hal_hostCommand
388#define Gpu_HostCommand_Ext3 EVE_Hal_hostCommandExt3
389#define Gpu_Hal_Powercycle EVE_Hal_powerCycle
390#define Gpu_Hal_SetSPI EVE_Hal_setSPI
391#define Gpu_CurrentFrequency EVE_Hal_currentFrequency
393#define Gpu_ClockTrimming EVE_Hal_clockTrimming
395#define Gpu_ClockSelect EVE_Host_clockSelect
396#define Gpu_PLL_FreqSelect EVE_Host_pllFreqSelect
397#define Gpu_PowerModeSwitch EVE_Host_powerModeSwitch
398#define Gpu_CoreReset EVE_Host_coreReset
400#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
401#define Gpu_81X_SelectSysCLK EVE_Host_selectSysClk
402#define GPU_81X_PowerOffComponents EVE_Host_powerOffComponents
403#define GPU_81X_PadDriveStrength EVE_Host_padDriveStrength
404#define Gpu_81X_ResetActive EVE_Host_resetActive
405#define Gpu_81X_ResetRemoval EVE_Host_resetRemoval
408#define Hal_LoadSDCard() EVE_Util_loadSdCard(NULL)
410#define Gpu_ClearScreen EVE_Util_clearScreen
418#define FLASH_WRITE_ALIGN_BYTE (256)
419#define FLASH_UPDATE_ALIGN_BYTE (4096)
420#define FLASH_READ_ALIGN_BYTE (64)
437#define App_WrCoCmd_Buffer(phost, cmd) EVE_Cmd_wr32((phost), (cmd))
438#define App_WrCoStr_Buffer(phost, s) EVE_Cmd_wrString((phost), (s), EVE_CMD_STRING_MAX)
439#define App_Flush_Co_Buffer(phost) EVE_Cmd_waitFlush((phost))
440#define App_Flush_Co_Buffer_nowait(phost) EVE_Cmd_waitFlush((phost))
441#define App_Set_CmdBuffer_Index(idx) eve_noop()
449#define RGB(r, g, b) ((((vc_int32_t)(r)) << 16) | (((vc_int32_t)(g)) << 8) | (b))
450#define SQ(v) ((v) * (v))
452#define MIN(x, y) ((x) > (y) ? (y) : (x))
455#define MAX(x, y) ((x) > (y) ? (x) : (y))
457#define PLAYCOLOR 0x00A0A080
458#define NOTE(n, sharp) (((n) - 'C') + ((sharp)*128))
459#define F16(s) ((int32_t)((s)*65536))
460#define INVALID_TOUCH_XY 0x8000
461#define ABS(x) ((x) > (0) ? (x) : (-x))
462#define ALIGN_TWO_POWER_N(Value, alignval) (((Value) + (alignval - 1)) & (~(alignval - 1)))
464#if !defined(ARDUINO_PLATFORM)
465#define pgm_read_byte_near(x) (*(x))
466#define pgm_read_byte(x) (*(x))
467#define pgm_read_word(addr) (*((prog_uint16_t *)(addr)))
468#define delay(x) EVE_sleep(x)
469#define random(x) (rand() % (x))
470#define DBGPRINT(x) printf(x)
473#if defined(MSVC_PLATFORM) || defined(BT8XXEMU_PLATFORM)
475#define strcpy_P strcpy
476#define strlen_P strlen
481#if defined(FT9XX_PLATFORM)
482#define GET_CURR_MILLIS() EVE_millis()
483#elif defined(MSVC_PLATFORM) || defined(BT8XXEMU_PLATFORM)
484#define GET_CURR_MILLIS() time(NULL)
485#elif defined(ARDUINO_PLATFORM)
486#define GET_CURR_MILLIS() millis()
488#define GET_CURR_MILLIS() 0
506 char8_t tmparray[16];
509 Length = (
int16_t)strlen((
char *)pSrc);
510 pdst = pSrc + Length;
529 tmpval = tmpval - CurrVal * 10;
530 charval =
'0' + tmpval;
531 tmparray[idx++] = charval;
534 for (i = 0; i < idx; i++)
536 *pdst++ = tmparray[idx - i - 1];
553 else if (type ==
LOAD)
EVE_HAL_EXPORT bool EVE_Cmd_wrMem(EVE_HalContext *phost, const uint8_t *buffer, uint32_t size)
Write buffer to Coprocessor's comand fifo.
EVE_HAL_EXPORT void EVE_Cmd_restore(EVE_HalContext *phost)
#define EVE_CMD_STRING_MAX
EVE_HAL_EXPORT void EVE_Hal_rdMem(EVE_HalContext *phost, uint8_t *result, uint32_t addr, uint32_t size)
Read a block data from Coprocessor's memory.
EVE_HAL_EXPORT bool EVE_Hal_open(EVE_HalContext *phost, const EVE_HalParameters *parameters)
Open the Eve_Hal framework.
EVE_HAL_EXPORT void EVE_Hal_defaults(EVE_HalParameters *parameters)
Setup default parameters for Eve_Hal framework.
EVE_HAL_EXPORT EVE_HalPlatform * EVE_Hal_initialize()
Eve_Hal framework initialization.
EVE_HAL_EXPORT uint32_t EVE_Hal_transferString(EVE_HalContext *phost, const char *str, uint32_t index, uint32_t size, uint32_t padMask)
Transfer a string to EVE platform.
EVE_HAL_EXPORT size_t EVE_Hal_list()
List the available devices.
EVE_HAL_EXPORT bool EVE_Util_loadInflateFile(EVE_HalContext *phost, uint32_t address, const char *filename)
Load file into RAM_G by CMD_INFLATE.
EVE_HAL_EXPORT bool EVE_Util_loadRawFile(EVE_HalContext *phost, uint32_t address, const char *filename)
Load a raw file into RAM_G.
EVE_HAL_EXPORT bool EVE_Util_loadImageFile(EVE_HalContext *phost, uint32_t address, const char *filename, uint32_t *format)
Load image into RAM_G.
EVE HAL framework utilities.
This file defines the generic APIs of phost access layer for the FT800 or EVE compatible silicon....
Co-processor command definitions.
bool_t Gpu_Hal_Open(EVE_HalContext *host)
void Gpu_Hal_RdMem(EVE_HalContext *host, uint32_t addr, uint8_t *buffer, uint32_t length)
bool_t Gpu_Hal_Init(Gpu_HalInit_t *halinit)
static ft_uint32_t ft_size_t nb
static ft_uint32_t ft_uint8_t * buffer
Flash_Cmd_Status_t Gpu_CoCmd_FlashHelper_Read(Gpu_Hal_Context_t *phost, uint32_t dest_ram, uint32_t src_flash, uint32_t num, const uint8_t *read_data)
void Gpu_CoCmd_FlashHelper_Init(Gpu_Hal_Context_t *phost)
Flash_Cmd_Status_t Gpu_CoCmd_FlashHelper_Write(Gpu_Hal_Context_t *phost, uint32_t dest_flash, uint32_t num, const uint8_t *write_data)
static ft_int16_t Gpu_Hal_TransferString(EVE_HalContext *phost, const ft_char8_t *str)
static ft_uint32_t ft_uint8_t ft_uint32_t length
static void Gpu_Hal_LoadImageToMemory(Gpu_Hal_Context_t *phost, const char *fileName, int32_t destination, uint8_t type)
uint8_t Gpu_CoCmd_FlashHelper_GetState(Gpu_Hal_Context_t *phost)
uint32_t GET_ASTC_FORMAT(uint16_t w, uint16_t h)
static void Gpu_Hal_ResetCmdFifo(Gpu_Hal_Context_t *phost)
uint32_t Gpu_CoCmd_FlashHelper_SwitchState(Gpu_Hal_Context_t *phost, uint8_t nextState)
uint32_t Gpu_CoCmd_FlashHelper_SwitchFullMode(Gpu_Hal_Context_t *phost)
void astc_tile2(uint8_t *iData, uint16_t bw, uint16_t bh, uint32_t size, const uint8_t *oData)
eve_progmem char prog_char8_t
void Gpu_CoCmd_FlashHelper_ClearCache(Gpu_Hal_Context_t *phost)
void GPU_DLSwap(Gpu_Hal_Context_t *phost, uint8_t DL_Swap_Type)
API to check the status of previous DLSWAP and perform DLSWAP of new DL Check for the status of previ...
void Gpu_CoCmd_FlashHelper_Erase(Gpu_Hal_Context_t *phost)
eve_progmem uint16_t prog_uint16_t
static int32_t Gpu_Hal_Dec2Ascii(char8_t *pSrc, int32_t value)
#define Gpu_Hal_Context_t
eve_progmem char prog_uchar8_t
Flash_Cmd_Status_t Gpu_CoCmd_FlashHelper_Update(Gpu_Hal_Context_t *phost, uint32_t dest_flash, uint32_t src_ram, uint32_t num)
static ft_int16_t Gpu_Hal_TransferString_S(EVE_HalContext *phost, const ft_char8_t *str, int length)
ft_uint32_t TotalChannelNum