CHAPTER 6 Double Buffer Mode Principle. ADLINK Technology PCI-7200

Add to My manuals
91 Pages

advertisement

CHAPTER 6 Double Buffer Mode Principle. ADLINK Technology PCI-7200 | Manualzz

6

Double Buffer Mode Principle

The data buffer for double-buffered DMA DI operation is a circular buffer logically. It logically divided into two equal halves.

The double-buffered DI begins when device starts writing data into the first half of the circular buffer (Figure 6-1a). After device begins writing to the second half of the circular buffer, you can copy the data from the first half into the transfer buffer (Figure 6-

1b). You now can process the data in the transfer buffer according to application needs. After the board has filled the second half of the circular buffer, the board returns to the first half buffer and overwrites the old data. You now can copy the second half of the circular buffer to the transfer buffer (Figure 6-

1c). The data in the transfer buffer is again available for process.

The process can be repeated endlessly to provide a continuous stream of data to your application (Figure 6-1d).

Double Buffer Mode Principle

••

71

a

Incoming DMA input data

Circular Buffer c

> >

Transfer Buffer

> > b d

> > >

> > >

Empty Buffer Untransferred Data Transferred Data

Figure 6-1

The PCI-7200 double buffer mode functions were designed according to the principle described above. If you use

_7200_DblBufferMode() to enable double buffer mode, the following _7200_DI_DMA_Start() will perform double-buffered

DMA DI. You can call _7200_CheckHalfReady() to check if data in the circular buffer is half full and ready for copying to the transfer buffer. Then you can call _7200_DblBufferTransfer() to copy data from the ready half buffer to the transfer buffer.

In Win-95 version, W_7200_Alloc_DBDMA_Mem() is needed to allocates a contiguous DMA memory for the circular buffer. The buf_size argument of W_7200_Alloc_DBDMA_Mem() is the half size of circular buffer in byte, that is, the size of each half buffer in byte. The DMA memory is referenced by the return parameter handle. This memory is system memory, users are not allowed to access it directly.

72

••

Double Buffer Mode Principle

advertisement

Related manuals

advertisement

Table of contents