I'm trying to become more acquainted with DMA resources and API calls.
I'm looking to change a DMA channel TD after it was previously initialized.
I found the CyDmaTdGetConfiguration() and CyDmaTdGetAddress() functions in the API section of the datasheet.
I've tried some code with these functions but I basically get useless information.
Are there any examples of using these functions for changing the TD parameters?
I may have to dig deep to find the code examples which use these exact APIs. But could you let me know what exactly is the return value you expect and what the function returns?
I get what I am expecting. I was wondering if the return values reflect the current state of the TD mostly with regards to the transfercount.
I was hoping that if a DMA were set up as DRQ that the transfercount returned in the function would reflect how many of the bytes were transferred at that time.
On a related note:
Is there a good example project using the TDR input on the DMA component to terminate a burst transfer early?
I wrote a project that uses the TDR input to the DMA component.
It is a replacement of the strlen() function that uses the DMA to search the memory pointer. The goal of this project is to feed three strings (that terminate in '\0') and find the '\0'. The DMA transfers the string into the test Control Register. The contents of the Control Register are tested against '\0'. If '=' then the DMA is suppose to stop because the output of the comparison is feed into the TRQ input.
The picture below shows a signal on D2 which is the output of the Digital comparator which compares the memory being tested against '\0'. When it finds it, a 0 to 1 occurs. This rising edge should terminate the DMA. However, you can see in the picture that the memory DMA testing continues until 4095 bytes are transferred even when other occurrences of '\0' are present. (Note: The D3 signal is the bit 0 of the byte of memory being tested.)
I've attached my program if anyone wants to tackle it to find a solution.