beautypg.com

Sundance SMT335E User Manual

Page 32

background image

Version 1.5

Page 32 of 53

SMT335E SMT375E User Manual

Example of writing a number (

size

) frames, each of 1024 bytes

int *ptr_gbctrl

= (int *) 0x03800000;

int *ptr_gbstart_addr = (int *) 0x03880000;

int *ptr_gblenth

= (int *) 0x03900000; // Bit 9 sets read or write

int *ptr_gbdpram

= (int *) 0x03A00000;

int *interrupt_reg = (int *) SMT335EINTCTRL4; // use ext_int4

*interrupt_reg = 0x00008000;

// Map GB signal to INT4

// Set SMT320 Burst mode ON

*ptr_gbstart_addr = 0xC0800000;

*ptr_gblenth = 0+0x100;

// Write command of 1 word

*ptr_gbdpram = 0x00000001;

while(((*ptr_gbctrl)&0x1)==0)

{}

// Set the SMT320 PCI address destination

*ptr_gbstart_addr = 0xC0400000;

*ptr_gblenth = 0+0x100;

// Write command

*ptr_gbdpram = addr;

// PCI destination address

// Send the data over the PCI

*ptr_gbstart_addr = 0xC0000000;

*DMA_PRI_CRTL0 = 0x070100F0; // Set interrupt sources INT4

*DMA_SEC_CRTL0 = 0x00009000; // Set the first interrupt

*ptr_gblenth = 256-1+0x100;

// multiple of 16 in burst mode

*DMA_SRC_ADDR0 = (int)ptr_buffer; // Set the source address

*DMA_DST_ADDR0 = (int)ptr_gbdpram; // Set the destination address

*DMA_XFR_CNTR0 = (size<<16)+0x100; // Set the transfer sizes

//

FRAME_CNT=

size,

E_CNT=0x0100

*DMA_GL_CNT_RLD = 0x0100;

// Set the count reload

DMA_GL_INDEX = ((-255*4)<<16)+4; // index: Frame = –255*4 bytes

//

index:

Element

=

4

bytes

*DMA_PRI_CRTL0 = 0x070100D1;

// Start DMA0 using INT4

//

Use

index

only

for

destination

while((*DMA_PRI_CRTL0&0xc)!=0) {}

// Wait for DMA1 to finish

while(((*ptr_gbctrl)&0x1)==0) {}

// Complete final write

*interrupt_reg = 0;

// Clear INTCTRL4

This manual is related to the following products: