image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
EVE_CoCmd.h File Reference

EVE's co-processor commmands. More...

#include "EVE_HalDefs.h"
#include "EVE_GpuDefs.h"

Go to the source code of this file.

Macros

#define ESD_FUNCTION(name, ...)
 
#define ESD_RENDER(name, ...)
 
#define ESD_PARAMETER(name, ...)
 
#define EVE_COCMD_UNSUPPORTED(cmd, res)   eve_pragma_warning("Coprocessor command " #cmd " is not supported on this platform")(res)
 
#define EVE_MULTI_TARGET_CHECK(cmd, condition)
 
#define EVE_MULTI_TARGET_CHECK_RETURN(cmd, condition, res)
 
#define EVE_CO_SCRATCH_HANDLE   (EVE_CHIPID >= EVE_FT810 ? phost->CoScratchHandle : 15)
 
#define EVE_CoCmd_hsf(phost, hsf)   EVE_COCMD_UNSUPPORTED(CMD_HSF, false)
 
#define EVE_CoCmd_apiLevel(phost, level)   EVE_COCMD_UNSUPPORTED(CMD_APILEVEL, false)
 
#define EVE_CoCmd_wait(phost, us)   EVE_COCMD_UNSUPPORTED(CMD_WAIT, false)
 
#define EVE_CoCmd_return(phost)   EVE_COCMD_UNSUPPORTED(CMD_RETURN, false)
 
#define EVE_CoCmd_callList(phost, a)   EVE_COCMD_UNSUPPORTED(CMD_CALLLIST, false)
 
#define EVE_CoCmd_newList(phost, a)   EVE_COCMD_UNSUPPORTED(CMD_NEWLIST, false)
 
#define EVE_CoCmd_endList(phost)   EVE_COCMD_UNSUPPORTED(CMD_ENDLIST, false)
 
#define EVE_CoCmd_pclkFreq(phost, ftarget, rounding)   EVE_COCMD_UNSUPPORTED(CMD_PCLKFREQ, 0)
 
#define FLASH_ERROR_NOTATTACHED   0xE001
 
#define FLASH_ERROR_HEADERMISSING   0xE002
 
#define FLASH_ERROR_HEADERCRCFAILED   0xE003
 
#define FLASH_ERROR_FIRMWAREMISMATCH   0xE004
 
#define FLASH_ERROR_FULLSPEEDFAILED   0xE005
 
#define EVE_CoCmd_getImage(phost, source, fmt, w, h, palette)   EVE_COCMD_UNSUPPORTED(CMD_GETIMAGE, false)
 
#define EVE_CoCmd_fontCache(phost, font, ptr, num)   EVE_COCMD_UNSUPPORTED(CMD_FONTCACHE, false)
 
#define EVE_CoCmd_fontCacheQuery(phost, total, used)   EVE_COCMD_UNSUPPORTED(CMD_FONTCACHEQUERY, false)
 
#define EVE_CoCmd_calibrateSub(phost, x, y, w, h)   EVE_COCMD_UNSUPPORTED(CMD_CALIBRATESUB, 0)
 
#define EVE_CoCmd_testCard(phost)   EVE_COCMD_UNSUPPORTED(CMD_TESTCARD, false)
 
#define EVE_CoCmd_animFrameRam(phost, x, y, aoptr, frame)   EVE_COCMD_UNSUPPORTED(CMD_ANIMFRAMERAM, false)
 
#define EVE_CoCmd_animStartRam(phost, ch, aoptr, loop)   EVE_COCMD_UNSUPPORTED(CMD_ANIMSTARTRAM, false)
 
#define EVE_CoCmd_runAnim(phost, waitmask, play)   EVE_COCMD_UNSUPPORTED(CMD_RUNANIM, false)
 

Functions

static void EVE_CoCmd_dl (EVE_HalContext *phost, uint32_t dl)
 Write a display list instruction.
Example: EVE_CoCmd_dl(DISPLAY());.
 
EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState (EVE_HalContext *phost)
 
EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState (EVE_HalContext *phost)
 
static void EVE_CoCmd_dlStart (EVE_HalContext *phost)
 Send CMD_DLSTART.
 
static void EVE_CoCmd_swap (EVE_HalContext *phost)
 Send CMD_SWAP.
 
static void EVE_CoCmd_interrupt (EVE_HalContext *phost, uint32_t ms)
 Send CMD_INTERRUPT.
 
static void EVE_CoCmd_coldStart (EVE_HalContext *phost)
 Send CMD_COLDSTART.
 
EVE_HAL_EXPORT bool EVE_CoCmd_getMatrix (EVE_HalContext *phost, int32_t *m)
 Send CMD_GETMATRIX.
 
EVE_HAL_EXPORT void EVE_CoCmd_setRotate (EVE_HalContext *phost, uint32_t r)
 CMD_SETROTATE.
 
static void EVE_CoCmd_sync (EVE_HalContext *phost)
 Send CMD_SYNC.
 
static void EVE_CoCmd_clearCache (EVE_HalContext *phost)
 Send CMD_CLEARCACHE.
 
static void EVE_CoCmd_nop (EVE_HalContext *phost)
 Send CMD_NOP.
 
EVE_HAL_EXPORT bool EVE_CoCmd_memCrc (EVE_HalContext *phost, uint32_t ptr, uint32_t num, uint32_t *result)
 Send CMD_MEMCRC.
 
EVE_HAL_EXPORT bool EVE_CoCmd_regRead (EVE_HalContext *phost, uint32_t ptr, uint32_t *result)
 Send CMD_REGREAD.
 
static void EVE_CoCmd_memWrite (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_MEMWRITE.
 
static void EVE_CoCmd_memWrite32 (EVE_HalContext *phost, uint32_t ptr, uint32_t value)
 Send CMD_MEMWRITE, followed by a single 32-bit value.
 
static void EVE_CoCmd_memSet (EVE_HalContext *phost, uint32_t ptr, uint32_t value, uint32_t num)
 Send CMD_MEMSET.
 
static void EVE_CoCmd_memZero (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_MEMZERO.
 
static void EVE_CoCmd_memCpy (EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
 Send CMD_MEMCPY.
 
static void EVE_CoCmd_append (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_APPEND.
 
static void EVE_CoCmd_snapshot (EVE_HalContext *phost, uint32_t ptr)
 Send CMD_SNAPSHOT.
 
static void EVE_CoCmd_inflate (EVE_HalContext *phost, uint32_t ptr)
 Send CMD_INFLATE. Data must follow this command.
 
EVE_HAL_EXPORT bool EVE_CoCmd_inflate_progMem (EVE_HalContext *phost, uint32_t dst, eve_progmem_const uint8_t *src, uint32_t size)
 Inflates data from program memory to RAM_G.
 
EVE_HAL_EXPORT bool EVE_CoCmd_getPtr (EVE_HalContext *phost, uint32_t *result)
 Get the end memory address of data inflated by CMD_INFLATE.
 
static void EVE_CoCmd_loadImage (EVE_HalContext *phost, uint32_t ptr, uint32_t options)
 Send CMD_LOADIMAGE. Data must follow this command.
 
EVE_HAL_EXPORT bool EVE_CoCmd_loadImage_progMem (EVE_HalContext *phost, uint32_t dst, eve_progmem_const uint8_t *src, uint32_t size, uint32_t *format)
 Load image from program memory.
 
EVE_HAL_EXPORT bool EVE_CoCmd_getProps (EVE_HalContext *phost, uint32_t *ptr, uint32_t *w, uint32_t *h)
 Get the image properties decompressed by CMD_LOADIMAGE.
 
static void EVE_CoCmd_snapshot2 (EVE_HalContext *phost, uint32_t fmt, uint32_t ptr, int16_t x, int16_t y, int16_t w, int16_t h)
 Send CMD_SNAPSHOT2.
 
static void EVE_CoCmd_mediaFifo (EVE_HalContext *phost, uint32_t ptr, uint32_t size)
 Send CMD_MEDIAFIFO. See EVE_MediaFifo interface for easier FIFO access.
 
static void EVE_CoCmd_videoStart (EVE_HalContext *phost)
 Send CMD_VIDEOSTART.
 
static void EVE_CoCmd_videoFrame (EVE_HalContext *phost, uint32_t dst, uint32_t ptr)
 CMD_VIDEOFRAME.
 
static void EVE_CoCmd_flashErase (EVE_HalContext *phost)
 Send CMD_FLASHERASE.
 
EVE_HAL_EXPORT bool EVE_CoCmd_flashErase_flush (EVE_HalContext *phost)
 Send CMD_FLASHERASE. Wait for completion.
 
static void EVE_CoCmd_flashWrite (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_FLASHWRITE. This command must be followed by the data to write.
 
static void EVE_CoCmd_flashRead (EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
 Read from Flash to RAM_G. Call EVE_Cmd_waitFlush to wait for completion.
 
EVE_HAL_EXPORT bool EVE_CoCmd_flashRead_flush (EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
 Read from Flash to RAM_G.
 
static void EVE_CoCmd_flashUpdate (EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
 Send CMD_FLASHUPDATE. This command must be followed by the data to write.
 
static void EVE_CoCmd_flashDetach (EVE_HalContext *phost)
 Send CMD_FLASHDETACH.
 
EVE_HAL_EXPORT uint32_t EVE_CoCmd_flashAttach (EVE_HalContext *phost)
 Attach flash.
 
EVE_HAL_EXPORT uint32_t EVE_CoCmd_flashFast (EVE_HalContext *phost, uint32_t *result)
 Enter fast flash state.
 
static void EVE_CoCmd_flashSpiDesel (EVE_HalContext *phost)
 Send CMD_FLASHSPIDESEL.
 
static void EVE_CoCmd_flashSpiTx (EVE_HalContext *phost, uint32_t num)
 Send CMD_FLASHSPITX. Must follow data.
 
static void EVE_CoCmd_flashSpiRx (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_FLASHSPIRX.
 
static void EVE_CoCmd_flashSource (EVE_HalContext *phost, uint32_t ptr)
 Send CMD_FLASHSOURCE.
 
static void EVE_CoCmd_appendF (EVE_HalContext *phost, uint32_t ptr, uint32_t num)
 Send CMD_APPENDF.
 
static void EVE_CoCmd_videoStartF (EVE_HalContext *phost)
 Send CMD_VIDEOSTARTF.
 
EVE_HAL_EXPORT bool EVE_CoCmd_loadImage_flash (EVE_HalContext *phost, uint32_t dst, uint32_t src, uint32_t *format)
 Load image from Flash to RAM_G.
 
EVE_HAL_EXPORT bool EVE_CoCmd_inflate_flash (EVE_HalContext *phost, uint32_t dst, uint32_t src)
 Inflates data from Flash to RAM_G.
 
static void EVE_CoCmd_inflate2 (EVE_HalContext *phost, uint32_t ptr, uint32_t options)
 Send CMD_INFLATE2.
 
static void EVE_CoCmd_bgColor (EVE_HalContext *phost, uint32_t c)
 Send CMD_BGCOLOR.
 
static void EVE_CoCmd_fgColor (EVE_HalContext *phost, uint32_t c)
 Send CMD_FGCOLOR.
 
EVE_HAL_EXPORT bool EVE_CoCmd_bitmapTransform (EVE_HalContext *phost, int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t tx0, int32_t ty0, int32_t tx1, int32_t ty1, int32_t tx2, int32_t ty2, uint16_t *result)
 Send CMD_BITMAP_TRANSFORM. Blocking call if a pointer is passed to result
 
static void EVE_CoCmd_loadIdentity (EVE_HalContext *phost)
 Send CMD_LOADIDENTITY.
 
static void EVE_CoCmd_translate (EVE_HalContext *phost, int32_t tx, int32_t ty)
 Send CMD_TRANSLATE.
 
static void EVE_CoCmd_scale (EVE_HalContext *phost, int32_t sx, int32_t sy)
 Send CMD_SCALE.
 
static void EVE_CoCmd_rotate (EVE_HalContext *phost, int32_t a)
 Send CMD_ROTATE.
 
static void EVE_CoCmd_setMatrix (EVE_HalContext *phost)
 Send CMD_SETMATRIX.
 
static void EVE_CoCmd_setFont (EVE_HalContext *phost, uint32_t font, uint32_t ptr)
 Send CMD_SETFONT.
 
static void EVE_CoCmd_gradColor (EVE_HalContext *phost, uint32_t c)
 Send CMD_GRADCOLOR.
 
static void EVE_CoCmd_setBase (EVE_HalContext *phost, uint32_t base)
 Send CMD_SETBASE.
 
static void EVE_CoCmd_setFont2 (EVE_HalContext *phost, uint32_t font, uint32_t ptr, uint32_t firstchar)
 Send CMD_SETFONT2.
 
static void EVE_CoCmd_setScratch (EVE_HalContext *phost, uint32_t handle)
 Send CMD_SETSCRATCH.
 
static void EVE_CoCmd_romFont (EVE_HalContext *phost, uint32_t font, uint32_t romslot)
 Send CMD_ROMFONT.
 
static void EVE_CoCmd_setBitmap (EVE_HalContext *phost, uint32_t source, uint16_t fmt, uint16_t w, uint16_t h)
 Send CMD_SETBITMAP.
 
static void EVE_CoCmd_rotateAround (EVE_HalContext *phost, int32_t x, int32_t y, int32_t a, int32_t s)
 Send CMD_ROTATEAROUND.
 
static void EVE_CoCmd_resetFonts (EVE_HalContext *phost)
 Send CMD_RESETFONT.
 
static void EVE_CoCmd_fillWidth (EVE_HalContext *phost, uint32_t s)
 Send CMD_FILLWIDTH.
 
static void EVE_CoCmd_gradient (EVE_HalContext *phost, int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1)
 Send CMD_GRADIENT.
 
EVE_HAL_EXPORT void EVE_CoCmd_text (EVE_HalContext *phost, int16_t x, int16_t y, int16_t font, uint16_t options, const char *s,...)
 Send CMD_TEXT.
 
EVE_HAL_EXPORT void EVE_CoCmd_text_s (EVE_HalContext *phost, int16_t x, int16_t y, int16_t font, uint16_t options, const char *s, uint32_t length)
 Send CMD_TEXT with length.
 
EVE_HAL_EXPORT void EVE_CoCmd_text_ex (EVE_HalContext *phost, int16_t x, int16_t y, int16_t font, uint16_t options, bool bottom, int16_t baseLine, int16_t capsHeight, int16_t xOffset, const char *s)
 Send CMD_TEXT.
 
EVE_HAL_EXPORT void EVE_CoCmd_button (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options, const char *s,...)
 Send CMD_BUTTON.
 
EVE_HAL_EXPORT void EVE_CoCmd_keys (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, int16_t font, uint16_t options, const char *s)
 Send CMD_KEYS.
 
static void EVE_CoCmd_progress (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range)
 Send CMD_PROGRESS.
 
static void EVE_CoCmd_slider (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range)
 Send CMD_SLIDER.
 
static void EVE_CoCmd_scrollbar (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range)
 Send CMD_SCROLLBAR.
 
EVE_HAL_EXPORT void EVE_CoCmd_toggle (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t font, uint16_t options, uint16_t state, const char *s,...)
 Send CMD_TOGGLE.
 
static void EVE_CoCmd_gauge (EVE_HalContext *phost, int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range)
 Send CMD_GAUGE.
 
static void EVE_CoCmd_clock (EVE_HalContext *phost, int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t h, uint16_t m, uint16_t s, uint16_t ms)
 Send CMD_CLOCK.
 
static void EVE_CoCmd_dial (EVE_HalContext *phost, int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val)
 Send CMD_DIAL.
 
EVE_HAL_EXPORT void EVE_CoCmd_number (EVE_HalContext *phost, int16_t x, int16_t y, int16_t font, uint16_t options, int32_t n)
 Send CMD_NUMBER.
 
static void EVE_CoCmd_gradientA (EVE_HalContext *phost, int16_t x0, int16_t y0, uint32_t argb0, int16_t x1, int16_t y1, uint32_t argb1)
 Send CMD_GRADIENTA.
 
EVE_HAL_EXPORT uint32_t EVE_CoCmd_calibrate (EVE_HalContext *phost)
 Send CMD_CALIBRATE.
 
static void EVE_CoCmd_spinner (EVE_HalContext *phost, int16_t x, int16_t y, uint16_t style, uint16_t scale)
 Send CMD_SPINNER.
 
static void EVE_CoCmd_stop (EVE_HalContext *phost)
 Send CMD_STOP.
 
static void EVE_CoCmd_track (EVE_HalContext *phost, int16_t x, int16_t y, int16_t w, int16_t h, int16_t tag)
 Send CMD_TRACK.
 
static void EVE_CoCmd_screenSaver (EVE_HalContext *phost)
 Send CMD_SCREENSAVER.
 
static void EVE_CoCmd_sketch (EVE_HalContext *phost, int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format)
 Send CMD_SKETCH.
 
static void EVE_CoCmd_logo (EVE_HalContext *phost)
 Send CMD_LOGO.
 
static void EVE_CoCmd_cSketch (EVE_HalContext *phost, int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format, uint16_t freq)
 Send CMD_CSKETCH. Only exists under FT801.
 
static void EVE_CoCmd_playVideo (EVE_HalContext *phost, uint32_t options)
 Send CMD_PLAYVIDEO.
 
EVE_HAL_EXPORT bool EVE_CoCmd_animStart (EVE_HalContext *phost, int32_t ch, uint32_t aoptr, uint32_t loop)
 Send CMD_ANIMSTART.
 
static void EVE_CoCmd_animStop (EVE_HalContext *phost, int32_t ch)
 Send CMD_ANIMSTOP.
 
static void EVE_CoCmd_animXY (EVE_HalContext *phost, int32_t ch, int16_t x, int16_t y)
 Send CMD_ANIMXY.
 
static void EVE_CoCmd_animDraw (EVE_HalContext *phost, int32_t ch)
 Send CMD_ANIMDRAW.
 
static void EVE_CoCmd_animFrame (EVE_HalContext *phost, int16_t x, int16_t y, uint32_t aoptr, uint32_t frame)
 Send CMD_ANIMFRAME.
 
Reusable templates for basic commands to save on compiled code space

d: uint32_t, w: uint16_t z: nul-terminated string, z_s: nul-terminated string with known length

EVE_HAL_EXPORT void EVE_CoCmd_d (EVE_HalContext *phost, uint32_t cmd)
 
EVE_HAL_EXPORT void EVE_CoCmd_dd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1)
 
EVE_HAL_EXPORT void EVE_CoCmd_dddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddddd (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2, uint32_t d3)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2)
 
EVE_HAL_EXPORT void EVE_CoCmd_ddwww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2, uint16_t w3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dddwwww (EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwdd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint32_t d3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwdwwd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint16_t w3, uint16_t w4, uint32_t d5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdw (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5, uint16_t w6)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwd (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwww (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6, uint16_t w7)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, const char *s)
 
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz_s (EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, const char *s, uint32_t len)
 

Detailed Description

EVE's co-processor commmands.

Author
Bridgetek
Date
2018

MIT License

Copyright (c) [2019] [Bridgetek Pte Ltd (BRTChip)]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file EVE_CoCmd.h.

Macro Definition Documentation

◆ ESD_FUNCTION

#define ESD_FUNCTION (   name,
  ... 
)

Definition at line 48 of file EVE_CoCmd.h.

◆ ESD_PARAMETER

#define ESD_PARAMETER (   name,
  ... 
)

Definition at line 54 of file EVE_CoCmd.h.

◆ ESD_RENDER

#define ESD_RENDER (   name,
  ... 
)

Definition at line 51 of file EVE_CoCmd.h.

◆ EVE_CO_SCRATCH_HANDLE

#define EVE_CO_SCRATCH_HANDLE   (EVE_CHIPID >= EVE_FT810 ? phost->CoScratchHandle : 15)

Definition at line 145 of file EVE_CoCmd.h.

◆ EVE_CoCmd_animFrameRam

#define EVE_CoCmd_animFrameRam (   phost,
  x,
  y,
  aoptr,
  frame 
)    EVE_COCMD_UNSUPPORTED(CMD_ANIMFRAMERAM, false)

Definition at line 1972 of file EVE_CoCmd.h.

◆ EVE_CoCmd_animStartRam

#define EVE_CoCmd_animStartRam (   phost,
  ch,
  aoptr,
  loop 
)    EVE_COCMD_UNSUPPORTED(CMD_ANIMSTARTRAM, false)

Definition at line 1973 of file EVE_CoCmd.h.

◆ EVE_CoCmd_apiLevel

#define EVE_CoCmd_apiLevel (   phost,
  level 
)    EVE_COCMD_UNSUPPORTED(CMD_APILEVEL, false)

Definition at line 352 of file EVE_CoCmd.h.

◆ EVE_CoCmd_calibrateSub

#define EVE_CoCmd_calibrateSub (   phost,
  x,
  y,
  w,
 
)    EVE_COCMD_UNSUPPORTED(CMD_CALIBRATESUB, 0)

Definition at line 1970 of file EVE_CoCmd.h.

◆ EVE_CoCmd_callList

#define EVE_CoCmd_callList (   phost,
  a 
)    EVE_COCMD_UNSUPPORTED(CMD_CALLLIST, false)

