Forum Discussion
Altera_Forum
Honored Contributor
21 years agoUsing HAL with DMA question
I am moving from NIOSI to NIOSII. I have an interrupt where if we are still DMA'ing, I just want to return from the interrupt. Before, I just had the following if statement to check the status of the DMA operation:
if((na_USB_DMA->np_dmastatus & np_dmastatus_busy_mask) != 0) How do I do this using HAL? thanx2 Replies
- Altera_Forum
Honored Contributor
http://www.altera.com/literature/hb/nios2/...pu_nii51006.pdf (http://www.altera.com/literature/hb/nios2/n2cpu_nii51006.pdf)
On page 8 there is the description of the status register. I haven't checked but there should either be a function call to get the status or some value to read back to use. If not then you can just do the old school method and read it back and mask the other bits you don't care about. http://www.altera.com/literature/hb/nios2/...sw_nii52004.pdf (http://www.altera.com/literature/hb/nios2/n2sw_nii52004.pdf) Page 4-18 might be helpful as well. Happy reading (I know I'm lazy) Cheers - Altera_Forum
Honored Contributor
First you should define a callback function such as dma_done. Assign a mark describing the end of dma transmission. Inputting dma_done as the forth parameter on invoking alt_dma_txchan_send/alt_dma_rxchan_prepare.
I think handbook should describe such usage more clearly.