[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] DMA: user-space (system calls) and RTAI




> Can anyone tell me about DMA under RTAI. Are then any routines
> available for setting up DMA transfers under RTAI. Can you setup
> DMA using an API (called from user-space) for the hardware (example: OSS for 

I don't think DMA handling would be RTAI-specific.
Standard Linux macros/functions are used to program the DMA controllers.
Sample code from my (NMT driven) task:

#include <asm/dma.h>


	unsigned flags;

	flags=claim_dma_lock();
	disable_dma(LG_DMA_CHANNEL);
	clear_dma_ff(LG_DMA_CHANNEL);
...
		set_dma_mode(LG_DMA_CHANNEL, DMA_MODE_WRITE|DMA_AUTOINIT);
		set_dma_count(LG_DMA_CHANNEL, count = accelveclen + LEAD_INOUT);
		set_dma_addr(LG_DMA_CHANNEL, virt_to_bus(a.accelvec));
		enable_dma(LG_DMA_CHANNEL);
...
	release_dma_lock(flags);


Regards

Gabor