Definition at line 355 of file EVE_CoCmd.h.

◆ EVE_CoCmd_endList

#define EVE_CoCmd_endList (   phost)    EVE_COCMD_UNSUPPORTED(CMD_ENDLIST, false)

Definition at line 357 of file EVE_CoCmd.h.

◆ EVE_CoCmd_fontCache

#define EVE_CoCmd_fontCache (   phost,
  font,
  ptr,
  num 
)    EVE_COCMD_UNSUPPORTED(CMD_FONTCACHE, false)

Definition at line 917 of file EVE_CoCmd.h.

◆ EVE_CoCmd_fontCacheQuery

#define EVE_CoCmd_fontCacheQuery (   phost,
  total,
  used 
)    EVE_COCMD_UNSUPPORTED(CMD_FONTCACHEQUERY, false)

Definition at line 918 of file EVE_CoCmd.h.

◆ EVE_CoCmd_getImage

#define EVE_CoCmd_getImage (   phost,
  source,
  fmt,
  w,
  h,
  palette 
)    EVE_COCMD_UNSUPPORTED(CMD_GETIMAGE, false)

Definition at line 916 of file EVE_CoCmd.h.

◆ EVE_CoCmd_hsf

#define EVE_CoCmd_hsf (   phost,
  hsf 
)    EVE_COCMD_UNSUPPORTED(CMD_HSF, false)

Definition at line 351 of file EVE_CoCmd.h.

◆ EVE_CoCmd_newList

#define EVE_CoCmd_newList (   phost,
  a 
)    EVE_COCMD_UNSUPPORTED(CMD_NEWLIST, false)

Definition at line 356 of file EVE_CoCmd.h.

◆ EVE_CoCmd_pclkFreq

#define EVE_CoCmd_pclkFreq (   phost,
  ftarget,
  rounding 
)    EVE_COCMD_UNSUPPORTED(CMD_PCLKFREQ, 0)

Definition at line 358 of file EVE_CoCmd.h.

◆ EVE_CoCmd_return

#define EVE_CoCmd_return (   phost)    EVE_COCMD_UNSUPPORTED(CMD_RETURN, false)

Definition at line 354 of file EVE_CoCmd.h.

◆ EVE_CoCmd_runAnim

#define EVE_CoCmd_runAnim (   phost,
  waitmask,
  play 
)    EVE_COCMD_UNSUPPORTED(CMD_RUNANIM, false)

Definition at line 1974 of file EVE_CoCmd.h.

◆ EVE_CoCmd_testCard

#define EVE_CoCmd_testCard (   phost)    EVE_COCMD_UNSUPPORTED(CMD_TESTCARD, false)

Definition at line 1971 of file EVE_CoCmd.h.

◆ EVE_COCMD_UNSUPPORTED

#define EVE_COCMD_UNSUPPORTED (   cmd,
  res 
)    eve_pragma_warning("Coprocessor command " #cmd " is not supported on this platform")(res)

Change to eve_pragma_error to strictly disable use of unsupported commands

Definition at line 58 of file EVE_CoCmd.h.

◆ EVE_CoCmd_wait

#define EVE_CoCmd_wait (   phost,
  us 
)    EVE_COCMD_UNSUPPORTED(CMD_WAIT, false)

Definition at line 353 of file EVE_CoCmd.h.

◆ EVE_MULTI_TARGET_CHECK

#define EVE_MULTI_TARGET_CHECK (   cmd,
  condition 
)

Definition at line 137 of file EVE_CoCmd.h.

◆ EVE_MULTI_TARGET_CHECK_RETURN

#define EVE_MULTI_TARGET_CHECK_RETURN (   cmd,
  condition,
  res 
)

Definition at line 138 of file EVE_CoCmd.h.

◆ FLASH_ERROR_FIRMWAREMISMATCH

#define FLASH_ERROR_FIRMWAREMISMATCH   0xE004

Definition at line 634 of file EVE_CoCmd.h.

◆ FLASH_ERROR_FULLSPEEDFAILED

#define FLASH_ERROR_FULLSPEEDFAILED   0xE005

Definition at line 635 of file EVE_CoCmd.h.

◆ FLASH_ERROR_HEADERCRCFAILED

#define FLASH_ERROR_HEADERCRCFAILED   0xE003

Definition at line 633 of file EVE_CoCmd.h.

◆ FLASH_ERROR_HEADERMISSING

#define FLASH_ERROR_HEADERMISSING   0xE002

Definition at line 632 of file EVE_CoCmd.h.

◆ FLASH_ERROR_NOTATTACHED

#define FLASH_ERROR_NOTATTACHED   0xE001

Definition at line 631 of file EVE_CoCmd.h.

Function Documentation

◆ EVE_CoCmd_animDraw()

static void EVE_CoCmd_animDraw ( EVE_HalContext phost,
int32_t  ch 
)
inlinestatic

Send CMD_ANIMDRAW.

Parameters
phostPointer to Hal context
chChannel

Definition at line 1836 of file EVE_CoCmd.h.

1837{
1839 EVE_CoCmd_dd(phost, CMD_ANIMDRAW, ch);
1840
1841#if (EVE_DL_OPTIMIZE)
1842 phost->DlPrimitive = 0;
1843#endif
1844}
EVE_HAL_EXPORT void EVE_CoCmd_dd(EVE_HalContext *phost, uint32_t cmd, uint32_t d0)
Definition EVE_CoCmd.c:49
#define EVE_MULTI_TARGET_CHECK(cmd, condition)
Definition EVE_CoCmd.h:137
#define EVE_BT815
Definition EVE_Config.h:66
#define EVE_CHIPID
#define CMD_ANIMDRAW
uint8_t DlPrimitive

◆ EVE_CoCmd_animFrame()

static void EVE_CoCmd_animFrame ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
uint32_t  aoptr,
uint32_t  frame 
)
inlinestatic

Send CMD_ANIMFRAME.

Parameters
phostPointer to Hal context
xX param
yY param
aoptrAoptr param
frameFrame param

Definition at line 1855 of file EVE_CoCmd.h.

1856{
1858 EVE_CoCmd_dwwdd(phost, CMD_ANIMFRAME, x, y, aoptr, frame);
1859
1860#if (EVE_DL_OPTIMIZE)
1861 phost->DlPrimitive = 0;
1862#endif
1863}
EVE_HAL_EXPORT void EVE_CoCmd_dwwdd(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint32_t d3)
Definition EVE_CoCmd.c:161
#define CMD_ANIMFRAME

◆ EVE_CoCmd_animStart()

EVE_HAL_EXPORT bool EVE_CoCmd_animStart ( EVE_HalContext phost,
int32_t  ch,
uint32_t  aoptr,
uint32_t  loop 
)

Send CMD_ANIMSTART.

Parameters
phostPointer to Hal context
chChannel
aoptrThe address of the animation object in flash memory
loopLoop flags
Returns
bool False on coprocessor fault

Definition at line 526 of file EVE_CoCmd.c.

527{
528 uint32_t flashStatus;
529
531
532#if EVE_CMD_HOOKS
533 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_ANIMSTART, ch))
534 return false;
535#endif
536
537 if (!EVE_Cmd_waitFlush(phost))
538 return false;
539 flashStatus = EVE_Hal_rd32(phost, REG_FLASH_STATUS);
540 if (flashStatus < FLASH_STATUS_FULL)
541 {
542 // Don't attempt to start animation without full flash speed, it hangs the coprocessor
543 eve_printf_debug("Attempt to send CMD_ANIMSTART without FLASH_STATUS_FULL (REG_FLASH_STATUS: %i)\n", (int)flashStatus);
544 return false;
545 }
546
547 EVE_Cmd_startFunc(phost);
549 EVE_Cmd_wr32(phost, ch);
550 EVE_Cmd_wr32(phost, aoptr);
551 EVE_Cmd_wr32(phost, loop);
552 EVE_Cmd_endFunc(phost);
553 return EVE_Cmd_waitFlush(phost);
554}
EVE_HAL_EXPORT void EVE_Cmd_startFunc(EVE_HalContext *phost)
Begin writing a function, keeps the transfer open.
Definition EVE_Cmd.c:262
EVE_HAL_EXPORT void EVE_Cmd_endFunc(EVE_HalContext *phost)
End writing a function, closes the transfer.
Definition EVE_Cmd.c:274
EVE_HAL_EXPORT bool EVE_Cmd_wr32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor's command fifo.
Definition EVE_Cmd.c:394
#define EVE_MULTI_TARGET_CHECK_RETURN(cmd, condition, res)
Definition EVE_CoCmd.h:138
#define CMD_ANIMSTART
#define FLASH_STATUS_FULL
#define REG_FLASH_STATUS
EVE_HAL_EXPORT uint32_t EVE_Hal_rd32(EVE_HalContext *phost, uint32_t addr)
Read 4 bytes from Coprocessor's memory.
Definition EVE_Hal.c:189
unsigned int uint32_t
#define eve_printf_debug(fmt,...)
void EVE_Cmd_waitFlush(EVE_HalContext *host)
Definition Gpu_Hal.cpp:775

◆ EVE_CoCmd_animStop()

static void EVE_CoCmd_animStop ( EVE_HalContext phost,
int32_t  ch 
)
inlinestatic

Send CMD_ANIMSTOP.

Parameters
phostPointer to Hal context
chChannel

Definition at line 1810 of file EVE_CoCmd.h.

1811{
1813 EVE_CoCmd_dd(phost, CMD_ANIMSTOP, ch);
1814}
#define CMD_ANIMSTOP

◆ EVE_CoCmd_animXY()

static void EVE_CoCmd_animXY ( EVE_HalContext phost,
int32_t  ch,
int16_t  x,
int16_t  y 
)
inlinestatic

Send CMD_ANIMXY.

Parameters
phostPointer to Hal context
chChannel
xX screen
yY screen

Definition at line 1824 of file EVE_CoCmd.h.

