Hi Rudolph,
You can use this call and pass in 00s so that it writes six dummy values, or you can remove the parameters and just write six sets of 00s within the function automatically instead, as shown in this code below - see resAddr = EVE_Cmd_moveWp(phost, 6 * 4) . But in any case, dummy values should be written as part of the function so that the co-processor can replace these with the results.
You can also include the code to do the actual reading of the results as also shown here:
EVE_HAL_EXPORT bool EVE_CoCmd_getMatrix(EVE_HalContext *phost, int32_t *m)
{
uint16_t resAddr;
int i;
if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_GETMATRIX, 0))
return false;
EVE_Cmd_startFunc(phost);
EVE_Cmd_wr32(phost, CMD_GETMATRIX);
resAddr = EVE_Cmd_moveWp(phost, 6 * 4);
EVE_Cmd_endFunc(phost);
/* Read result */
if (m)
{
if (!EVE_Cmd_waitFlush(phost))
return false;
EVE_Hal_startTransfer(phost, EVE_TRANSFER_READ, RAM_CMD + resAddr);
for (i = 0; i < 6; ++i)
m[i] = EVE_Hal_transfer32(phost, 0);
EVE_Hal_endTransfer(phost);
}
return true;
}
There are lots of ways to do it (so long as you end up writing the correct data) and so users creating their libraries can choose the best way for them.
You did make a good point though that the way shown in BRT_AN_025 is not the most intuitive or efficient and so we will make some updates to improve it and so appreciate your feedback,
Best Regards, BRT Community