luxos/Kernel/drivers/dma/dma.h

81 lines
2.0 KiB
C
Raw Normal View History

/*
* dma.h
*
* Created on: Aug 20, 2011
* Author: Tiberiu
*/
#ifndef DMA_H_
#define DMA_H_
#include <types.h>
enum DmaRegisters
{
DmaRegisterStatus = 0x08,
DmaRegisterCommand = 0x08,
DmaRegisterRequest = 0x09,
DmaRegisterSingleChannelMask = 0x0A,
DmaRegisterMode = 0x0B,
DmaRegisterFlipFlopReset = 0x0C,
DmaRegisterIntermediate = 0x0D,
DmaRegisterMasterReset = 0x0D,
DmaRegisterMaskReset = 0x0E,
DmaRegisterMultichannelMask = 0x0F,
DmaRegisterChannel0Address = 0x00,
DmaRegisterChannel1Address = 0x02,
DmaRegisterChannel2Address = 0x04,
DmaRegisterChannel3Address = 0x06,
DmaRegisterChannel4Address = 0xC0,
DmaRegisterChannel5Address = 0xC4,
DmaRegisterChannel6Address = 0xC8,
DmaRegisterChannel7Address = 0xCC,
DmaRegisterChannel0Count = 0x01,
DmaRegisterChannel1Count = 0x03,
DmaRegisterChannel2Count = 0x05,
DmaRegisterChannel3Count = 0x07,
DmaRegisterChannel4Count = 0xC2,
DmaRegisterChannel5Count = 0xC6,
DmaRegisterChannel6Count = 0xCA,
DmaRegisterChannel7Count = 0xCE,
DmaRegisterChannel1PageAddress = 0x83,
DmaRegisterChannel2PageAddress = 0x81,
DmaRegisterChannel3PageAddress = 0x82,
DmaRegisterChannel5PageAddress = 0x8B,
DmaRegisterChannel6PageAddress = 0x89,
DmaRegisterChannel7PageAddress = 0x8A
};
enum DmaModes
{
DmaModeChannelMask = 0x3,
DmaModeSelfTest = 0,
DmaModeWrite = 0x8,
DmaModeRead = 0x4,
DmaModeAutoReinit = 0x10,
DmaModeDown = 0x20,
DmaModeTransferOnDemand = 0,
DmaModeTransferSingleDma = 0x40,
DmaModeTransferBlockDma = 0x80,
DmaModeTransferCascade = 0xC0
};
extern void DmaSetAddress (uint8 channel, uint8 low, uint8 high);
extern void DmaSetCount (uint8 channel, uint8 low, uint8 high);
extern void DmaSetExternalPageRegisters (uint8 channel, uint8 val);
extern void DmaSetMode (uint8 channel, uint8 mode);
extern void DmaResetFlipFlop (uint8 channel);
extern void DmaReset ();
extern void DmaMaskChannel(uint8 channel);
extern void DmaUnmaskChannel (uint8 channel);
extern void DmaUnmaskAll ();
#endif /* DMA_H_ */