1825{
1827 EVE_CoCmd_ddww(phost, CMD_ANIMXY, ch, x, y);
1828}
EVE_HAL_EXPORT void EVE_CoCmd_ddww(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2)
Definition EVE_CoCmd.c:107
#define CMD_ANIMXY

◆ EVE_CoCmd_append()

static void EVE_CoCmd_append ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_APPEND.

Parameters
phostPointer to Hal context
ptrStart of source commands in main memory
numNumber of bytes to copy. This must be a multiple of 4

Definition at line 481 of file EVE_CoCmd.h.

482{
483 EVE_CoCmd_ddd(phost, CMD_APPEND, ptr, num);
484}
EVE_HAL_EXPORT void EVE_CoCmd_ddd(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1)
Definition EVE_CoCmd.c:62
#define CMD_APPEND

◆ EVE_CoCmd_appendF()

static void EVE_CoCmd_appendF ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_APPENDF.

Parameters
phostPointer to Hal context
ptrStart of source commands in flash memory. Must be 64-byte aligned
numNumber of bytes to copy. This must be a multiple of 4

Definition at line 794 of file EVE_CoCmd.h.

795{
797 EVE_CoCmd_ddd(phost, CMD_APPENDF, ptr, num);
798}
#define CMD_APPENDF

◆ EVE_CoCmd_bgColor()

static void EVE_CoCmd_bgColor ( EVE_HalContext phost,
uint32_t  c 
)
inlinestatic

Send CMD_BGCOLOR.

Parameters
phostPointer to Hal context
cNew background color

Definition at line 935 of file EVE_CoCmd.h.

936{
937#if EVE_DL_OPTIMIZE
938 if (phost->CoBgColor != c)
939 {
940#endif
941 EVE_CoCmd_dd(phost, CMD_BGCOLOR, c);
942#if EVE_DL_OPTIMIZE
943 phost->CoBgColor = c;
944 }
945#endif
946}
static uint32_t c
Definition Common.c:38
#define CMD_BGCOLOR
uint32_t CoBgColor

◆ EVE_CoCmd_bitmapTransform()

EVE_HAL_EXPORT bool EVE_CoCmd_bitmapTransform ( EVE_HalContext phost,
int32_t  x0,
int32_t  y0,
int32_t  x1,
int32_t  y1,
int32_t  x2,
int32_t  y2,
int32_t  tx0,
int32_t  ty0,
int32_t  tx1,
int32_t  ty1,
int32_t  tx2,
int32_t  ty2,
uint16_t result 
)

Send CMD_BITMAP_TRANSFORM. Blocking call if a pointer is passed to result

Parameters
phostPointer to Hal context
x0Point X0 screen coordinate, in pixels
y0Point Y0 screen coordinate, in pixels
x1Point X1 screen coordinate, in pixels
y1Point Y1 screen coordinate, in pixels
x2Point X2 screen coordinate, in pixels
y2Point Y2 screen coordinate, in pixels
tx0Point X0 bitmap coordinate, in pixels
ty0Point Y0 bitmap coordinate, in pixels
tx1Point X1 bitmap coordinate, in pixels
ty1Point Y1 bitmap coordinate, in pixels
tx2Point X2 bitmap coordinate, in pixels
ty2Point Y2 bitmap coordinate, in pixels
resultOptional parameter result is set to -1 on success, 0 on failure
Returns
bool Returns false on coprocessor error

Definition at line 34 of file EVE_CoCmd_State.c.

35{
36 uint16_t resAddr;
37
38#if EVE_CMD_HOOKS
39 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_BITMAP_TRANSFORM, 0))
40 return false;
41#endif
42
43 EVE_Cmd_startFunc(phost);
45 EVE_Cmd_wr32(phost, x0);
46 EVE_Cmd_wr32(phost, y0);
47 EVE_Cmd_wr32(phost, x1);
48 EVE_Cmd_wr32(phost, y1);
49 EVE_Cmd_wr32(phost, x2);
50 EVE_Cmd_wr32(phost, y2);
51 EVE_Cmd_wr32(phost, tx0);
52 EVE_Cmd_wr32(phost, ty0);
53 EVE_Cmd_wr32(phost, tx1);
54 EVE_Cmd_wr32(phost, ty1);
55 EVE_Cmd_wr32(phost, tx2);
56 EVE_Cmd_wr32(phost, ty2);
57 resAddr = EVE_Cmd_moveWp(phost, 4);
58 EVE_Cmd_endFunc(phost);
59
60#if EVE_DL_OPTIMIZE
61 EVE_DL_STATE.BitmapTransform = true;
62#endif
63
64 /* Read result */
65 if (result)
66 {
67 if (!EVE_Cmd_waitFlush(phost))
68 return false;
69 *result = EVE_Hal_rd16(phost, RAM_CMD + resAddr);
70 }
71 return true;
72}
EVE_HAL_EXPORT uint16_t EVE_Cmd_moveWp(EVE_HalContext *phost, uint16_t bytes)
Move the write pointer forward by the specified number of bytes. Returns the previous write pointer.
Definition EVE_Cmd.c:446
#define RAM_CMD
#define CMD_BITMAP_TRANSFORM
EVE_HAL_EXPORT uint16_t EVE_Hal_rd16(EVE_HalContext *phost, uint32_t addr)
Read 2 bytes from Coprocessor's memory.
Definition EVE_Hal.c:173
#define EVE_DL_STATE
unsigned short uint16_t

◆ EVE_CoCmd_button()

EVE_HAL_EXPORT void EVE_CoCmd_button ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
int16_t  font,
uint16_t  options,
const char *  s,
  ... 
)

Send CMD_BUTTON.

Parameters
phostPointer to Hal context
xx-coordinate of button top-left, in pixels
yy-coordinate of button top-left, in pixels
wButton width
hButton height
fontfont to use for text, 0-31
optionsFont option
sButton label text, UTF-8 encoding
...Format of button label text, like printf

Definition at line 154 of file EVE_CoCmd_Widgets.c.

155{
156 va_list args;
157#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
158 uint8_t num;
159#endif
160
161#if EVE_CMD_HOOKS
162 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_BUTTON, 0))
163 return;
164#endif
165
166 if (font >= 32)
167 {
168 if (font != 63)
169 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
170 return;
171 }
172
173 va_start(args, s);
174#if (EVE_SUPPORT_CHIPID >= EVE_BT815) /* OPT_FORMAT not defined in FT8xx chip */
175 num = (options & OPT_FORMAT) ? (countArgs(s)) : (0); /* Only check % characters if option OPT_FORMAT is set */
176#endif
177
178 EVE_Cmd_startFunc(phost);
179 EVE_Cmd_wr32(phost, CMD_BUTTON);
180 EVE_Cmd_wr32(phost, (((uint32_t)y << 16) | (x & 0xffff)));
181 EVE_Cmd_wr32(phost, (((uint32_t)h << 16) | (w & 0xffff)));
182 EVE_Cmd_wr32(phost, (((uint32_t)options << 16) | (font & 0xffff)));
184#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
185 if (EVE_CHIPID >= EVE_BT815)
186 {
187 for (uint8_t i = 0; i < num; i++)
188 EVE_Cmd_wr32(phost, (uint32_t)va_arg(args, uint32_t));
189 }
190#endif
191 EVE_Cmd_endFunc(phost);
192 va_end(args);
193
194#if (EVE_DL_OPTIMIZE)
195 phost->DlPrimitive = 0;
196#endif
197}
EVE_HAL_EXPORT uint32_t EVE_Cmd_wrString(EVE_HalContext *phost, const char *str, uint32_t maxLength)
Write a string into Coprocessor's command fifo.
Definition EVE_Cmd.c:322
#define EVE_CMD_STRING_MAX
Definition EVE_Cmd.h:44
static uint8_t countArgs(const char *str)
Count number of arguments in Cmd_Text for string format.
#define OPT_FORMAT
#define CMD_BUTTON
unsigned char uint8_t

◆ EVE_CoCmd_calibrate()

EVE_HAL_EXPORT uint32_t EVE_CoCmd_calibrate ( EVE_HalContext phost)

Send CMD_CALIBRATE.

Parameters
phostPointer to Hal context
Returns
uint32_t

Definition at line 500 of file EVE_CoCmd.c.

501{
502 uint16_t resAddr;
503
504#if EVE_CMD_HOOKS
505 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_CALIBRATE, 0))
506 return 0;
507#endif
508
509 EVE_Cmd_startFunc(phost);
511 resAddr = EVE_Cmd_moveWp(phost, 4);
512 EVE_Cmd_endFunc(phost);
513
514#if (EVE_DL_OPTIMIZE)
515 phost->DlPrimitive = 0;
516#endif
517
518 /* Wait for the result */
519 if (!EVE_Cmd_waitFlush(phost))
520 return 0;
521 return EVE_Hal_rd32(phost, RAM_CMD + resAddr);
522}
#define CMD_CALIBRATE

◆ EVE_CoCmd_clearCache()

static void EVE_CoCmd_clearCache ( EVE_HalContext phost)
inlinestatic

Send CMD_CLEARCACHE.

Parameters
phostPointer to Hal context

Definition at line 244 of file EVE_CoCmd.h.

245{
248}
EVE_HAL_EXPORT void EVE_CoCmd_d(EVE_HalContext *phost, uint32_t cmd)
Definition EVE_CoCmd.c:39
#define CMD_CLEARCACHE

◆ EVE_CoCmd_clock()

static void EVE_CoCmd_clock ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  r,
uint16_t  options,
uint16_t  h,
uint16_t  m,
uint16_t  s,
uint16_t  ms 
)
inlinestatic

Send CMD_CLOCK.

Parameters
phostPointer to Hal context
xx-coordinate of clock center, in pixels
yy-coordinate of clock center, in pixels
rClock radius
optionsDrawing option
hhours
mminutes
sseconds
msmilliseconds

Definition at line 1537 of file EVE_CoCmd.h.

1538{
1539 EVE_CoCmd_dwwwwwwww(phost, CMD_CLOCK, x, y, r, options, h, m, s, ms);
1540
1541#if (EVE_DL_OPTIMIZE)
1542 phost->DlPrimitive = 0;
1543#endif
1544}
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwww(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6, uint16_t w7)
Definition EVE_CoCmd.c:316
#define CMD_CLOCK

◆ EVE_CoCmd_coldStart()

static void EVE_CoCmd_coldStart ( EVE_HalContext phost)
inlinestatic

Send CMD_COLDSTART.

Parameters
phostPointer to Hal context

Definition at line 194 of file EVE_CoCmd.h.

195{
198}
EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState(EVE_HalContext *phost)
Definition EVE_CoDl.c:83
#define CMD_COLDSTART

◆ EVE_CoCmd_cSketch()

static void EVE_CoCmd_cSketch ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
uint16_t  w,
uint16_t  h,
uint32_t  ptr,
uint16_t  format,
uint16_t  freq 
)
inlinestatic

Send CMD_CSKETCH. Only exists under FT801.

Parameters
phostPointer to Hal context
xx-coordinate of sketch area top-left, in pixels
yy-coordinate of sketch area top-left, in pixels
wWidth of sketch area, in pixels
hHeight of sketch area, in pixels
ptrBase address of sketch bitmap
formatFormat of sketch bitmap, either L1 or L8
freqDeprecated

Definition at line 1735 of file EVE_CoCmd.h.

1736{
1737#if defined(EVE_MULTI_GRAPHICS_TARGET) || (EVE_SUPPORT_CHIPID == EVE_FT801)
1738 if (EVE_CHIPID == EVE_FT801)
1739 {
1740 EVE_CoCmd_dwwwwdww(phost, CMD_CSKETCH, x, y, w, h, ptr, format, freq);
1741
1742#if (EVE_DL_OPTIMIZE)
1743 phost->DlPrimitive = 0;
1744#endif
1745 }
1746 else
1747#endif
1748 {
1749 /* Simply fall back to regular sketch on non-FT801 platform */
1750 EVE_CoCmd_sketch(phost, x, y, w, h, ptr, format);
1751 }
1752}
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdww(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5, uint16_t w6)
Definition EVE_CoCmd.c:219
static void EVE_CoCmd_sketch(EVE_HalContext *phost, int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format)
Send CMD_SKETCH.
Definition EVE_CoCmd.h:1700
#define EVE_FT801
Definition EVE_Config.h:57
#define CMD_CSKETCH

◆ EVE_CoCmd_d()

EVE_HAL_EXPORT void EVE_CoCmd_d ( EVE_HalContext phost,
uint32_t  cmd 
)

Definition at line 39 of file EVE_CoCmd.c.

40{
41#if EVE_CMD_HOOKS
42 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
43 return;
44#endif
45
46 EVE_Cmd_wr32(phost, cmd);
47}
static ft_void_t ft_uint32_t * cmd
Definition FT_Gpu_Hal.h:184

◆ EVE_CoCmd_dd()

EVE_HAL_EXPORT void EVE_CoCmd_dd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0 
)

Definition at line 49 of file EVE_CoCmd.c.

50{
51#if EVE_CMD_HOOKS
52 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
53 return;
54#endif
55
56 EVE_Cmd_startFunc(phost);
57 EVE_Cmd_wr32(phost, cmd);
58 EVE_Cmd_wr32(phost, d0);
59 EVE_Cmd_endFunc(phost);
60}

◆ EVE_CoCmd_ddd()

EVE_HAL_EXPORT void EVE_CoCmd_ddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1 
)

Definition at line 62 of file EVE_CoCmd.c.

63{
64#if EVE_CMD_HOOKS
65 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
66 return;
67#endif
68
69 EVE_Cmd_startFunc(phost);
70 EVE_Cmd_wr32(phost, cmd);
71 EVE_Cmd_wr32(phost, d0);
72 EVE_Cmd_wr32(phost, d1);
73 EVE_Cmd_endFunc(phost);
74}

◆ EVE_CoCmd_dddd()

EVE_HAL_EXPORT void EVE_CoCmd_dddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint32_t  d2 
)

Definition at line 76 of file EVE_CoCmd.c.

77{
78#if EVE_CMD_HOOKS
79 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
80 return;
81#endif
82
83 EVE_Cmd_startFunc(phost);
84 EVE_Cmd_wr32(phost, cmd);
85 EVE_Cmd_wr32(phost, d0);
86 EVE_Cmd_wr32(phost, d1);
87 EVE_Cmd_wr32(phost, d2);
88 EVE_Cmd_endFunc(phost);
89}

◆ EVE_CoCmd_ddddd()

EVE_HAL_EXPORT void EVE_CoCmd_ddddd ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint32_t  d2,
uint32_t  d3 
)

Definition at line 91 of file EVE_CoCmd.c.

92{
93#if EVE_CMD_HOOKS
94 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
95 return;
96#endif
97
98 EVE_Cmd_startFunc(phost);
99 EVE_Cmd_wr32(phost, cmd);
100 EVE_Cmd_wr32(phost, d0);
101 EVE_Cmd_wr32(phost, d1);
102 EVE_Cmd_wr32(phost, d2);
103 EVE_Cmd_wr32(phost, d3);
104 EVE_Cmd_endFunc(phost);
105}

◆ EVE_CoCmd_dddwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dddwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint32_t  d1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5 
)

Definition at line 141 of file EVE_CoCmd.c.

144{
145#if EVE_CMD_HOOKS
146 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
147 return;
148#endif
149
150 EVE_Cmd_startFunc(phost);
151 EVE_Cmd_wr32(phost, cmd);
152 EVE_Cmd_wr32(phost, d0);
153 EVE_Cmd_wr32(phost, d1);
154 EVE_Cmd_wr16(phost, w2);
155 EVE_Cmd_wr16(phost, w3);
156 EVE_Cmd_wr16(phost, w4);
157 EVE_Cmd_wr16(phost, w5);
158 EVE_Cmd_endFunc(phost);
159}
EVE_HAL_EXPORT bool EVE_Cmd_wr16(EVE_HalContext *phost, uint16_t value)
Write 2 bytes to Coprocessor's command fifo.
Definition EVE_Cmd.c:366

