11.07.2015 Views

Nios II Processor Reference Handbook

Nios II Processor Reference Handbook

Nios II Processor Reference Handbook

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Software Programming ModelcIf your program uses the HAL device driver to access the DMAcontroller, accessing the device registers directly will interferewith the correct behavior of the driver.The HAL DMA driver provides both ends of the DMA process; the driverregisters itself as both a receive channel (alt_dma_rxchan) and a transmitchannel (alt_dma_txchan). The <strong>Nios</strong> <strong>II</strong> Software Developer’s <strong>Handbook</strong>provides complete details of the HAL system library and the usage ofDMA devices.ioctl() Operationsioctl() operation requests are defined for both the receive and transmitchannels, which allows you to control the hardware-dependent aspects ofthe DMA controller. Two ioctl() functions are defined for the receiverdriver and the transmitter driver: alt_dma_rxchan_ioctl() andalt_dma_txchan_ioctl(). Table 6–2 lists the available operations.These are valid for both the transmit and receive channels.Table 6–2. Operations for alt_dma_rxchan_ioctl() & alt_dma_txchan_ioctl()RequestALT_DMA_SET_MODE_8ALT_DMA_SET_MODE_16ALT_DMA_SET_MODE_32ALT_DMA_SET_MODE_64ALT_DMA_SET_MODE_128ALT_DMA_RX_ONLY_ON (1)ALT_DMA_RX_ONLY_OFF (1)ALT_DMA_TX_ONLY_ON (1)ALT_DMA_TX_ONLY_OFF (1)MeaningTransfers data in units of 8 bits. The value of “arg” is ignored.Transfers data in units of 16 bits. The value of “arg” is ignored.Transfers data in units of 32 bits. The value of “arg” is ignored.Transfers data in units of 64 bits. The value of “arg” is ignored.Transfers data in units of 128 bits. The value of “arg” is ignored.Sets a DMA receiver into streaming mode. In this case, data is readcontinuously from a single location. The “arg” parameter specifies theaddress to read from.Turns off streaming mode for a receive channel. The value of “arg” isignored.Sets a DMA transmitter into streaming mode. In this case, data is writtencontinuously to a single location. The “arg” parameter specifies the addressto write to.Turns off streaming mode for a transmit channel. The value of “arg” isignored.Note to Table 6–2:(1) These macro names changed in version 1.1 of the <strong>Nios</strong> <strong>II</strong> development kit. The old names(ALT_DMA_TX_STREAM_ON, ALT_DMA_TX_STREAM_OFF, ALT_DMA_RX_STREAM_ON, andALT_DMA_RX_STREAM_OFF) are still valid, but new designs should use the new names.6–6 Altera Corporation<strong>Nios</strong> <strong>II</strong> <strong>Processor</strong> <strong>Reference</strong> <strong>Handbook</strong> December 2004

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!