The EVE Hardware Abstraction Layer included with EVE Screen Designer consists of the following modules:
Starts a read or write transfer, using the EVE_TRANSFER_READ
orEVE_TRANSFER_WRITE
option respectively. From hardware point of view, this keeps the SPI cable select flagged until EVE_Hal_endTransfer
is called. Write transfers may be buffered in software, depending on the implementation.
Transfers an integer value using the currently open transfer, using the appropriate byte ordering.
Transfers a chunk of memory using the currently open transfer.
Transfers a chunk of data from program memory using the currently open transfer. It is recommended to keep static data in program memory, as microcontroller memory may be limited.
Transfers a string using the currently open transfer. The string will be limited to whichever is shorter of the specified maximum length, or the actual string length, but will always be null-terminated, which may add another byte to the specified maximum length. Additionally the string may be padded to the specified padding mask, which may also add additional bytes to the written length. The maximum amount of transferred data shall be no more than padMask + 1
.
Ends the transfer started by EVE_Hal_startTransfer
. From a hardware point of view, this turns off the SPI cable select.
Write transfers may be buffered in software, depending on the implementation. In case a write transfer is buffered, it may be transferred during the this function call, or anytime as is most efficient for the underlying implementation.
Get the current read pointer. Safe to use during ongoing command transaction.
Get the current write pointer. Updates the cached write pointer when CMDB is not supported. Safe to use during ongoing command transaction.
Get the currently available space. Updates cached available space. Safe to use during ongoing command transaction.
Begin writing a function, keeps the transfer open. The transfer may be closed using EVE_Cmd_endFunc
.
Functions must be ended, even if a coprocessor fault occurs while writing them. The coprocessor may be reset only after ending the function.
It is safe to call any of the command writing functions while the coprocessor is in fault mode. The coprocessor fault may be checked at the end of transfer.
While a command transaction is ongoing, HAL functions outside of EVE_Cmd_*
must not be used.
End writing a function, closes the transfer.
Write a memory buffer to the command buffer. Waits if there is not enough space in the command buffer. Returns false in case a co processor fault occurred.
Write a program memory buffer to the command buffer. Waits if there is not enough space in the command buffer. Returns false in case a co processor fault occurred.
Write a string to the command buffer, null-terminated, padded to 4 bytes. Waits if there is not enough space in the command buffer. Returns false
in case a coprocessor fault occured.
The value for maxLength
may be no more than EVE_CMD_STRING_MAX
, which should also be used as it's default value in case the string length is not known.
Write a value to the command buffer. Uses a cache to write 4 bytes at once to the command buffer for multiple 8-bit and 16-bit writes. 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.
Move the write pointer forward by the specified number of bytes. Returns the previous write pointer. This is used to reserve space in the command buffer for reading output from a command. Returns an uneven value in case a coprocessor fault occurred. The return value may be more conveniently validated using EVE_CMD_FAULT
to check whether a coprocessor fault occurred.
Wait for the command buffer to fully empty. Returns false
in case a coprocessor fault occured.
Wait for the command buffer to have at least the requested amount of free space. Returns false
in case a coprocessor fault occurred.
Wait for logo to finish displaying. Waits for both the read and write pointer to go to 0. Returns false
in case a coprocessor fault occurred.