◆ EVE_CoCmd_ddww()

EVE_HAL_EXPORT void EVE_CoCmd_ddww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint16_t  w1,
uint16_t  w2 
)

Definition at line 107 of file EVE_CoCmd.c.

109{
110#if EVE_CMD_HOOKS
111 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
112 return;
113#endif
114
115 EVE_Cmd_startFunc(phost);
116 EVE_Cmd_wr32(phost, cmd);
117 EVE_Cmd_wr32(phost, d0);
118 EVE_Cmd_wr16(phost, w1);
119 EVE_Cmd_wr16(phost, w2);
120 EVE_Cmd_endFunc(phost);
121}

◆ EVE_CoCmd_ddwww()

EVE_HAL_EXPORT void EVE_CoCmd_ddwww ( EVE_HalContext phost,
uint32_t  cmd,
uint32_t  d0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3 
)

Definition at line 123 of file EVE_CoCmd.c.

125{
126#if EVE_CMD_HOOKS
127 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, d0))
128 return;
129#endif
130
131 EVE_Cmd_startFunc(phost);
132 EVE_Cmd_wr32(phost, cmd);
133 EVE_Cmd_wr32(phost, d0);
134 EVE_Cmd_wr16(phost, w1);
135 EVE_Cmd_wr16(phost, w2);
136 EVE_Cmd_wr16(phost, w3);
137 EVE_Cmd_wr16(phost, 0);
138 EVE_Cmd_endFunc(phost);
139}

◆ EVE_CoCmd_dial()

static void EVE_CoCmd_dial ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  r,
uint16_t  options,
uint16_t  val 
)
inlinestatic

Send CMD_DIAL.

Parameters
phostPointer to Hal context
xx-coordinate of dial center, in pixels
yy-coordinate of dial center, in pixels
rradius of dial, in pixels.
optionsDrawing option
valSpecify the position of dial points by setting value between 0 and 65535 inclusive. 0 means that the dial points straight down, 0x4000 left, 0x8000 up, and0xc000 right.

Definition at line 1563 of file EVE_CoCmd.h.

1564{
1565 EVE_CoCmd_dwwwww(phost, CMD_DIAL, x, y, r, options, val);
1566
1567#if (EVE_DL_OPTIMIZE)
1568 phost->DlPrimitive = 0;
1569#endif
1570}
EVE_HAL_EXPORT void EVE_CoCmd_dwwwww(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4)
Definition EVE_CoCmd.c:257
#define CMD_DIAL

◆ EVE_CoCmd_dl()

static void EVE_CoCmd_dl ( EVE_HalContext phost,
uint32_t  dl 
)
inlinestatic

Write a display list instruction.
Example: EVE_CoCmd_dl(DISPLAY());.

Parameters
phostPointer to Hal context
dldisplay list instruction

Definition at line 117 of file EVE_CoCmd.h.

118{
119 EVE_CoCmd_d(phost, dl);
120}

◆ EVE_CoCmd_dlStart()

static void EVE_CoCmd_dlStart ( EVE_HalContext phost)
inlinestatic

Send CMD_DLSTART.

Parameters
phostPointer to Hal context

Definition at line 159 of file EVE_CoCmd.h.

160{
161 EVE_CoCmd_d(phost, CMD_DLSTART);
163}
EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState(EVE_HalContext *phost)
Definition EVE_CoDl.c:38
#define CMD_DLSTART

◆ EVE_CoCmd_dwwdd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwdd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint32_t  d2,
uint32_t  d3 
)

Definition at line 161 of file EVE_CoCmd.c.

163{
164#if EVE_CMD_HOOKS
165 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
166 return;
167#endif
168
169 EVE_Cmd_startFunc(phost);
170 EVE_Cmd_wr32(phost, cmd);
171 EVE_Cmd_wr16(phost, w0);
172 EVE_Cmd_wr16(phost, w1);
173 EVE_Cmd_wr32(phost, d2);
174 EVE_Cmd_wr32(phost, d3);
175 EVE_Cmd_endFunc(phost);
176}

◆ EVE_CoCmd_dwwdwwd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwdwwd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint32_t  d2,
uint16_t  w3,
uint16_t  w4,
uint32_t  d5 
)

Definition at line 178 of file EVE_CoCmd.c.

181{
182#if EVE_CMD_HOOKS
183 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
184 return;
185#endif
186
187 EVE_Cmd_startFunc(phost);
188 EVE_Cmd_wr32(phost, cmd);
189 EVE_Cmd_wr16(phost, w0);
190 EVE_Cmd_wr16(phost, w1);
191 EVE_Cmd_wr32(phost, d2);
192 EVE_Cmd_wr16(phost, w3);
193 EVE_Cmd_wr16(phost, w4);
194 EVE_Cmd_wr32(phost, d5);
195 EVE_Cmd_endFunc(phost);
196}

◆ EVE_CoCmd_dwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3 
)

Definition at line 240 of file EVE_CoCmd.c.

242{
243#if EVE_CMD_HOOKS
244 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
245 return;
246#endif
247
248 EVE_Cmd_startFunc(phost);
249 EVE_Cmd_wr32(phost, cmd);
250 EVE_Cmd_wr16(phost, w0);
251 EVE_Cmd_wr16(phost, w1);
252 EVE_Cmd_wr16(phost, w2);
253 EVE_Cmd_wr16(phost, w3);
254 EVE_Cmd_endFunc(phost);
255}

◆ EVE_CoCmd_dwwwwd()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwd ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4 
)

Definition at line 276 of file EVE_CoCmd.c.

278{
279#if EVE_CMD_HOOKS
280 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
281 return;
282#endif
283
284 EVE_Cmd_startFunc(phost);
285 EVE_Cmd_wr32(phost, cmd);
286 EVE_Cmd_wr16(phost, w0);
287 EVE_Cmd_wr16(phost, w1);
288 EVE_Cmd_wr16(phost, w2);
289 EVE_Cmd_wr16(phost, w3);
290 EVE_Cmd_wr32(phost, d4);
291 EVE_Cmd_endFunc(phost);
292}

◆ EVE_CoCmd_dwwwwdw()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdw ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4,
uint16_t  w5 
)

Definition at line 198 of file EVE_CoCmd.c.

201{
202#if EVE_CMD_HOOKS
203 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
204 return;
205#endif
206
207 EVE_Cmd_startFunc(phost);
208 EVE_Cmd_wr32(phost, cmd);
209 EVE_Cmd_wr16(phost, w0);
210 EVE_Cmd_wr16(phost, w1);
211 EVE_Cmd_wr16(phost, w2);
212 EVE_Cmd_wr16(phost, w3);
213 EVE_Cmd_wr32(phost, d4);
214 EVE_Cmd_wr16(phost, w5);
215 EVE_Cmd_wr16(phost, 0);
216 EVE_Cmd_endFunc(phost);
217}

◆ EVE_CoCmd_dwwwwdww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint32_t  d4,
uint16_t  w5,
uint16_t  w6 
)

Definition at line 219 of file EVE_CoCmd.c.

222{
223#if EVE_CMD_HOOKS
224 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
225 return;
226#endif
227
228 EVE_Cmd_startFunc(phost);
229 EVE_Cmd_wr32(phost, cmd);
230 EVE_Cmd_wr16(phost, w0);
231 EVE_Cmd_wr16(phost, w1);
232 EVE_Cmd_wr16(phost, w2);
233 EVE_Cmd_wr16(phost, w3);
234 EVE_Cmd_wr32(phost, d4);
235 EVE_Cmd_wr16(phost, w5);
236 EVE_Cmd_wr16(phost, w6);
237 EVE_Cmd_endFunc(phost);
238}

◆ EVE_CoCmd_dwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4 
)

Definition at line 257 of file EVE_CoCmd.c.

259{
260#if EVE_CMD_HOOKS
261 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
262 return;
263#endif
264
265 EVE_Cmd_startFunc(phost);
266 EVE_Cmd_wr32(phost, cmd);
267 EVE_Cmd_wr16(phost, w0);
268 EVE_Cmd_wr16(phost, w1);
269 EVE_Cmd_wr16(phost, w2);
270 EVE_Cmd_wr16(phost, w3);
271 EVE_Cmd_wr16(phost, w4);
272 EVE_Cmd_wr16(phost, 0);
273 EVE_Cmd_endFunc(phost);
274}

◆ EVE_CoCmd_dwwwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
uint16_t  w6 
)

Definition at line 294 of file EVE_CoCmd.c.

297{
298#if EVE_CMD_HOOKS
299 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
300 return;
301#endif
302
303 EVE_Cmd_startFunc(phost);
304 EVE_Cmd_wr32(phost, cmd);
305 EVE_Cmd_wr16(phost, w0);
306 EVE_Cmd_wr16(phost, w1);
307 EVE_Cmd_wr16(phost, w2);
308 EVE_Cmd_wr16(phost, w3);
309 EVE_Cmd_wr16(phost, w4);
310 EVE_Cmd_wr16(phost, w5);
311 EVE_Cmd_wr16(phost, w6);
312 EVE_Cmd_wr16(phost, 0);
313 EVE_Cmd_endFunc(phost);
314}

◆ EVE_CoCmd_dwwwwwwww()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwww ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
uint16_t  w6,
uint16_t  w7 
)

Definition at line 316 of file EVE_CoCmd.c.

319{
320#if EVE_CMD_HOOKS
321 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
322 return;
323#endif
324
325 EVE_Cmd_startFunc(phost);
326 EVE_Cmd_wr32(phost, cmd);
327 EVE_Cmd_wr16(phost, w0);
328 EVE_Cmd_wr16(phost, w1);
329 EVE_Cmd_wr16(phost, w2);
330 EVE_Cmd_wr16(phost, w3);
331 EVE_Cmd_wr16(phost, w4);
332 EVE_Cmd_wr16(phost, w5);
333 EVE_Cmd_wr16(phost, w6);
334 EVE_Cmd_wr16(phost, w7);
335 EVE_Cmd_endFunc(phost);
336}

◆ EVE_CoCmd_dwwwwwwz()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
const char *  s 
)

Definition at line 338 of file EVE_CoCmd.c.

341{
342#if EVE_CMD_HOOKS
343 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
344 return;
345#endif
346
347 EVE_Cmd_startFunc(phost);
348 EVE_Cmd_wr32(phost, cmd);
349 EVE_Cmd_wr16(phost, w0);
350 EVE_Cmd_wr16(phost, w1);
351 EVE_Cmd_wr16(phost, w2);
352 EVE_Cmd_wr16(phost, w3);
353 EVE_Cmd_wr16(phost, w4);
354 EVE_Cmd_wr16(phost, w5);
356 EVE_Cmd_endFunc(phost);
357}

◆ EVE_CoCmd_dwwwwwwz_s()

EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwwz_s ( EVE_HalContext phost,
uint32_t  cmd,
uint16_t  w0,
uint16_t  w1,
uint16_t  w2,
uint16_t  w3,
uint16_t  w4,
uint16_t  w5,
const char *  s,
uint32_t  len 
)

Definition at line 359 of file EVE_CoCmd.c.

362{
363#if EVE_CMD_HOOKS
364 if (phost->CoCmdHook && phost->CoCmdHook(phost, cmd, 0))
365 return;
366#endif
367
368 EVE_Cmd_startFunc(phost);
369 EVE_Cmd_wr32(phost, cmd);
370 EVE_Cmd_wr16(phost, w0);
371 EVE_Cmd_wr16(phost, w1);
372 EVE_Cmd_wr16(phost, w2);
373 EVE_Cmd_wr16(phost, w3);
374 EVE_Cmd_wr16(phost, w4);
375 EVE_Cmd_wr16(phost, w5);
376 EVE_Cmd_wrString(phost, s, len);
377 EVE_Cmd_endFunc(phost);
378}

◆ EVE_CoCmd_fgColor()

static void EVE_CoCmd_fgColor ( EVE_HalContext phost,
uint32_t  c 
)
inlinestatic

Send CMD_FGCOLOR.

Parameters
phostPointer to Hal context
cNew foreground color, as a 24-bit RGB number

Definition at line 957 of file EVE_CoCmd.h.

958{
959#if EVE_DL_OPTIMIZE
960 if (phost->CoFgColor != c)
961 {
962#endif
963 EVE_CoCmd_dd(phost, CMD_FGCOLOR, c);
964#if EVE_DL_OPTIMIZE
965 phost->CoFgColor = c;
966 }
967#endif
968}
#define CMD_FGCOLOR
uint32_t CoFgColor

◆ EVE_CoCmd_fillWidth()

static void EVE_CoCmd_fillWidth ( EVE_HalContext phost,
uint32_t  s 
)
inlinestatic

Send CMD_FILLWIDTH.

Parameters
phostPointer to Hal context
sline fill width, in pixels

Definition at line 1238 of file EVE_CoCmd.h.

1239{
1241 EVE_CoCmd_dd(phost, CMD_FILLWIDTH, s);
1242}
#define CMD_FILLWIDTH

◆ EVE_CoCmd_flashAttach()

EVE_HAL_EXPORT uint32_t EVE_CoCmd_flashAttach ( EVE_HalContext phost)

Attach flash.

Parameters
phostPointer to Hal context
Returns
uint32_t Returns new FLASH_STATUS

Definition at line 208 of file EVE_CoCmd_IO.c.

209{
210 uint32_t flashStatus;
212 if (!EVE_Cmd_waitFlush(phost))
213 return EVE_Hal_rd32(phost, REG_FLASH_STATUS); // Coprocessor must be ready
214 flashStatus = EVE_Hal_rd32(phost, REG_FLASH_STATUS);
215 if (flashStatus != FLASH_STATUS_DETACHED)
216 return flashStatus; // Only attach when detached
218 EVE_Cmd_waitFlush(phost); // Wait for command completion
219 return EVE_Hal_rd32(phost, REG_FLASH_STATUS); // Return current status
220}
EVE_HAL_EXPORT void EVE_CoCmd_d(EVE_HalContext *phost, uint32_t cmd)
Definition EVE_CoCmd.c:39
#define CMD_FLASHATTACH
#define FLASH_STATUS_DETACHED

◆ EVE_CoCmd_flashDetach()

static void EVE_CoCmd_flashDetach ( EVE_HalContext phost)
inlinestatic

Send CMD_FLASHDETACH.

Parameters
phostPointer to Hal context

Definition at line 715 of file EVE_CoCmd.h.

◆ EVE_CoCmd_flashErase()

static void EVE_CoCmd_flashErase ( EVE_HalContext phost)
inlinestatic

Send CMD_FLASHERASE.

Parameters
phostPointer to Hal context

Definition at line 644 of file EVE_CoCmd.h.

645{
648}
#define CMD_FLASHERASE

◆ EVE_CoCmd_flashErase_flush()

EVE_HAL_EXPORT bool EVE_CoCmd_flashErase_flush ( EVE_HalContext phost)

Send CMD_FLASHERASE. Wait for completion.

Parameters
phostPointer to Hal context
Returns
bool false on coprocessor fault

Definition at line 181 of file EVE_CoCmd_IO.c.

182{
184
185 if (!EVE_Cmd_waitFlush(phost))
186 return false; // Coprocessor must be ready
187
189
190 return EVE_Cmd_waitFlush(phost);
191}

◆ EVE_CoCmd_flashFast()

