The values in the QDMA_REGS structure, R, are assigned to the corresponding QDMA parameter registers.
The R->Opt value is assigned last using a pseudo register to start the transfer. The value you have given to R->Opt will be modified automatically before assignment as follows:
1.
|
The TCC (Transfer complete code) field will be set to the value of the termination event specified when the channel was claimed.
|
2.
|
The TCCM field will be set to 0.
|
3.
|
The TCINT (Transfer complete interrupt) bit will be set to allow CIPR to be used to indicate completion of the transfer.
|
This modification of Opt is not done if you write to the register explicitly. Should you decide to do so, it is your responsibility to ensure that the value written has the correct values in the TCC, TCCM, and TCINT fields.
Depending on the way the QDMA channel had been claimed, this call will either wait for the transfer to complete (QDMA_INTERRUPT or QDMA_POLL) or return immediately (QDMA_NOWAIT).
The function can return two values:
|
QDMA_OK
|
The call was successful.
|
|
QDMA_UNCLAIMED
|
The QDMA channel had not been claimed.
|
If you use QDMA_NOWAIT you can explicitly test for completion using QDMA_Complete, which returns a non-zero value if the previous QDMA transfer has completed. It returns 0 otherwise.
For example,
while (QDMA_Complete(QdmaI)==0) {}
This is not recommended. Such polling should only ever be used for short transfers that are expected to finish very quickly.
|