diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-9C05C157-D58E-4C43-87E4-82B4F310AEA9.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-9C05C157-D58E-4C43-87E4-82B4F310AEA9.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,50 @@ + + + + + +DmaChannelMgr ImplementationDescribes how to write the hardware-specific functions +of the DmaChannelMgr class. +

The DmaChannelMgr class is already defined in +the DMA header file but it belongs to the PSL implementation: opening +and closing channels require hardware-specific operations.

+

When implementing the PSL, you need to provide at least one function:TDmaChannel* DmaChannelMgr::Open(TUint32 aOpenId)

+

This function opens a DMA channel and returns the object controlling +this channel.

+

How the channel is allocated is hardware-dependent. The call to +the Open() function specifies which channel to open +through the aOpenId parameter. The format of the +parameter is not part of the DMA platform service and depends on an +agreement between the PSL implementation and the driver using DMA. +The example section below shows a static method, but the allocation +could also be completely or partially dynamic.

+

If you want to perform a hardware-specific operation when closing +the channel, you also need to update DmaChannelMgr::Close(). It is usually not necessary: in the template source code, it is +implemented as doing nothing.

+

+Open() example

This example illustrates +a simple allocation scheme where aOpenId represents +the index of the requested channel in the channel array (Controller.iChannels). +TDmaChannel* DmaChannelMgr::Open(TUint32 aOpenId) + { + __DMA_ASSERTA(aOpenId < static_cast<TUint32>(KChannelCount)); + TDmaChannel* pC = Controller.iChannels + aOpenId; + if (pC->IsOpened()) + pC = NULL; + else + { + pC->iController = &Controller; + pC->iPslId = aOpenId; + } + return pC; +}

+
+DMA +Client Interface Guide +
\ No newline at end of file