EVE_HAL_EXPORT uint32_t EVE_CoCmd_flashFast ( EVE_HalContext phost,
uint32_t result 
)

Enter fast flash state.

Enter fast flash state. Returns new FLASH_STATUS. Optional parameter result will contain any error code, 0 on success
0xE001 flash is not attached
0xE002 no header detected in sector 0 - is flash blank?
0xE003 sector 0 data failed integrity check
0xE004 device/blob mismatch - was correct blob loaded?
0xE005 failed full-speed test - check board wiring

Parameters
phostPointer to Hal context
result
Returns
new FLASH_STATUS

Definition at line 228 of file EVE_CoCmd_IO.c.

229{
230 uint16_t resAddr;
231 uint32_t flashStatus;
232
234
235 if (!EVE_Cmd_waitFlush(phost))
236 {
237 if (result)
238 *result = 0xE000;
239 return EVE_Hal_rd32(phost, REG_FLASH_STATUS);
240 } // Coprocessor must be ready
241 flashStatus = EVE_Hal_rd32(phost, REG_FLASH_STATUS);
242 if (flashStatus < FLASH_STATUS_BASIC)
243 {
244 if (result)
245 *result = 0xE001;
246 return flashStatus;
247 }
248 if (flashStatus > FLASH_STATUS_BASIC)
249 {
250 if (result)
251 *result = 0;
252 return flashStatus;
253 } // Only enter fast mode when attached
254
255#if EVE_CMD_HOOKS
256 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_FLASHFAST, 0))
257 return flashStatus;
258#endif
259
260 EVE_Cmd_startFunc(phost);
262 resAddr = EVE_Cmd_moveWp(phost, 4); // Get the address where the coprocessor will write the result
263 EVE_Cmd_endFunc(phost);
264 EVE_Cmd_waitFlush(phost); // Wait for command completion
265 if (result)
266 *result = EVE_Hal_rd32(phost, RAM_CMD + resAddr); // Fetch result
267 return EVE_Hal_rd32(phost, REG_FLASH_STATUS); // Return current status
268}
#define FLASH_STATUS_BASIC
#define CMD_FLASHFAST

◆ EVE_CoCmd_flashRead()

static void EVE_CoCmd_flashRead ( EVE_HalContext phost,
uint32_t  dest,
uint32_t  src,
uint32_t  num 
)
inlinestatic

Read from Flash to RAM_G. Call EVE_Cmd_waitFlush to wait for completion.

Parameters
phostPointer to Hal context
destdestination address in main memory. Must be 4-byte aligned
srcsource address in flash memory. Must be 64-byte aligned
numnumber of bytes to read, must be multiple of 4

Definition at line 679 of file EVE_CoCmd.h.

680{
682 EVE_CoCmd_dddd(phost, CMD_FLASHREAD, dest, src, num);
683}
EVE_HAL_EXPORT void EVE_CoCmd_dddd(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2)
Definition EVE_CoCmd.c:76
#define CMD_FLASHREAD

◆ EVE_CoCmd_flashRead_flush()

EVE_HAL_EXPORT bool EVE_CoCmd_flashRead_flush ( EVE_HalContext phost,
uint32_t  dest,
uint32_t  src,
uint32_t  num 
)

Read from Flash to RAM_G.

Parameters
phostPointer to Hal context
destdestination address in main memory. Must be 4-byte aligned
srcsource address in flash memory. Must be 64-byte aligned
numnumber of bytes to read, must be multiple of 4
Returns
bool false on coprocessor fault

Definition at line 193 of file EVE_CoCmd_IO.c.

194{
196
197 if (!EVE_Cmd_waitFlush(phost))
198 return false; // Coprocessor must be ready
199
200 EVE_CoCmd_dddd(phost, CMD_FLASHREAD, dest, src, num);
201
202 return EVE_Cmd_waitFlush(phost);
203}
EVE_HAL_EXPORT void EVE_CoCmd_dddd(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2)
Definition EVE_CoCmd.c:76

◆ EVE_CoCmd_flashSource()

static void EVE_CoCmd_flashSource ( EVE_HalContext phost,
uint32_t  ptr 
)
inlinestatic

Send CMD_FLASHSOURCE.

Parameters
phostPointer to Hal context
ptrflash address, must be 64-byte aligned

Definition at line 781 of file EVE_CoCmd.h.

782{
784 EVE_CoCmd_dd(phost, CMD_FLASHSOURCE, ptr);
785}
#define CMD_FLASHSOURCE

◆ EVE_CoCmd_flashSpiDesel()

static void EVE_CoCmd_flashSpiDesel ( EVE_HalContext phost)
inlinestatic

Send CMD_FLASHSPIDESEL.

Parameters
phostPointer to Hal context

Definition at line 744 of file EVE_CoCmd.h.

◆ EVE_CoCmd_flashSpiRx()

static void EVE_CoCmd_flashSpiRx ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_FLASHSPIRX.

Parameters
phostPointer to Hal context
ptrdestination address in main memory
numnumber of bytes to receive

Definition at line 769 of file EVE_CoCmd.h.

770{
772 EVE_CoCmd_ddd(phost, CMD_FLASHSPIRX, ptr, num);
773}
#define CMD_FLASHSPIRX

◆ EVE_CoCmd_flashSpiTx()

static void EVE_CoCmd_flashSpiTx ( EVE_HalContext phost,
uint32_t  num 
)
inlinestatic

Send CMD_FLASHSPITX. Must follow data.

Parameters
phostPointer to Hal context
numnumber of bytes to transmit

Definition at line 756 of file EVE_CoCmd.h.

757{
759 EVE_CoCmd_dd(phost, CMD_FLASHSPITX, num);
760}
#define CMD_FLASHSPITX

◆ EVE_CoCmd_flashUpdate()

static void EVE_CoCmd_flashUpdate ( EVE_HalContext phost,
uint32_t  dest,
uint32_t  src,
uint32_t  num 
)
inlinestatic

Send CMD_FLASHUPDATE. This command must be followed by the data to write.

Parameters
phostPointer to Hal context
destdestination address in flash memory. Must be 4096-byte aligned
srcsource data in main memory. Must be 4-byte aligned
numnumber of bytes to write, must be multiple of 4096

Definition at line 704 of file EVE_CoCmd.h.

705{
707 EVE_CoCmd_dddd(phost, CMD_FLASHUPDATE, dest, src, num);
708}
#define CMD_FLASHUPDATE

◆ EVE_CoCmd_flashWrite()

static void EVE_CoCmd_flashWrite ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_FLASHWRITE. This command must be followed by the data to write.

Parameters
phostPointer to Hal context
ptrdestination address in flash memory. Must be 256-byte aligned
numnumber of bytes to write, must be multiple of 256

Definition at line 665 of file EVE_CoCmd.h.

666{
668 EVE_CoCmd_ddd(phost, CMD_FLASHWRITE, ptr, num);
669}
#define CMD_FLASHWRITE

◆ EVE_CoCmd_gauge()

static void EVE_CoCmd_gauge ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  r,
uint16_t  options,
uint16_t  major,
uint16_t  minor,
uint16_t  val,
uint16_t  range 
)
inlinestatic

Send CMD_GAUGE.

Parameters
phostPointer to Hal context
xx-coordinate of gauge center, in pixels
yy-coordinate of gauge center, in pixels
rradius of the gauge, in pixels
optionsDrawing option
majorNumber of major subdivisions on the dial, 1-10
minorNumber of minor subdivisions on the dial, 1-10
valgauge indicated value, between 0 and range, inclusive
rangemaximum value

Definition at line 1505 of file EVE_CoCmd.h.

1506{
1507 EVE_CoCmd_dwwwwwwww(phost, CMD_GAUGE, x, y, r, options, major, minor, val, range);
1508
1509#if (EVE_DL_OPTIMIZE)
1510 phost->DlPrimitive = 0;
1511#endif
1512}
#define CMD_GAUGE

◆ EVE_CoCmd_getMatrix()

EVE_HAL_EXPORT bool EVE_CoCmd_getMatrix ( EVE_HalContext phost,
int32_t m 
)

Send CMD_GETMATRIX.

Parameters
phostPointer to Hal context
moutput parameters; 6 values; written with matrix coeffcients a, b, c, d, e, f

Definition at line 391 of file EVE_CoCmd.c.

392{
393 uint16_t resAddr;
394 int i;
395
396#if EVE_CMD_HOOKS
397 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_GETMATRIX, 0))
398 return false;
399#endif
400
401 EVE_Cmd_startFunc(phost);
403 resAddr = EVE_Cmd_moveWp(phost, 6 * 4);
404 EVE_Cmd_endFunc(phost);
405
406 /* Read result */
407 if (m)
408 {
409 if (!EVE_Cmd_waitFlush(phost))
410 return false;
412 for (i = 0; i < 6; ++i)
413 m[i] = EVE_Hal_transfer32(phost, 0);
414 EVE_Hal_endTransfer(phost);
415 }
416 return true;
417}
#define CMD_GETMATRIX
EVE_HAL_EXPORT void EVE_Hal_startTransfer(EVE_HalContext *phost, EVE_TRANSFER_T rw, uint32_t addr)
Start data transfer to Coprocessor.
@ EVE_TRANSFER_READ
Definition EVE_HalDefs.h:67
EVE_HAL_EXPORT void EVE_Hal_endTransfer(EVE_HalContext *phost)
End data transfer.
EVE_HAL_EXPORT uint32_t EVE_Hal_transfer32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor.

◆ EVE_CoCmd_getProps()

EVE_HAL_EXPORT bool EVE_CoCmd_getProps ( EVE_HalContext phost,
uint32_t ptr,
uint32_t w,
uint32_t h 
)

Get the image properties decompressed by CMD_LOADIMAGE.

Parameters
phostPointer to Hal context
ptrSource address of bitmap
wWidth of bitmap, in pixels
hHeight of bitmap, in pixels
Returns
bool Returns false on coprocessor fault

Definition at line 150 of file EVE_CoCmd_IO.c.

151{
152 uint16_t resAddr;
153
154#if EVE_CMD_HOOKS
155 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_GETPROPS, 0))
156 return false;
157#endif
158
159 EVE_Cmd_startFunc(phost);
161 resAddr = EVE_Cmd_moveWp(phost, 12);
162 EVE_Cmd_endFunc(phost);
163
164 /* Read result */
165 if (ptr || w || h)
166 {
167 if (!EVE_Cmd_waitFlush(phost))
168 return false;
169 if (ptr)
170 *ptr = EVE_Hal_rd32(phost, RAM_CMD + resAddr);
171 if (w)
172 *w = EVE_Hal_rd32(phost, RAM_CMD + resAddr + 4);
173 if (h)
174 *h = EVE_Hal_rd32(phost, RAM_CMD + resAddr + 8);
175 }
176 return true;
177}
#define CMD_GETPROPS

◆ EVE_CoCmd_getPtr()

EVE_HAL_EXPORT bool EVE_CoCmd_getPtr ( EVE_HalContext phost,
uint32_t result 
)

Get the end memory address of data inflated by CMD_INFLATE.

Parameters
phostPointer to Hal context
resultmemory address

Get the end memory address of data inflated by CMD_INFLATE.

  • cmd_loadimage
  • cmd_playvideo
  • cmd_videoframe
  • cmd_endlist

Definition at line 104 of file EVE_CoCmd_IO.c.

105{
106 uint16_t resAddr;
107
108#if EVE_CMD_HOOKS
109 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_GETPTR, 0))
110 return false;
111#endif
112
113 EVE_Cmd_startFunc(phost);
114 EVE_Cmd_wr32(phost, CMD_GETPTR);
115 resAddr = EVE_Cmd_moveWp(phost, 4); // move write pointer to result location
116 EVE_Cmd_endFunc(phost);
117
118 /* Read result */
119 if (result)
120 {
121 if (!EVE_Cmd_waitFlush(phost))
122 return false;
123 *result = EVE_Hal_rd32(phost, RAM_CMD + resAddr);
124 }
125 return true;
126}
#define CMD_GETPTR

◆ EVE_CoCmd_gradColor()

static void EVE_CoCmd_gradColor ( EVE_HalContext phost,
uint32_t  c 
)
inlinestatic

Send CMD_GRADCOLOR.

Parameters
phostPointer to Hal context
cNew highlight gradient color, as a 24-bit RGB number

Definition at line 1107 of file EVE_CoCmd.h.

1108{
1109 EVE_CoCmd_dd(phost, CMD_GRADCOLOR, c);
1110}
#define CMD_GRADCOLOR

◆ EVE_CoCmd_gradient()

static void EVE_CoCmd_gradient ( EVE_HalContext phost,
int16_t  x0,
int16_t  y0,
uint32_t  rgb0,
int16_t  x1,
int16_t  y1,
uint32_t  rgb1 
)
inlinestatic

Send CMD_GRADIENT.

Parameters
phostPointer to Hal context
x0x-coordinate of point 0, in pixels
y0y-coordinate of point 0, in pixels
rgb0Color of point 0, as a 24-bit RGB number
x1x-coordinate of point 1, in pixels
y1y-coordinate of point 1, in pixels
rgb1Color of point 1

Definition at line 1275 of file EVE_CoCmd.h.

1276{
1277 EVE_CoCmd_dwwdwwd(phost, CMD_GRADIENT, x0, y0, rgb0, x1, y1, rgb1);
1278
1279#if (EVE_DL_OPTIMIZE)
1280 phost->DlPrimitive = 0;
1281#endif
1282}
EVE_HAL_EXPORT void EVE_CoCmd_dwwdwwd(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint32_t d2, uint16_t w3, uint16_t w4, uint32_t d5)
Definition EVE_CoCmd.c:178
#define CMD_GRADIENT

◆ EVE_CoCmd_gradientA()

static void EVE_CoCmd_gradientA ( EVE_HalContext phost,
int16_t  x0,
int16_t  y0,
uint32_t  argb0,
int16_t  x1,
int16_t  y1,
uint32_t  argb1 
)
inlinestatic

Send CMD_GRADIENTA.

Parameters
phostPointer to Hal context
x0x-coordinate of point 0, in pixels
y0y-coordinate of point 0, in pixels
argb0Color of point 0, as a 24-bit RGB number
x1x-coordinate of point 1, in pixels
y1y-coordinate of point 1, in pixels
argb1Color of point 1

Definition at line 1604 of file EVE_CoCmd.h.

1605{
1607 EVE_CoCmd_dwwdwwd(phost, CMD_GRADIENTA, x0, y0, argb0, x1, y1, argb1);
1608
1609#if (EVE_DL_OPTIMIZE)
1610 phost->DlPrimitive = 0;
1611#endif
1612}
#define CMD_GRADIENTA

◆ EVE_CoCmd_inflate()

static void EVE_CoCmd_inflate ( EVE_HalContext phost,
uint32_t  ptr 
)
inlinestatic

Send CMD_INFLATE. Data must follow this command.

Parameters
phostPointer to Hal context
ptrDestination address

Definition at line 503 of file EVE_CoCmd.h.

504{
505 EVE_CoCmd_dd(phost, CMD_INFLATE, ptr);
506}
#define CMD_INFLATE

◆ EVE_CoCmd_inflate2()

static void EVE_CoCmd_inflate2 ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  options 
)
inlinestatic

Send CMD_INFLATE2.

Parameters
phostPointer to Hal context
ptrDestination address
optionsOPT_MEDIAFIFO or OPT_FLASH or 0

Definition at line 863 of file EVE_CoCmd.h.

864{
866 EVE_CoCmd_ddd(phost, CMD_INFLATE2, ptr, options);
867}
#define CMD_INFLATE2

◆ EVE_CoCmd_inflate_flash()

