diff -r 578be2adaf3e -r 307f4279f433 Adaptation/GUID-877EEB52-40C8-4880-87A0-9736A625F85F.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adaptation/GUID-877EEB52-40C8-4880-87A0-9736A625F85F.dita Fri Oct 15 14:32:18 2010 +0100 @@ -0,0 +1,76 @@ + + + + + +TDmaChannel Derived Class ImplementationDescribes how to write a class describing a DMA channel. +

The TDmaChannel class is part of the PSL implementation. +It is an abstract class with pure virtual functions which you must +derive in order to implement it. The implementation of a DMA channel +involves hardware-specific decisions such as the choice of DMA mode

+

The purpose of DMA is to transfer data such as streaming audio +produced by a client application. A typical transfer involves passing +the data from user side to kernel side via a shared chunk and then +a transfer from one memory location to another by DMA over a buffer. +If the amount of data to be transferred exceeds the maximum transfer +size supported by the controller or involves non-contiguous physical +memory, the data is fragmented and transmitted in a sequence of transfers +in one of three modes.

+ +

The PIL supplies three derived classes corresponding to the DMA +modes:

+ +

These three classes are defined in dma_v1.h.

+

You may simply use one of these classes or derive further classes +from them and implement those. For example, the template scatter-gather +implementation defines a TTemplateSgChannel class +derived from TDmaSgChannel for storing data when +appending new descriptors to a running channel:

+class TTemplateSgChannel : public TDmaSgChannel + { +public: + TDmaDesc* iTmpDes; + TPhysAddr iTmpDesPhysAddr; + }; + +

In general, design decisions are made at the level of implementation +in hardware and are subsequently reflected in the structure of the +derived classes.

+

There are two ways of extending the DMA Framework:

+ +

In the first case, TDmaChannel::Extension() calls TDmac::Extension() and the PSL provides an implementation +of the virtual function TDmac::Extension(). The +default implementation just returns KErrNotSupported. In the second case, TDmaChannel::StaticExtension() calls DmaChannelMgr::StaticExtension() and the +PSL provides an implementation of the static function DmaChannelMgr::StaticExtension(). The template PSL implementation just returns KErrNotSupported.

+
+DMA +Channels +
\ No newline at end of file