[Psoc6]CallBack Function Location on the DMA

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
psoc_student
Level 3
Level 3
50 sign-ins 25 sign-ins 10 replies posted

Hello I'm using psoc6 WIFI-BT Pioneer Kit

I'm implementing "UART_DMA", but I don't know where to place the callback.

What I want is, for example, when all five pieces of data are received, a callback is called and the result value is returned.

Should I use "Cy_SCB_UART_RegisterCallback()" as the existing UART method?

When implementing "UART_DMA", I would appreciate it if you could register "Callback" or let me know the location.

Thankyou for your reply.

 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hi @psoc_student ,

I have attached here a firmware developed for the 062-Wifi-Bt kit where the Rx of UART is interfaced with DMA such that after receiving 7 characters as user input , the DMA Callback is triggered and the received data is displayed.

Few points to note:

1. The Number of elements that is to be received to trigger the DMA interrupt is fixed and set in the device configurator as shown

asdfdsf.png

2. Callbacks do not usually return any data.

3. The callback for DMA is done as shown below:

AlenAn14_0-1650889538545.png


Hope this helps

Warm Regards
Alen

View solution in original post

0 Likes
6 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @psoc_student ,

>> What I want is, for example, when all five pieces of data are received, a callback is called and the result value is returned

Can you please describe what you meant by 'all five pieces of data are received' and also the 'result value' ? Do you mean to say 5 bytes of data received over UART , then a callback should be triggered?

Warm Regards
Alen

0 Likes

Hello @AlenAn14 

"all five pieces of data are received" means the data received by mcu when data is sent from a terminal tool, for example, "teratterm".

For example, if the tool sends five pieces of data, the MCU will store all five pieces of data.

At this time, when all five have been received, we want a structure to call "Callback".

And the meaning of 'result value' is the return value of 'callback'.

Additionally, all transmissions are via UART.

 

0 Likes

'teratterm' is a typo in 'tera_term'.

0 Likes
lock attach
Attachments are accessible only for community members.

Hi @psoc_student ,

I have attached here a firmware developed for the 062-Wifi-Bt kit where the Rx of UART is interfaced with DMA such that after receiving 7 characters as user input , the DMA Callback is triggered and the received data is displayed.

Few points to note:

1. The Number of elements that is to be received to trigger the DMA interrupt is fixed and set in the device configurator as shown

asdfdsf.png

2. Callbacks do not usually return any data.

3. The callback for DMA is done as shown below:

AlenAn14_0-1650889538545.png


Hope this helps

Warm Regards
Alen

0 Likes

Thank you for your reply.

0 Likes

Hi @psoc_student ,

Glad your query is resolved!
Please feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help/

Warm Regards
Alen

0 Likes