EVE_HAL_EXPORT bool EVE_CoCmd_inflate_flash ( EVE_HalContext phost,
uint32_t  dst,
uint32_t  src 
)

Inflates data from Flash to RAM_G.

Parameters
phostPointer to Hal context
dstImage location on flash
srcDestination on RAM_G
Returns
bool Returns false on coprocessor fault

Definition at line 295 of file EVE_CoCmd_IO.c.

296{
297#if EVE_CMD_HOOKS
298 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_FLASHSOURCE, src))
299 return false;
300 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_INFLATE2, dst))
301 return false;
302#endif
303
304 if (!EVE_Cmd_waitFlush(phost))
305 return false; // Coprocessor must be ready
306 EVE_Cmd_startFunc(phost);
308 EVE_Cmd_wr32(phost, src);
310 EVE_Cmd_wr32(phost, dst);
311 EVE_Cmd_wr32(phost, OPT_FLASH);
312 EVE_Cmd_endFunc(phost);
313 return EVE_Cmd_waitFlush(phost); // Image failed to load
314}
#define OPT_FLASH

◆ EVE_CoCmd_inflate_progMem()

EVE_HAL_EXPORT bool EVE_CoCmd_inflate_progMem ( EVE_HalContext phost,
uint32_t  dst,
eve_progmem_const uint8_t src,
uint32_t  size 
)

Inflates data from program memory to RAM_G.

Parameters
phostPointer to Hal context
dstImage address
srcDesination on RAM_G
sizesize of src in bytes
Returns
Returns false on coprocessor fault

Definition at line 85 of file EVE_CoCmd_IO.c.

86{
87 if (!EVE_Cmd_waitFlush(phost))
88 return false; // Coprocessor must be ready
89 EVE_Cmd_startFunc(phost);
91 EVE_Cmd_wr32(phost, dst);
92 EVE_Cmd_wrProgMem(phost, src, (size + 3) & ~0x3UL);
93 EVE_Cmd_endFunc(phost);
94 return EVE_Cmd_waitFlush(phost); // Resource failed to load
95}
EVE_HAL_EXPORT bool EVE_Cmd_wrProgMem(EVE_HalContext *phost, eve_progmem_const uint8_t *buffer, uint32_t size)
Write buffer in ProgMem to Coprocessor's comand fifo.
Definition EVE_Cmd.c:307

◆ EVE_CoCmd_interrupt()

static void EVE_CoCmd_interrupt ( EVE_HalContext phost,
uint32_t  ms 
)
inlinestatic

Send CMD_INTERRUPT.

Parameters
phostPointer to Hal context
msDelay before interrupt triggers, in milliseconds. The interrupt is guaranteed not to fire before this delay. If ms is zero, the interrupt fires immediately

Definition at line 184 of file EVE_CoCmd.h.

185{
186 EVE_CoCmd_dd(phost, CMD_INTERRUPT, ms);
187}
#define CMD_INTERRUPT

◆ EVE_CoCmd_keys()

EVE_HAL_EXPORT void EVE_CoCmd_keys ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
int16_t  font,
uint16_t  options,
const char *  s 
)

Send CMD_KEYS.

Parameters
phostPointer to Hal context
xx-coordinate of keys top-left, in pixels
yy-coordinate of keys top-left, in pixels
wKeys width
hKeys height
fontFont for keys label
optionsDrawing option
skey labels, one character per key

Definition at line 199 of file EVE_CoCmd_Widgets.c.

200{
201#if EVE_CMD_HOOKS
202 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_KEYS, 0))
203 return;
204#endif
205
206 if (font >= 32)
207 {
208 if (font != 63)
209 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
210 return;
211 }
212
213 EVE_Cmd_startFunc(phost);
214 EVE_Cmd_wr32(phost, CMD_KEYS);
215 EVE_Cmd_wr16(phost, x);
216 EVE_Cmd_wr16(phost, y);
217 EVE_Cmd_wr16(phost, w);
218 EVE_Cmd_wr16(phost, h);
219 EVE_Cmd_wr16(phost, font);
220 EVE_Cmd_wr16(phost, options);
222 EVE_Cmd_endFunc(phost);
223
224#if (EVE_DL_OPTIMIZE)
225 phost->DlPrimitive = 0;
226#endif
227}
#define CMD_KEYS

◆ EVE_CoCmd_loadIdentity()

static void EVE_CoCmd_loadIdentity ( EVE_HalContext phost)
inlinestatic

Send CMD_LOADIDENTITY.

Parameters
phostPointer to Hal context

Definition at line 998 of file EVE_CoCmd.h.

999{
1001
1002#if EVE_DL_OPTIMIZE
1003 phost->CoBitmapTransform = false; /* Identity */
1004#endif
1005}
#define CMD_LOADIDENTITY

◆ EVE_CoCmd_loadImage()

static void EVE_CoCmd_loadImage ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  options 
)
inlinestatic

Send CMD_LOADIMAGE. Data must follow this command.

Parameters
phostPointer to Hal context
ptrDestination address
optionsCommand option

Definition at line 534 of file EVE_CoCmd.h.

535{
536 EVE_CoCmd_ddd(phost, CMD_LOADIMAGE, ptr, options);
537}
#define CMD_LOADIMAGE

◆ EVE_CoCmd_loadImage_flash()

EVE_HAL_EXPORT bool EVE_CoCmd_loadImage_flash ( EVE_HalContext phost,
uint32_t  dst,
uint32_t  src,
uint32_t format 
)

Load image from Flash to RAM_G.

Parameters
phostPointer to Hal context
dstImage location on flash
srcDestination on RAM_G
formatOutput parameter format returns loaded bitmap format on success
Returns
bool Returns false on coprocessor fault

Definition at line 270 of file EVE_CoCmd_IO.c.

271{
272#if EVE_CMD_HOOKS
273 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_FLASHSOURCE, src))
274 return false;
275 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_LOADIMAGE, dst))
276 return false;
277#endif
278
279 if (!EVE_Cmd_waitFlush(phost))
280 return false; // Coprocessor must be ready
281 EVE_Cmd_startFunc(phost);
283 EVE_Cmd_wr32(phost, src);
285 EVE_Cmd_wr32(phost, dst);
287 EVE_Cmd_endFunc(phost);
288 if (!EVE_Cmd_waitFlush(phost))
289 return false; // Image failed to load
290 if (format)
291 *format = EVE_Hal_rd32(phost, 0x3097e8);
292 return true;
293}
#define OPT_NODL

◆ EVE_CoCmd_loadImage_progMem()

EVE_HAL_EXPORT bool EVE_CoCmd_loadImage_progMem ( EVE_HalContext phost,
uint32_t  dst,
eve_progmem_const uint8_t src,
uint32_t  size,
uint32_t format 
)

Load image from program memory.

Parameters
phostPointer to Hal context
dstImage address
srcDesination on RAM_G
sizesize of src in bytes
formatOutput parameter format returns loaded bitmap format on success
Returns
bool Returns false on coprocessor fault

Definition at line 128 of file EVE_CoCmd_IO.c.

129{
130#if EVE_CMD_HOOKS
131 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_LOADIMAGE, dst))
132 return false;
133#endif
134
135 if (!EVE_Cmd_waitFlush(phost))
136 return false; // Coprocessor must be ready
137 EVE_Cmd_startFunc(phost);
139 EVE_Cmd_wr32(phost, dst);
140 EVE_Cmd_wr32(phost, OPT_NODL);
141 EVE_Cmd_wrProgMem(phost, src, (size + 3) & ~0x3UL);
142 EVE_Cmd_endFunc(phost);
143 if (!EVE_Cmd_waitFlush(phost))
144 return false; // Image failed to load
145 if (format)
146 *format = EVE_Hal_rd32(phost, 0x3097e8);
147 return true;
148}

◆ EVE_CoCmd_logo()

static void EVE_CoCmd_logo ( EVE_HalContext phost)
inlinestatic

Send CMD_LOGO.

Parameters
phostPointer to Hal context

Definition at line 1714 of file EVE_CoCmd.h.

1715{
1716 EVE_CoCmd_d(phost, CMD_LOGO);
1717
1718#if (EVE_DL_OPTIMIZE)
1719 phost->DlPrimitive = 0;
1720#endif
1721}
#define CMD_LOGO

◆ EVE_CoCmd_mediaFifo()

static void EVE_CoCmd_mediaFifo ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  size 
)
inlinestatic

Send CMD_MEDIAFIFO. See EVE_MediaFifo interface for easier FIFO access.

Parameters
phostPointer to Hal context
ptrstarting address of the memory block, 4-byte aligned
sizenumber of bytes in the source memory block, 4-byte aligned

Definition at line 588 of file EVE_CoCmd.h.

589{
591 EVE_CoCmd_ddd(phost, CMD_MEDIAFIFO, ptr, size);
592}
#define EVE_FT810
Definition EVE_Config.h:58
#define CMD_MEDIAFIFO

◆ EVE_CoCmd_memCpy()

static void EVE_CoCmd_memCpy ( EVE_HalContext phost,
uint32_t  dest,
uint32_t  src,
uint32_t  num 
)
inlinestatic

Send CMD_MEMCPY.

Parameters
phostPointer to Hal context
destaddress of the destination memory block
srcaddress of the source memory block
numnumber of bytes to copy

Definition at line 465 of file EVE_CoCmd.h.

466{
467 EVE_CoCmd_dddd(phost, CMD_MEMCPY, dest, src, num);
468}
#define CMD_MEMCPY

◆ EVE_CoCmd_memCrc()

EVE_HAL_EXPORT bool EVE_CoCmd_memCrc ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num,
uint32_t result 
)

Send CMD_MEMCRC.

Parameters
phostPointer to Hal context
ptrstarting address of the memory block
numnumber of bytes in the source memory block
resultoutput parameter; written with the CRC-32 after command execution
Returns
bool Returns false in case of error

Definition at line 34 of file EVE_CoCmd_IO.c.

35{
36 uint16_t resAddr;
37
38#if EVE_CMD_HOOKS
39 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_MEMCRC, 0))
40 return false;
41#endif
42
43 EVE_Cmd_startFunc(phost);
45 EVE_Cmd_wr32(phost, ptr);
46 EVE_Cmd_wr32(phost, num);
47 resAddr = EVE_Cmd_moveWp(phost, 4);
48 EVE_Cmd_endFunc(phost);
49
50 /* Read result */
51 if (result)
52 {
53 if (!EVE_Cmd_waitFlush(phost))
54 return false;
55 *result = EVE_Hal_rd32(phost, RAM_CMD + resAddr);
56 }
57 return true;
58}
#define CMD_MEMCRC

◆ EVE_CoCmd_memSet()

static void EVE_CoCmd_memSet ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  value,
uint32_t  num 
)
inlinestatic

Send CMD_MEMSET.

Parameters
phostPointer to Hal context
ptrstarting address of the memory block
valuevalue to be written to memory
numnumber of bytes in the memory block

Definition at line 431 of file EVE_CoCmd.h.

432{
433 EVE_CoCmd_dddd(phost, CMD_MEMSET, ptr, value, num);
434}
#define CMD_MEMSET

◆ EVE_CoCmd_memWrite()

static void EVE_CoCmd_memWrite ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_MEMWRITE.

You must write the specified number of bytes using one or more of any EVE_Cmd_wr... function call after calling this command, and pad the written data to align at 4 bytes

Parameters
phostPointer to Hal context
ptrDestination on RAM_G
numnumber of bytes to copy

Definition at line 398 of file EVE_CoCmd.h.

399{
400 EVE_CoCmd_ddd(phost, CMD_MEMWRITE, ptr, num);
401}
#define CMD_MEMWRITE

◆ EVE_CoCmd_memWrite32()

static void EVE_CoCmd_memWrite32 ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  value 
)
inlinestatic

Send CMD_MEMWRITE, followed by a single 32-bit value.

Convenience function to write one 32-bit value through the coprocessor. Useful in combination with EVE_Cmd_waitRead32 to add synchronization points into the command buffer.

Parameters
phostPointer to Hal context
ptrDestination on RAM_G
valueValue to write

Definition at line 413 of file EVE_CoCmd.h.

414{
415 EVE_CoCmd_dddd(phost, CMD_MEMWRITE, ptr, 4, value);
416}

◆ EVE_CoCmd_memZero()

static void EVE_CoCmd_memZero ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t  num 
)
inlinestatic

Send CMD_MEMZERO.

Parameters
phostPointer to Hal context
ptrDestination on RAM_G
numnumber of bytes to clear

Definition at line 447 of file EVE_CoCmd.h.

448{
449 EVE_CoCmd_ddd(phost, CMD_MEMZERO, ptr, num);
450}
#define CMD_MEMZERO

◆ EVE_CoCmd_nop()

static void EVE_CoCmd_nop ( EVE_HalContext phost)
inlinestatic

Send CMD_NOP.

Parameters
phostPointer to Hal context

Definition at line 255 of file EVE_CoCmd.h.

256{
258 EVE_CoCmd_d(phost, CMD_NOP);
259}
#define CMD_NOP

◆ EVE_CoCmd_number()

EVE_HAL_EXPORT void EVE_CoCmd_number ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  font,
uint16_t  options,
int32_t  n 
)

Send CMD_NUMBER.

Parameters
phostPointer to Hal context
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontfont to use for text, 0-31
optionsDrawing option
nThe number to display, either unsigned or signed 32-bit

Definition at line 277 of file EVE_CoCmd_Widgets.c.

278{
279#if EVE_CMD_HOOKS
280 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_NUMBER, 0))
281 return;
282#endif
283
284 if (font >= 32)
285 {
286 if (font != 63)
287 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
288 return;
289 }
290
291 EVE_Cmd_startFunc(phost);
292 EVE_Cmd_wr32(phost, CMD_NUMBER);
293 EVE_Cmd_wr16(phost, x);
294 EVE_Cmd_wr16(phost, y);
295 EVE_Cmd_wr16(phost, font);
296 EVE_Cmd_wr16(phost, options);
297 EVE_Cmd_wr32(phost, n);
298 EVE_Cmd_endFunc(phost);
299
300#if (EVE_DL_OPTIMIZE)
301 phost->DlPrimitive = 0;
302#endif
303}
#define CMD_NUMBER

◆ EVE_CoCmd_playVideo()

static void EVE_CoCmd_playVideo ( EVE_HalContext phost,
uint32_t  options 
)
inlinestatic

Send CMD_PLAYVIDEO.

Parameters
phostPointer to Hal context
optionsCommand option

Definition at line 1762 of file EVE_CoCmd.h.

1763{
1765 EVE_CoCmd_dd(phost, CMD_PLAYVIDEO, options);
1766
1767#if (EVE_DL_OPTIMIZE)
1768 phost->DlPrimitive = 0;
1769#endif
1770
1771 if (options & (OPT_FLASH | OPT_MEDIAFIFO))
1772 {
1773 /* WORKAROUND: CMD_PLAYVIDEO completes immediately,
1774 but the command following it does not.
1775 Write a CMD_NOP command to behave as documented */
1776#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
1777 if (EVE_CHIPID >= EVE_BT815)
1778 EVE_CoCmd_nop(phost);
1779 else
1780#endif
1781 EVE_CoCmd_memCpy(phost, 0, 0, 1);
1782 }
1783}
static void EVE_CoCmd_memCpy(EVE_HalContext *phost, uint32_t dest, uint32_t src, uint32_t num)
Send CMD_MEMCPY.
Definition EVE_CoCmd.h:465
static void EVE_CoCmd_nop(EVE_HalContext *phost)
Send CMD_NOP.
Definition EVE_CoCmd.h:255
#define OPT_MEDIAFIFO
#define CMD_PLAYVIDEO

