Version 1.3
Page 26 of 36
SMT332/372 User Manual
for(loop=0;loop!=256;loop++) {
for(blocks=0;blocks!=16;+) {
// Set the 331 page register to point to the address register
// on the SMT320. This is at address 0xC0400000.
global=(unsigned *)0x01780000;
*global=0xc040;
// Then we set the SMT320 address register to the start of the
// host’s display memory. Note that this will be different
// from PC to PC. In this case it is at address 0xFE000000.
global=(unsigned *)0x01700000;
*global = 0xfe blocks*0x8000;
// Back to the page register, and point to the SMT320 FIFO.
// This is where reads and writes will be over the PCI bus.
global=(unsigned *)0x01780000;
*global=0xc000;
// Now we are ready to do the DMA.
global=(unsigned *)0x01700000;
// DMA source is SBSRAM, destination is global bus,
// transfer count is 8k (32k bytes)
*dma_src=0x0loop;
*dma_dst=0x01700000;
*dma_tc =0x00002000;
// and start
*dma_cfg=0x01000051;
// Now we wait for DMA to finish.
while (((*dma_cfg)&0xc) != 0) {};
}
}