EVE's command read/write. More...
#include "EVE_HalDefs.h"
Go to the source code of this file.
Macros | |
#define | EVE_CMD_STRING_MAX 511 |
Functions | |
EVE_HAL_EXPORT uint16_t | EVE_Cmd_rp (EVE_HalContext *phost) |
Read from Coprocessor. | |
EVE_HAL_EXPORT uint16_t | EVE_Cmd_wp (EVE_HalContext *phost) |
Write to Coprocessor. | |
EVE_HAL_EXPORT uint16_t | EVE_Cmd_space (EVE_HalContext *phost) |
Get free space of Coprocessor's command buffer. | |
EVE_HAL_EXPORT void | EVE_Cmd_startFunc (EVE_HalContext *phost) |
Begin writing a function, keeps the transfer open. | |
EVE_HAL_EXPORT void | EVE_Cmd_endFunc (EVE_HalContext *phost) |
End writing a function, closes the transfer. | |
EVE_HAL_EXPORT bool | EVE_Cmd_wrMem (EVE_HalContext *phost, const uint8_t *buffer, uint32_t size) |
Write buffer to Coprocessor's comand fifo. | |
EVE_HAL_EXPORT 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. | |
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. | |
EVE_HAL_EXPORT bool | EVE_Cmd_wr8 (EVE_HalContext *phost, uint8_t value) |
Write a byte to Coprocessor's command fifo. | |
EVE_HAL_EXPORT bool | EVE_Cmd_wr16 (EVE_HalContext *phost, uint16_t value) |
Write 2 bytes to Coprocessor's command fifo. | |
EVE_HAL_EXPORT bool | EVE_Cmd_wr32 (EVE_HalContext *phost, uint32_t value) |
Write 4 bytes to Coprocessor's command fifo. | |
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. | |
EVE_HAL_EXPORT bool | EVE_Cmd_waitFlush (EVE_HalContext *phost) |
Wait till Command FIFO buffer empty. | |
EVE_HAL_EXPORT uint32_t | EVE_Cmd_waitSpace (EVE_HalContext *phost, uint32_t size) |
EVE_HAL_EXPORT bool | EVE_Cmd_waitLogo (EVE_HalContext *phost) |
Wait until Coprocessor finished logo animation. | |
EVE_HAL_EXPORT bool | EVE_Cmd_waitRead32 (EVE_HalContext *phost, uint32_t ptr, uint32_t value) |
EVE_HAL_EXPORT void | EVE_Cmd_restore (EVE_HalContext *phost) |
EVE's command read/write.
This file defines the generic APIs of phost access layer for the FT800 or EVE compatible silicon. Application shall access FT800 or EVE resources over these APIs,regardless of I2C or SPI protocol. In addition, there are some helper functions defined for FT800 coprocessor engine as well as phost commands.
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_Cmd.h.
EVE_HAL_EXPORT void EVE_Cmd_endFunc | ( | EVE_HalContext * | phost | ) |
End writing a function, closes the transfer.
phost | Pointer to Hal context |
Definition at line 274 of file EVE_Cmd.c.
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.
phost | Pointer to Hal context |
bytes | Number of bytes to move |
Definition at line 446 of file EVE_Cmd.c.
EVE_HAL_EXPORT void EVE_Cmd_restore | ( | EVE_HalContext * | phost | ) |
Restore the internal state of EVE_Cmd. Call this after manually writing to the coprocessor buffer
Definition at line 682 of file EVE_Cmd.c.
EVE_HAL_EXPORT uint16_t EVE_Cmd_rp | ( | EVE_HalContext * | phost | ) |
Read from Coprocessor.
Get the current read pointer. Safe to use during ongoing command transaction
phost | Pointer to Hal context |
Definition at line 64 of file EVE_Cmd.c.
EVE_HAL_EXPORT uint16_t EVE_Cmd_space | ( | EVE_HalContext * | phost | ) |
Get free space of Coprocessor's command buffer.
Get the currently available space. Updates cached available space. Safe to use during ongoing command transaction
phost | Pointer to Hal context |
Definition at line 105 of file EVE_Cmd.c.
EVE_HAL_EXPORT void EVE_Cmd_startFunc | ( | EVE_HalContext * | phost | ) |
EVE_HAL_EXPORT bool EVE_Cmd_waitFlush | ( | EVE_HalContext * | phost | ) |
Wait till Command FIFO buffer empty.
Wait for the command buffer to fully empty. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
Definition at line 775 of file Gpu_Hal.cpp.
EVE_HAL_EXPORT bool EVE_Cmd_waitLogo | ( | EVE_HalContext * | phost | ) |
Wait until Coprocessor finished logo animation.
Wait for logo to finish displaying. (Waits for both the read and write pointer to go to 0)
phost | Pointer to Hal context |
Definition at line 625 of file EVE_Cmd.c.
EVE_HAL_EXPORT bool EVE_Cmd_waitRead32 | ( | EVE_HalContext * | phost, |
uint32_t | ptr, | ||
uint32_t | value | ||
) |
Wait for a 32-bit value that was set by EVE_CoCmd_memWrite32(phost, ptr, value)
.
Definition at line 651 of file EVE_Cmd.c.
EVE_HAL_EXPORT uint32_t EVE_Cmd_waitSpace | ( | EVE_HalContext * | phost, |
uint32_t | size | ||
) |
Wait for the command buffer to have at least the requested amount of free space.
Definition at line 580 of file EVE_Cmd.c.
EVE_HAL_EXPORT uint16_t EVE_Cmd_wp | ( | EVE_HalContext * | phost | ) |
Write to Coprocessor.
Get the current write pointer. Updates cached write pointer when CMDB is not supported. Safe to use during ongoing command transaction
phost | Pointer to Hal context |
Definition at line 80 of file EVE_Cmd.c.
EVE_HAL_EXPORT bool EVE_Cmd_wr16 | ( | EVE_HalContext * | phost, |
uint16_t | value | ||
) |
Write 2 bytes to Coprocessor's command fifo.
Write a 16-bit value to the command buffer. Uses a cache to write 4 bytes at once. Wire endianness is handled by the transfer. Waits if there is not enough space in the command buffer. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
value | Data to write |
Definition at line 366 of file EVE_Cmd.c.
EVE_HAL_EXPORT bool EVE_Cmd_wr32 | ( | EVE_HalContext * | phost, |
uint32_t | value | ||
) |
Write 4 bytes to Coprocessor's command fifo.
Write a value to the command buffer. Wire endianness is handled by the transfer. Waits if there is not enough space in the command buffer. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
value | Data to write |
Definition at line 394 of file EVE_Cmd.c.
EVE_HAL_EXPORT bool EVE_Cmd_wr8 | ( | EVE_HalContext * | phost, |
uint8_t | value | ||
) |
Write a byte to Coprocessor's command fifo.
Write a 8-bit value to the command buffer. Uses a cache to write 4 bytes at once. Waits if there is not enough space in the command buffer. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
value | Byte to write |
EVE_HAL_EXPORT bool EVE_Cmd_wrMem | ( | EVE_HalContext * | phost, |
const uint8_t * | buffer, | ||
uint32_t | size | ||
) |
Write buffer to Coprocessor's comand fifo.
Write a buffer to the command buffer. Waits if there is not enough space in the command buffer. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
buffer | Data pointer |
size | Size to write |
Definition at line 291 of file EVE_Cmd.c.
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.
Write a progmem buffer to the command buffer. Waits if there is not enough space in the command buffer. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
buffer | Data buffer |
size | Size to write |
Definition at line 307 of file EVE_Cmd.c.
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.
Write a string to the command buffer, padded to 4 bytes. Waits if there is not enough space in the command buffer. Parameter maxLength
can be set up to EVE_CMD_STRING_MAX
. Returns false in case a coprocessor fault occurred
phost | Pointer to Hal context |
str | String to write |
maxLength | Length to write, up to EVE_CMD_STRING_MAX |