◆ EVE_CoCmd_progress()

static void EVE_CoCmd_progress ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  options,
uint16_t  val,
uint16_t  range 
)
inlinestatic

Send CMD_PROGRESS.

Parameters
phostPointer to Hal context
xx-coordinate of progress bar top-left, in pixels
yy-coordinate of progress bar top-left, in pixels
wwidth of progress bar, in pixels
hheight of progress bar, in pixels
optionsDrawing option
valDisplayed value of progresss bar, between 0 and range inclusive
rangeMaximum value

Definition at line 1396 of file EVE_CoCmd.h.

1397{
1398 EVE_CoCmd_dwwwwwww(phost, CMD_PROGRESS, x, y, w, h, options, val, range);
1399
1400#if (EVE_DL_OPTIMIZE)
1401 phost->DlPrimitive = 0;
1402#endif
1403}
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwwww(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5, uint16_t w6)
Definition EVE_CoCmd.c:294
#define CMD_PROGRESS

◆ EVE_CoCmd_regRead()

EVE_HAL_EXPORT bool EVE_CoCmd_regRead ( EVE_HalContext phost,
uint32_t  ptr,
uint32_t result 
)

Send CMD_REGREAD.

Parameters
phostPointer to Hal context
ptraddress of register to read
resultoutput parameter; written with the register value
Returns
bool Returns false in case of error

Definition at line 60 of file EVE_CoCmd_IO.c.

61{
62 uint16_t resAddr;
63
64#if EVE_CMD_HOOKS
65 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_REGREAD, 0))
66 return false;
67#endif
68
69 EVE_Cmd_startFunc(phost);
71 EVE_Cmd_wr32(phost, ptr);
72 resAddr = EVE_Cmd_moveWp(phost, 4);
73 EVE_Cmd_endFunc(phost);
74
75 /* Read result */
76 if (result)
77 {
78 if (!EVE_Cmd_waitFlush(phost))
79 return false;
80 *result = EVE_Hal_rd32(phost, RAM_CMD + resAddr);
81 }
82 return true;
83}
#define CMD_REGREAD

◆ EVE_CoCmd_resetFonts()

static void EVE_CoCmd_resetFonts ( EVE_HalContext phost)
inlinestatic

Send CMD_RESETFONT.

Parameters
phostPointer to Hal context

Definition at line 1226 of file EVE_CoCmd.h.

1227{
1230}
#define CMD_RESETFONTS

◆ EVE_CoCmd_romFont()

static void EVE_CoCmd_romFont ( EVE_HalContext phost,
uint32_t  font,
uint32_t  romslot 
)
inlinestatic

Send CMD_ROMFONT.

Parameters
phostPointer to Hal context
fontFont number
romslotSlot number

Definition at line 1166 of file EVE_CoCmd.h.

1167{
1169 EVE_CoCmd_ddd(phost, CMD_ROMFONT, font, romslot);
1170#if EVE_DL_OPTIMIZE
1171 EVE_DL_STATE.Handle = (uint8_t)font;
1172#endif
1173}
#define CMD_ROMFONT

◆ EVE_CoCmd_rotate()

static void EVE_CoCmd_rotate ( EVE_HalContext phost,
int32_t  a 
)
inlinestatic

Send CMD_ROTATE.

Parameters
phostPointer to Hal context
aclockwise rotation angle, in units of 1/65536 of a circle

Definition at line 1056 of file EVE_CoCmd.h.

1057{
1058 EVE_CoCmd_dd(phost, CMD_ROTATE, a);
1059
1060#if EVE_DL_OPTIMIZE
1061 phost->CoBitmapTransform = true;
1062#endif
1063}
static uint32_t a
Definition Common.c:36
#define CMD_ROTATE

◆ EVE_CoCmd_rotateAround()

static void EVE_CoCmd_rotateAround ( EVE_HalContext phost,
int32_t  x,
int32_t  y,
int32_t  a,
int32_t  s 
)
inlinestatic

Send CMD_ROTATEAROUND.

Parameters
phostPointer to Hal context
xcenter of rotation/scaling, x-coordinate
ycenter of rotation/scaling, y-coordinate
aclockwise rotation angle, in units of 1/65536 of a circle
sscale factor, in signed 16.16 bit fixed-point form

Definition at line 1211 of file EVE_CoCmd.h.

1212{
1214 EVE_CoCmd_ddddd(phost, CMD_ROTATEAROUND, x, y, a, s);
1215
1216#if EVE_DL_OPTIMIZE
1217 phost->CoBitmapTransform = true;
1218#endif
1219}
EVE_HAL_EXPORT void EVE_CoCmd_ddddd(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint32_t d2, uint32_t d3)
Definition EVE_CoCmd.c:91
#define CMD_ROTATEAROUND

◆ EVE_CoCmd_scale()

static void EVE_CoCmd_scale ( EVE_HalContext phost,
int32_t  sx,
int32_t  sy 
)
inlinestatic

Send CMD_SCALE.

Parameters
phostPointer to Hal context
sxx scale factor, in signed 16.16 bit fixed-point form
syy scale factor, in signed 16.16 bit fixed-point form

Definition at line 1038 of file EVE_CoCmd.h.

1039{
1040 EVE_CoCmd_ddd(phost, CMD_SCALE, sx, sy);
1041
1042#if EVE_DL_OPTIMIZE
1043 phost->CoBitmapTransform = true;
1044#endif
1045}
#define CMD_SCALE

◆ EVE_CoCmd_screenSaver()

static void EVE_CoCmd_screenSaver ( EVE_HalContext phost)
inlinestatic

Send CMD_SCREENSAVER.

Parameters
phostPointer to Hal context

Definition at line 1680 of file EVE_CoCmd.h.

1681{
1683
1684#if (EVE_DL_OPTIMIZE)
1685 phost->DlPrimitive = 0;
1686#endif
1687}
#define CMD_SCREENSAVER

◆ EVE_CoCmd_scrollbar()

static void EVE_CoCmd_scrollbar ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  options,
uint16_t  val,
uint16_t  size,
uint16_t  range 
)
inlinestatic

Send CMD_SCROLLBAR.

Parameters
phostPointer to Hal context
xx-coordinate of scroll bar top-left, in pixels
yy-coordinate of scroll bar top-left, in pixels
wwidth of scroll bar, in pixels. If width is greater, the scroll bar is drawn horizontally
hheight of scroll bar, in pixels. If height is greater, the scroll bar is drawn vertically
optionsBy default the scroll bar is drawn with a 3D effect. OPT FLAT removes the 3D effect
valDisplayed value of scroll bar, between 0 and range inclusive
sizeScrol bar size
rangeMaximum value

Definition at line 1458 of file EVE_CoCmd.h.

1459{
1460 EVE_CoCmd_dwwwwwwww(phost, CMD_SCROLLBAR, x, y, w, h, options, val, size, range);
1461
1462#if (EVE_DL_OPTIMIZE)
1463 phost->DlPrimitive = 0;
1464#endif
1465}
#define CMD_SCROLLBAR

◆ EVE_CoCmd_setBase()

static void EVE_CoCmd_setBase ( EVE_HalContext phost,
uint32_t  base 
)
inlinestatic

Send CMD_SETBASE.

Parameters
phostPointer to Hal context
baseNumeric base, from 2 to 36

Definition at line 1123 of file EVE_CoCmd.h.

1124{
1126 EVE_CoCmd_dd(phost, CMD_SETBASE, base);
1127}
#define CMD_SETBASE

◆ EVE_CoCmd_setBitmap()

static void EVE_CoCmd_setBitmap ( EVE_HalContext phost,
uint32_t  source,
uint16_t  fmt,
uint16_t  w,
uint16_t  h 
)
inlinestatic

Send CMD_SETBITMAP.

Parameters
phostPointer to Hal context
sourceSource address for bitmap, in RAM or flash, as a BITMAP SOURCEargument
fmtBitmap format
wBitmap screen width in pixels
hBitmap screen height in pixels

Definition at line 1184 of file EVE_CoCmd.h.

1185{
1187 EVE_CoCmd_ddwww(phost, CMD_SETBITMAP, source, fmt, w, h);
1188}
EVE_HAL_EXPORT void EVE_CoCmd_ddwww(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint16_t w1, uint16_t w2, uint16_t w3)
Definition EVE_CoCmd.c:123
#define CMD_SETBITMAP

◆ EVE_CoCmd_setFont()

static void EVE_CoCmd_setFont ( EVE_HalContext phost,
uint32_t  font,
uint32_t  ptr 
)
inlinestatic

Send CMD_SETFONT.

Parameters
phostPointer to Hal context
fontbitmap handle number, 0-31
ptrpointer to font description block

Definition at line 1093 of file EVE_CoCmd.h.

1094{
1095 EVE_CoCmd_ddd(phost, CMD_SETFONT, font, ptr);
1096}
#define CMD_SETFONT

◆ EVE_CoCmd_setFont2()

static void EVE_CoCmd_setFont2 ( EVE_HalContext phost,
uint32_t  font,
uint32_t  ptr,
uint32_t  firstchar 
)
inlinestatic

Send CMD_SETFONT2.

Parameters
phostPointer to Hal context
fontbitmap handle number, 0-31
ptrpointer to font description block
firstcharfirst character in the font. For an extended font block, this should be zero

Definition at line 1137 of file EVE_CoCmd.h.

1138{
1140 EVE_CoCmd_dddd(phost, CMD_SETFONT2, font, ptr, firstchar);
1141#if EVE_DL_OPTIMIZE
1142 EVE_DL_STATE.Handle = (uint8_t)font;
1143#endif
1144}
#define CMD_SETFONT2

◆ EVE_CoCmd_setMatrix()

static void EVE_CoCmd_setMatrix ( EVE_HalContext phost)
inlinestatic

Send CMD_SETMATRIX.

Parameters
phostPointer to Hal context

Definition at line 1072 of file EVE_CoCmd.h.

1073{
1074#if EVE_DL_OPTIMIZE
1075 if (phost->CoBitmapTransform || EVE_DL_STATE.BitmapTransform)
1076 {
1077 /* Setting matrix can be skipped if both are identity, since it's a no-op */
1078#endif
1079 EVE_CoCmd_d(phost, CMD_SETMATRIX);
1080#if EVE_DL_OPTIMIZE
1081 EVE_DL_STATE.BitmapTransform = phost->CoBitmapTransform; /* Coprocessor matrix is now written to the display list */
1082 }
1083#endif
1084}
#define CMD_SETMATRIX

◆ EVE_CoCmd_setRotate()

EVE_HAL_EXPORT void EVE_CoCmd_setRotate ( EVE_HalContext phost,
uint32_t  r 
)

CMD_SETROTATE.

Parameters
phostPointer to Hal context
rnew rotation value 0-7

Definition at line 419 of file EVE_CoCmd.c.

420{
421#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
422 const bool swapXY = EVE_CHIPID >= EVE_FT810 ? r & 0x2 : false;
423#endif
424
425#if EVE_CMD_HOOKS
426 /* Check hook */
427 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_SETROTATE, r))
428 return;
429#endif
430
431#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
432 if (EVE_CHIPID >= EVE_FT810)
433 {
434 /* Update cached width and height based on rotation */
435 if (swapXY)
436 {
437 phost->Width = EVE_Hal_rd16(phost, REG_VSIZE);
438 phost->Height = EVE_Hal_rd16(phost, REG_HSIZE);
439 }
440 else
441 {
442 phost->Width = EVE_Hal_rd16(phost, REG_HSIZE);
443 phost->Height = EVE_Hal_rd16(phost, REG_VSIZE);
444 }
445
446 /* Command */
447 EVE_Cmd_startFunc(phost);
449 EVE_Cmd_wr32(phost, r);
450 EVE_Cmd_endFunc(phost);
451 }
452 else
453#endif
454 {
455 /* Software based fallback for FT80X */
456 EVE_Hal_wr32(phost, REG_ROTATE, r);
457
458 /* TODO: Adjust touch transform matrix */
459 }
460
461 /* Don't keep this in the write buffer */
462 EVE_Hal_flush(phost);
463}
#define REG_HSIZE
#define REG_ROTATE
#define REG_VSIZE
#define CMD_SETROTATE
EVE_HAL_EXPORT void EVE_Hal_wr32(EVE_HalContext *phost, uint32_t addr, uint32_t v)
Write 4 bytes to Coprocessor's memory.
Definition EVE_Hal.c:248
EVE_HAL_EXPORT void EVE_Hal_flush(EVE_HalContext *phost)
Flush data to Coprocessor.
uint32_t Height

◆ EVE_CoCmd_setScratch()

static void EVE_CoCmd_setScratch ( EVE_HalContext phost,
uint32_t  handle 
)
inlinestatic

Send CMD_SETSCRATCH.

Parameters
phostPointer to Hal context
handlebitmap handle number, 0-31

Definition at line 1152 of file EVE_CoCmd.h.

1153{
1155 EVE_CoCmd_dd(phost, CMD_SETSCRATCH, handle);
1156 phost->CoScratchHandle = (uint8_t)handle;
1157}
#define CMD_SETSCRATCH
uint8_t CoScratchHandle

◆ EVE_CoCmd_sketch()

static void EVE_CoCmd_sketch ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
uint16_t  w,
uint16_t  h,
uint32_t  ptr,
uint16_t  format 
)
inlinestatic

Send CMD_SKETCH.

Parameters
phostPointer to Hal context
xx-coordinate of sketch area top-left, in pixels
yy-coordinate of sketch area top-left, in pixels
wWidth of sketch area, in pixels
hHeight of sketch area, in pixels
ptrBase address of sketch bitmap
formatFormat of sketch bitmap, either L1 or L8

Definition at line 1700 of file EVE_CoCmd.h.

1701{
1702 EVE_CoCmd_dwwwwdw(phost, CMD_SKETCH, x, y, w, h, ptr, format);
1703
1704#if (EVE_DL_OPTIMIZE)
1705 phost->DlPrimitive = 0;
1706#endif
1707}
EVE_HAL_EXPORT void EVE_CoCmd_dwwwwdw(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3, uint32_t d4, uint16_t w5)
Definition EVE_CoCmd.c:198
#define CMD_SKETCH

◆ EVE_CoCmd_slider()

static void EVE_CoCmd_slider ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint16_t  options,
uint16_t  val,
uint16_t  range 
)
inlinestatic

Send CMD_SLIDER.

Parameters
phostPointer to Hal context
xx-coordinate of slider top-left, in pixels
yy-coordinate of slider top-left, in pixels
wwidth of slider, in pixels
hheight of slider, in pixels
optionsBy default the slider is drawn with a 3D effect. OPT_FLAT removes the 3D effect
valDisplayed value of slider, between 0 and range inclusive
rangeMaximum value

Definition at line 1426 of file EVE_CoCmd.h.

1427{
1428 EVE_CoCmd_dwwwwwww(phost, CMD_SLIDER, x, y, w, h, options, val, range);
1429
1430#if (EVE_DL_OPTIMIZE)
1431 phost->DlPrimitive = 0;
1432#endif
1433}
#define CMD_SLIDER

◆ EVE_CoCmd_snapshot()

static void EVE_CoCmd_snapshot ( EVE_HalContext phost,
uint32_t  ptr 
)
inlinestatic

Send CMD_SNAPSHOT.

Parameters
phostPointer to Hal context
ptrSnapshot destination address, in RAM_G

Definition at line 492 of file EVE_CoCmd.h.

493{
494 EVE_CoCmd_dd(phost, CMD_SNAPSHOT, ptr);
495}
#define CMD_SNAPSHOT

