36#ifndef EVE_HAL_INCL__H
37#define EVE_HAL_INCL__H
89#define RAM_ERR_REPORT_MAX 128
103#if defined(EVE_MULTI_GRAPHICS_TARGET)
104typedef struct EVE_GpuDefs
125extern EVE_GpuDefs EVE_GpuDefs_FT80X;
126extern EVE_GpuDefs EVE_GpuDefs_FT81X;
127extern EVE_GpuDefs EVE_GpuDefs_BT88X;
128extern EVE_GpuDefs EVE_GpuDefs_BT81X;
159#if defined(EVE_MULTI_PLATFORM_TARGET)
163#if defined(BT8XXEMU_PLATFORM)
164 void *EmulatorParameters;
165 void *EmulatorFlashParameters;
168#if defined(BT8XXEMU_PLATFORM)
172#if defined(MPSSE_PLATFORM)
176#if defined(FT9XX_PLATFORM) || defined(FT4222_PLATFORM) || defined(RP2040_PLATFORM)
181#if defined(RP2040_PLATFORM)
187#if defined(FT9XX_PLATFORM) || defined(FT4222_PLATFORM) || defined(MPSSE_PLATFORM) || defined(RP2040_PLATFORM)
191#if defined(FT4222_PLATFORM) || defined(MPSSE_PLATFORM)
197#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
198#define EVE_DL_STATE phost->DlState[phost->DlStateIndex]
203#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
210#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
214#if (EVE_DL_CACHE_SCISSOR)
252#if defined(EVE_MULTI_PLATFORM_TARGET)
255#if defined(EVE_MULTI_GRAPHICS_TARGET)
258 const EVE_GpuDefs *GpuDefs;
271#if defined(BT8XXEMU_PLATFORM)
274 void *EmulatorParameters;
276#if defined(FT4222_PLATFORM) | defined(MPSSE_PLATFORM)
280#if defined(RP2040_PLATFORM)
284#if defined(FT4222_PLATFORM) | defined(MPSSE_PLATFORM)
292#if defined(MPSSE_PLATFORM)
295#if defined(FT9XX_PLATFORM) || defined(FT4222_PLATFORM) || defined(RP2040_PLATFORM)
298#if defined(RP2040_PLATFORM)
303#if defined(FT9XX_PLATFORM) || defined(FT4222_PLATFORM) || defined(MPSSE_PLATFORM) || defined(RP2040_PLATFORM)
310#if defined(EVE_BUFFER_WRITES) || defined(FT4222_PLATFORM)
314#if !defined(EVE_SUPPORT_CMDB) || defined(EVE_MULTI_GRAPHICS_TARGET)
329#if !defined(EVE_SUPPORT_CMDB) || defined(EVE_MULTI_GRAPHICS_TARGET)
336#if defined(EVE_SUPPORT_MEDIAFIFO)
342 void *LoadFileHandle;
350#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
360#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
486#ifdef EVE_SUPPORT_HSF
495#ifdef EVE_SUPPORT_FLASH
504#ifdef EVE_SUPPORT_CMDB
513#ifdef EVE_SUPPORT_MEDIAFIFO
522#ifdef EVE_SUPPORT_VIDEO
531#ifdef EVE_SUPPORT_LARGEFONT
542 switch (chipId & 0xFFFF)
571 return chipId & 0xFFFF;
645#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
676#define EVE_Hal_displayMessageZ(phost, str) EVE_Hal_displayMessage((phost), (str), (uint16_t)strlen((str)))
#define EVE_DL_STATE_STACK_SIZE
#define eve_progmem_const
Defines EVE hardware values.
EVE_81X_GPIO_DRIVE_STRENGTH_T
EVE_HAL_EXPORT bool EVE_Hal_powerCycle(EVE_HalContext *phost, bool up)
Toggle PD_N pin of FT800 board for a power cycle.
EVE_HAL_EXPORT uint64_t EVE_millis64()
Get clock in miliseond.
EVE_HAL_EXPORT uint8_t EVE_Hal_transfer8(EVE_HalContext *phost, uint8_t value)
Write 8 bits to Coprocessor.
EVE_HAL_EXPORT void EVE_Host_powerModeSwitch(EVE_HalContext *phost, EVE_POWER_MODE_T pwrmode)
Switch power mode for Coprocessor.
EVE_HAL_EXPORT uint32_t EVE_Hal_rd32(EVE_HalContext *phost, uint32_t addr)
Read 4 bytes from Coprocessor's memory.
EVE_HAL_EXPORT uint16_t EVE_Hal_transfer16(EVE_HalContext *phost, uint16_t value)
Write 2 bytes to Coprocessor.
EVE_HAL_EXPORT void EVE_Host_padDriveStrength(EVE_HalContext *phost, EVE_81X_GPIO_DRIVE_STRENGTH_T strength, EVE_81X_GPIO_GROUP_T group)
Set the drive strength for various pins.
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 void EVE_Hal_wrProgMem(EVE_HalContext *phost, uint32_t addr, eve_progmem_const uint8_t *buffer, uint32_t size)
Write a buffer in ProgMem to Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_defaultsEx(EVE_HalParameters *parameters, size_t deviceIdx)
Setup default parameters for Eve_Hal framework.
EVE_HAL_EXPORT void EVE_Host_pllFreqSelect(EVE_HalContext *phost, EVE_PLL_FREQ_T freq)
Select system clock for Coprocessor.
EVE_HAL_EXPORT bool EVE_Hal_isDevice(EVE_HalContext *phost, size_t deviceIdx)
Check whether the context is the specified device.
EVE_HAL_EXPORT void EVE_Hal_info(EVE_DeviceInfo *deviceInfo, size_t deviceIdx)
Get info of the specified device. Devices of type EVE_HOST_UNKNOWN should be ignored.
EVE_HAL_EXPORT uint32_t EVE_millis()
Get clock in miliseond.
EVE_HAL_EXPORT uint16_t EVE_Hal_rd16(EVE_HalContext *phost, uint32_t addr)
Read 2 bytes from Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_startTransfer(EVE_HalContext *phost, EVE_TRANSFER_T rw, uint32_t addr)
Start data transfer to Coprocessor.
EVE_HAL_EXPORT void EVE_Hal_displayMessage(EVE_HalContext *phost, const char *str, uint16_t size)
Display a fullscreen debug message using TEXT8X8. Uses the back of RAM_G.
EVE_HAL_EXPORT void EVE_Host_powerOffComponents(EVE_HalContext *phost, uint8_t val)
Power off a component.
EVE_HAL_EXPORT int32_t EVE_Hal_clockTrimming(EVE_HalContext *phost, uint32_t lowFreq)
Trim the internal clock till the measured frequency is within the acceptable range.
EVE_HAL_EXPORT void EVE_Host_selectSysClk(EVE_HalContext *phost, EVE_81X_PLL_FREQ_T freq)
Set system clock for Coprocessor.
static int EVE_gen(EVE_CHIPID_T chipId)
EVE_HAL_EXPORT void EVE_Hal_hostCommand(EVE_HalContext *phost, uint8_t cmd)
Send a host command to Coprocessor.
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_setSPI(EVE_HalContext *phost, EVE_SPI_CHANNELS_T numchnls, uint8_t numdummy)
Set number of SPI channel.
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.
static bool EVE_Hal_supportCmdB(EVE_HalContext *phost)
EVE_HAL_EXPORT void EVE_Hal_idle(EVE_HalContext *phost)
Idle handler for Eve_Hal framework.
EVE_HAL_EXPORT void EVE_Host_resetActive(EVE_HalContext *phost)
Hold the device in reset state.
static int EVE_shortChipId(EVE_CHIPID_T chipId)
static bool EVE_Hal_supportHsf(EVE_HalContext *phost)
EVE_HAL_EXPORT size_t EVE_Hal_list()
List the available devices.
EVE_HAL_EXPORT void EVE_Hal_transferMem(EVE_HalContext *phost, uint8_t *result, const uint8_t *buffer, uint32_t size)
Transfer (read/write) a block data to Coprocessor.
static bool EVE_Hal_isScreenCapacitive(EVE_HalContext *phost)
static bool EVE_Hal_supportVideo(EVE_HalContext *phost)
static bool EVE_Hal_supportFlash(EVE_HalContext *phost)
EVE_HAL_EXPORT void EVE_Host_clockSelect(EVE_HalContext *phost, EVE_PLL_SOURCE_T pllsource)
Select clock source for Coprocessor.
static EVE_CHIPID_T EVE_extendedChipId(int chipId)
EVE_HAL_EXPORT void EVE_sleep(uint32_t ms)
Sleep in milisecond.
static bool EVE_Hal_supportLargeFont(EVE_HalContext *phost)
EVE_HAL_EXPORT void EVE_Hal_wr8(EVE_HalContext *phost, uint32_t addr, uint8_t v)
Write 8 bits to Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Host_resetRemoval(EVE_HalContext *phost)
Exit reset state, Eve will power on and enter into its default state.
EVE_HAL_EXPORT void EVE_Hal_transferProgMem(EVE_HalContext *phost, uint8_t *result, eve_progmem_const uint8_t *buffer, uint32_t size)
Transfer a block data from program memory.
EVE_HAL_EXPORT void EVE_Host_coreReset(EVE_HalContext *phost)
Send reset signal to Coprocessor.
EVE_HAL_EXPORT void EVE_Hal_close(EVE_HalContext *phost)
Close the Eve_Hal framework.
EVE_HAL_EXPORT void EVE_Hal_wr16(EVE_HalContext *phost, uint32_t addr, uint16_t v)
Write 2 bytes to Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_wrString(EVE_HalContext *phost, uint32_t addr, const char *str, uint32_t index, uint32_t size, uint32_t padMask)
Write a string to Coprocessor's memory.
#define RAM_ERR_REPORT_MAX
static bool EVE_Hal_isScreenResistive(EVE_HalContext *phost)
static bool EVE_Hal_supportMediaFifo(EVE_HalContext *phost)
void(* EVE_ResetCallback)(EVE_HalContext *phost, bool fault)
int(* EVE_CoCmdHook)(EVE_HalContext *phost, uint32_t cmd, uint32_t state)
EVE_HAL_EXPORT void EVE_Hal_restoreSPI(EVE_HalContext *phost)
EVE_HAL_EXPORT void EVE_Hal_wr32(EVE_HalContext *phost, uint32_t addr, uint32_t v)
Write 4 bytes to Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_wrMem(EVE_HalContext *phost, uint32_t addr, const uint8_t *buffer, uint32_t size)
Write a buffer to Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_endTransfer(EVE_HalContext *phost)
End data transfer.
EVE_HAL_EXPORT uint8_t EVE_Hal_rd8(EVE_HalContext *phost, uint32_t addr)
Read 8 bits from Coprocessor's memory.
EVE_HAL_EXPORT void EVE_Hal_defaults(EVE_HalParameters *parameters)
Setup default parameters for Eve_Hal framework.
EVE_HAL_EXPORT uint32_t EVE_Hal_currentFrequency(EVE_HalContext *phost)
Get current system clock of Coprocessor.
EVE_HAL_EXPORT void EVE_Hal_flush(EVE_HalContext *phost)
Flush data to Coprocessor.
EVE_HAL_EXPORT EVE_HalPlatform * EVE_Hal_initialize()
Eve_Hal framework initialization.
EVE_HAL_EXPORT void EVE_Hal_hostCommandExt3(EVE_HalContext *phost, uint32_t cmd)
This API sends a 3byte command to the phost.
EVE_HAL_EXPORT uint32_t EVE_Hal_transfer32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor.
EVE_HAL_EXPORT void EVE_Hal_release()
Close Eve_Hal framework.
bool(* EVE_Callback)(EVE_HalContext *phost)
unsigned long long uint64_t
static ft_uint32_t ft_uint8_t * buffer
static ft_void_t ft_uint32_t * cmd
uint32_t MediaFifoAddress
ptrdiff_t LoadFileRemaining
uint8_t DebugBackup[RAM_ERR_REPORT_MAX]
EVE_HalDlState DlState[EVE_DL_STATE_STACK_SIZE]
EVE_ResetCallback CbCoprocessorReset
EVE_SPI_CHANNELS_T SpiChannels