◆ EVE_CoCmd_snapshot2()

static void EVE_CoCmd_snapshot2 ( EVE_HalContext phost,
uint32_t  fmt,
uint32_t  ptr,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h 
)
inlinestatic

Send CMD_SNAPSHOT2.

Parameters
phostPointer to Hal context
fmtOutput bitmap format, one of RGB565, ARGB4 or 0x20
ptrSnapshot destination address, in RAM_G
xx-coordinate of snapshot area top-left, in pixels
yy-coordinate of snapshot area top-left, in pixels
wwidth of snapshot area, in pixels
hheight of snapshot area, in pixels

Definition at line 575 of file EVE_CoCmd.h.

576{
578 EVE_CoCmd_dddwwww(phost, CMD_SNAPSHOT2, fmt, ptr, x, y, w, h);
579}
EVE_HAL_EXPORT void EVE_CoCmd_dddwwww(EVE_HalContext *phost, uint32_t cmd, uint32_t d0, uint32_t d1, uint16_t w2, uint16_t w3, uint16_t w4, uint16_t w5)
Definition EVE_CoCmd.c:141
#define CMD_SNAPSHOT2

◆ EVE_CoCmd_spinner()

static void EVE_CoCmd_spinner ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
uint16_t  style,
uint16_t  scale 
)
inlinestatic

Send CMD_SPINNER.

Parameters
phostPointer to Hal context
xThe X coordinate of top left of spinner
yThe Y coordinate of top left of spinner
styleThe style of spinner. Valid range is from 0 to 3
scaleThe scaling coefficient of spinner. 0 means no scaling

Definition at line 1641 of file EVE_CoCmd.h.

1642{
1643 EVE_CoCmd_dwwww(phost, CMD_SPINNER, x, y, style, scale);
1644
1645#if (EVE_DL_OPTIMIZE)
1646 phost->DlPrimitive = 0;
1647#endif
1648}
EVE_HAL_EXPORT void EVE_CoCmd_dwwww(EVE_HalContext *phost, uint32_t cmd, uint16_t w0, uint16_t w1, uint16_t w2, uint16_t w3)
Definition EVE_CoCmd.c:240
#define CMD_SPINNER

◆ EVE_CoCmd_stop()

static void EVE_CoCmd_stop ( EVE_HalContext phost)
inlinestatic

Send CMD_STOP.

Parameters
phostPointer to Hal context

Definition at line 1655 of file EVE_CoCmd.h.

1656{
1657 EVE_CoCmd_d(phost, CMD_STOP);
1658}
#define CMD_STOP

◆ EVE_CoCmd_swap()

static void EVE_CoCmd_swap ( EVE_HalContext phost)
inlinestatic

Send CMD_SWAP.

Parameters
phost

Definition at line 170 of file EVE_CoCmd.h.

171{
172 EVE_CoCmd_d(phost, CMD_SWAP);
173}
#define CMD_SWAP

◆ EVE_CoCmd_sync()

static void EVE_CoCmd_sync ( EVE_HalContext phost)
inlinestatic

Send CMD_SYNC.

Parameters
phostPointer to Hal context

Definition at line 225 of file EVE_CoCmd.h.

226{
228 EVE_CoCmd_d(phost, CMD_SYNC);
229}
#define CMD_SYNC

◆ EVE_CoCmd_text()

EVE_HAL_EXPORT void EVE_CoCmd_text ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  font,
uint16_t  options,
const char *  s,
  ... 
)

Send CMD_TEXT.

Parameters
phostPointer to Hal context
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontFont to use for text, 0-31
optionsText option
sText string, UTF-8 encoding
...Text format

Definition at line 63 of file EVE_CoCmd_Widgets.c.

64{
65 va_list args;
66#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
67 uint8_t num;
68#endif
69
70#if EVE_CMD_HOOKS
71 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_TEXT, 0))
72 return;
73#endif
74
75 if (font >= 32)
76 {
77 if (font != 63)
78 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
79 return;
80 }
81 va_start(args, s);
82#if (EVE_SUPPORT_CHIPID >= EVE_BT815) /* OPT_FORMAT not defined in FT8xx chip */
83 num = (options & OPT_FORMAT) ? (countArgs(s)) : (0); /* Only check % characters if option OPT_FORMAT is set */
84#endif
85
86 EVE_Cmd_startFunc(phost);
87 EVE_Cmd_wr32(phost, CMD_TEXT);
88 EVE_Cmd_wr16(phost, x);
89 EVE_Cmd_wr16(phost, y);
90 EVE_Cmd_wr16(phost, font);
91 EVE_Cmd_wr16(phost, options);
93#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
94 if (EVE_CHIPID >= EVE_BT815)
95 {
96 for (uint8_t i = 0; i < num; i++)
97 EVE_Cmd_wr32(phost, (uint32_t)va_arg(args, uint32_t));
98 }
99#endif
100 EVE_Cmd_endFunc(phost);
101 va_end(args);
102
103#if (EVE_DL_OPTIMIZE)
104 phost->DlPrimitive = 0;
105#endif
106}
#define CMD_TEXT

◆ EVE_CoCmd_text_ex()

EVE_HAL_EXPORT void EVE_CoCmd_text_ex ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  font,
uint16_t  options,
bool  bottom,
int16_t  baseLine,
int16_t  capsHeight,
int16_t  xOffset,
const char *  s 
)

Send CMD_TEXT.

Parameters
phostPointer to Hal context
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontFont to use for text, 0-31
optionsText option
bottom
baseLine
capsHeight
xOffset
sText string, UTF-8 encoding

Definition at line 136 of file EVE_CoCmd_Widgets.c.

137{
138 int16_t yOffset;
139 if (options & OPT_CENTERY)
140 yOffset = baseLine - (capsHeight >> 1);
141 else if (bottom)
142 yOffset = baseLine;
143 else
144 yOffset = baseLine - capsHeight;
145 /*
146 if (options & OPT_RIGHTX)
147 xOffset = 0;
148 else if (options & OPT_CENTERX)
149 xOffset >>= 1;
150 */
151 EVE_CoCmd_text(phost, x - xOffset, y - yOffset, font, options & ~OPT_CENTERY, s);
152}
EVE_HAL_EXPORT void EVE_CoCmd_text(EVE_HalContext *phost, int16_t x, int16_t y, int16_t font, uint16_t options, const char *s,...)
Send CMD_TEXT.
#define OPT_CENTERY
short int16_t

◆ EVE_CoCmd_text_s()

EVE_HAL_EXPORT void EVE_CoCmd_text_s ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  font,
uint16_t  options,
const char *  s,
uint32_t  length 
)

Send CMD_TEXT with length.

Parameters
phostPointer to Hal context
xx-coordinate of text base, in pixels
yy-coordinate of text base, in pixels
fontFont to use for text, 0-31
optionsText option
sText string, UTF-8 encoding
lengthlength of text

Definition at line 108 of file EVE_CoCmd_Widgets.c.

109{
110#if EVE_CMD_HOOKS
111 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_TEXT, 0))
112 return;
113#endif
114
115 if (font >= 32)
116 {
117 if (font != 63)
118 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
119 return;
120 }
121
122 EVE_Cmd_startFunc(phost);
123 EVE_Cmd_wr32(phost, CMD_TEXT);
124 EVE_Cmd_wr16(phost, x);
125 EVE_Cmd_wr16(phost, y);
126 EVE_Cmd_wr16(phost, font);
127 EVE_Cmd_wr16(phost, options);
128 EVE_Cmd_wrString(phost, s, length);
129 EVE_Cmd_endFunc(phost);
130
131#if (EVE_DL_OPTIMIZE)
132 phost->DlPrimitive = 0;
133#endif
134}
static ft_uint32_t ft_uint8_t ft_uint32_t length
Definition FT_Gpu_Hal.h:140

◆ EVE_CoCmd_toggle()

EVE_HAL_EXPORT void EVE_CoCmd_toggle ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  font,
uint16_t  options,
uint16_t  state,
const char *  s,
  ... 
)

Send CMD_TOGGLE.

Parameters
phostPointer to Hal context
xx-coordinate of top-left of toggle, in pixels
yy-coordinate of top-left of toggle, in pixels
wwidth of toggle, in pixels
fontfont to use for text, 0-31
optionsDrawing option
statestate of the toggle: 0 is off, 65535 is on.
sstring labels for toggle,UTF-8 encoding
...string labels format

Definition at line 229 of file EVE_CoCmd_Widgets.c.

230{
231 va_list args;
232#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
233 uint8_t num;
234#endif
235
236#if EVE_CMD_HOOKS
237 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_TOGGLE, 0))
238 return;
239#endif
240
241 if (font >= 32)
242 {
243 if (font != 63)
244 eve_printf_debug("Invalid font handle specified: %i\n", (int)font);
245 return;
246 }
247
248 va_start(args, s);
249#if (EVE_SUPPORT_CHIPID >= EVE_BT815) /* OPT_FORMAT not defined in FT8xx chip */
250 num = (options & OPT_FORMAT) ? (countArgs(s)) : (0); //Only check % characters if option OPT_FORMAT is set
251#endif
252
253 EVE_Cmd_startFunc(phost);
254 EVE_Cmd_wr32(phost, CMD_TOGGLE);
255 EVE_Cmd_wr16(phost, x);
256 EVE_Cmd_wr16(phost, y);
257 EVE_Cmd_wr16(phost, w);
258 EVE_Cmd_wr16(phost, font);
259 EVE_Cmd_wr16(phost, options);
260 EVE_Cmd_wr16(phost, state);
262#if (EVE_SUPPORT_CHIPID >= EVE_BT815)
263 if (EVE_CHIPID >= EVE_BT815)
264 {
265 for (uint8_t i = 0; i < num; i++)
266 EVE_Cmd_wr32(phost, (uint32_t)va_arg(args, uint32_t));
267 }
268#endif
269 EVE_Cmd_endFunc(phost);
270 va_end(args);
271
272#if (EVE_DL_OPTIMIZE)
273 phost->DlPrimitive = 0;
274#endif
275}
#define CMD_TOGGLE

◆ EVE_CoCmd_track()

static void EVE_CoCmd_track ( EVE_HalContext phost,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
int16_t  tag 
)
inlinestatic

Send CMD_TRACK.

Parameters
phostPointer to Hal context
xx-coordinate of track area top-left, in pixels
yy-coordinate of track area top-left, in pixels
wwidth of track area, in pixels
hheight of track area, in pixels
tagtag for this track, 1-255

Definition at line 1670 of file EVE_CoCmd.h.

1671{
1672 EVE_CoCmd_dwwwww(phost, CMD_TRACK, x, y, w, h, tag);
1673}
#define CMD_TRACK

◆ EVE_CoCmd_translate()

static void EVE_CoCmd_translate ( EVE_HalContext phost,
int32_t  tx,
int32_t  ty 
)
inlinestatic

Send CMD_TRANSLATE.

Parameters
phostPointer to Hal context
txx scale factor, in signed 16.16 bit fixed-point form.
tyy scale factor, in signed 16.16 bit fixed-point form.

Definition at line 1018 of file EVE_CoCmd.h.

1019{
1020 EVE_CoCmd_ddd(phost, CMD_TRANSLATE, tx, ty);
1021
1022#if EVE_DL_OPTIMIZE
1023 phost->CoBitmapTransform = true;
1024#endif
1025}
#define CMD_TRANSLATE

◆ EVE_CoCmd_videoFrame()

static void EVE_CoCmd_videoFrame ( EVE_HalContext phost,
uint32_t  dst,
uint32_t  ptr 
)
inlinestatic

CMD_VIDEOFRAME.

Parameters
phostPointer to Hal context
dstMain memory location to load the frame data
ptrCompletion pointer

Definition at line 612 of file EVE_CoCmd.h.

613{
616 EVE_CoCmd_dddd(phost, CMD_MEMWRITE, 3182934, 1, OPT_NODL); // WORKAROUND CMD_VIDEOFRAME
617 else if (EVE_CHIPID == EVE_BT817 || EVE_CHIPID == EVE_BT818)
618 EVE_CoCmd_dddd(phost, CMD_MEMWRITE, 3182920, 1, OPT_NODL); // WORKAROUND CMD_VIDEOFRAME
619 EVE_CoCmd_ddd(phost, CMD_VIDEOFRAME, dst, ptr);
620}
#define EVE_BT818
Definition EVE_Config.h:69
#define EVE_BT817
Definition EVE_Config.h:68
#define EVE_BT816
Definition EVE_Config.h:67
#define CMD_VIDEOFRAME

◆ EVE_CoCmd_videoStart()

static void EVE_CoCmd_videoStart ( EVE_HalContext phost)
inlinestatic

Send CMD_VIDEOSTART.

Parameters
phostPointer to Hal context

Definition at line 599 of file EVE_CoCmd.h.

600{
603}
#define CMD_VIDEOSTART

◆ EVE_CoCmd_videoStartF()

static void EVE_CoCmd_videoStartF ( EVE_HalContext phost)
inlinestatic

Send CMD_VIDEOSTARTF.

Parameters
phostPointer to Hal context

Definition at line 805 of file EVE_CoCmd.h.

◆ EVE_CoDlImpl_resetCoState()

EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState ( EVE_HalContext phost)

Definition at line 83 of file EVE_CoDl.c.

84{
85#if (EVE_DL_OPTIMIZE)
86 phost->CoFgColor = 0x003870;
87 phost->CoBgColor = 0x002040;
88 phost->CoBitmapTransform = false;
89#endif
90
91#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
92 if (EVE_CHIPID >= EVE_FT810)
93 {
94 phost->CoScratchHandle = 15;
95 }
96#endif
97}

◆ EVE_CoDlImpl_resetDlState()

EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState ( EVE_HalContext phost)

Definition at line 38 of file EVE_CoDl.c.

39{
40#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
41 phost->DlStateIndex = 0;
42#if defined(_MSC_VER) && (_MSC_VER < 1800)
43 /* Designated initializers not supported in older Visual Studio versions */
44 memset(&phost->DlState[0], 0, sizeof(EVE_HalDlState));
45#if (EVE_DL_OPTIMIZE)
46 phost->DlState[0].LineWidth = 16;
47 phost->DlState[0].PointSize = 16;
48 phost->DlState[0].ColorRGB = 0xFFFFFF;
49 phost->DlState[0].ColorA = 0xFF;
50 phost->DlState[0].Handle = 0x3F; /* Invalid value */
51#endif
52 phost->DlState[0].VertexFormat = 4;
53#else
54 phost->DlState[0] = (EVE_HalDlState)
55 {
56#if (EVE_DL_OPTIMIZE)
57 .LineWidth = 16,
58 .PointSize = 16,
59 .ColorRGB = 0xFFFFFF,
60#endif
61#if (EVE_DL_CACHE_SCISSOR)
62 .ScissorWidth = (uint16_t)phost->Width,
63 .ScissorHeight = (uint16_t)phost->Height,
64#endif
65#if (EVE_DL_OPTIMIZE)
66 .ColorA = 0xFF,
67 .Handle = 0x3F, /* Invalid value */
68#endif
69#if (EVE_DL_OPTIMIZE) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
70 .VertexFormat = 4,
71#elif (EVE_DL_CACHE_SCISSOR)
72 0
73#endif
74 };
75#endif
76#endif
77
78#if (EVE_DL_OPTIMIZE)
79 phost->DlPrimitive = 0;
80#endif
81}
uint8_t DlStateIndex
EVE_HalDlState DlState[EVE_DL_STATE_STACK_SIZE]
int16_t LineWidth
uint8_t VertexFormat
uint32_t ColorRGB
int16_t PointSize