本文整理汇总了C#中IHardwareResources类的典型用法代码示例。如果您正苦于以下问题:C# IHardwareResources类的具体用法?C# IHardwareResources怎么用?C# IHardwareResources使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHardwareResources类属于命名空间,在下文中一共展示了IHardwareResources类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "IntelHSUART";
return true;
}
示例2: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "CMOS";
commandPort = base.hardwareResources.GetIOPort(0, 0);
dataPort = base.hardwareResources.GetIOPort(0, 4);
return true;
}
示例3: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "TEST_" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");
TestPort = hardwareResources.GetIOPort(0, 0);
Command = new CommandRegister(TestPort, 8);
Command.Enabled = true;
return true;
}
示例4: ClaimResources
/// <summary>
/// Claims the resources.
/// </summary>
/// <returns></returns>
public bool ClaimResources(IHardwareResources hardwareResources)
{
if (!ioPortResources.ClaimResources(hardwareResources))
return false;
if (!memoryResources.ClaimResources(hardwareResources))
{
ioPortResources.ReleaseResources(hardwareResources);
return false;
}
return true;
}
示例5: ClaimResources
/// <summary>
/// Claims the resources.
/// </summary>
/// <param name="hardwareResources">The hardware resources.</param>
/// <returns></returns>
public bool ClaimResources(IHardwareResources hardwareResources)
{
spinLock.Enter();
for (byte r = 0; r < hardwareResources.MemoryRegionCount; r++)
{
IMemoryRegion region = hardwareResources.GetMemoryRegion(r);
foreach (IMemoryRegion memoryRegion in memoryRegions)
if ((memoryRegion.Contains(region.BaseAddress) || memoryRegion.Contains(region.BaseAddress + region.Size)))
return false;
}
for (byte r = 0; r < hardwareResources.MemoryRegionCount; r++)
memoryRegions.Add(hardwareResources.GetMemoryRegion(r));
spinLock.Exit();
return true;
}
示例6: ClaimResources
/// <summary>
/// Claims the resources.
/// </summary>
/// <param name="hardwareResources">The hardware resources.</param>
/// <returns></returns>
public bool ClaimResources(IHardwareResources hardwareResources)
{
spinLock.Enter();
for (byte r = 0; r < hardwareResources.IOPointRegionCount - 1; r++)
{
IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
for (int p = 0; p < region.Size; p++)
if (portUsed[region.BaseIOPort + p])
return false;
}
for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
{
IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
for (int p = 0; p < region.Size; p++)
portUsed[region.BaseIOPort + p] = true;
}
spinLock.Exit();
return true;
}
示例7: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "DMA_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");
statusRegister = base.hardwareResources.GetIOPort(0, 0x08);
commandRegister = base.hardwareResources.GetIOPort(0, 0x08);
requestRegister = base.hardwareResources.GetIOPort(0, 0x09);
channelMaskRegister = base.hardwareResources.GetIOPort(0, 0x0A);
modeRegister = base.hardwareResources.GetIOPort(0, 0x0B);
byteWordRegister = base.hardwareResources.GetIOPort(0, 0x0C);
intermediateRegister = base.hardwareResources.GetIOPort(0, 0x0D);
maskRegister = base.hardwareResources.GetIOPort(0, 0x0F);
channel0Address = base.hardwareResources.GetIOPort(0, 0x00);
channel0Count = base.hardwareResources.GetIOPort(0, 0x01);
channel0Page = base.hardwareResources.GetIOPort(0, 0x87);
channel1Address = base.hardwareResources.GetIOPort(0, 0x02);
channel1Count = base.hardwareResources.GetIOPort(0, 0x03);
channel1Page = base.hardwareResources.GetIOPort(0, 0x83);
channel2Address = base.hardwareResources.GetIOPort(0, 0x04);
channel2Count = base.hardwareResources.GetIOPort(0, 0x05);
channel2Page = base.hardwareResources.GetIOPort(0, 0x81);
channel3Address = base.hardwareResources.GetIOPort(0, 0x06);
channel3Count = base.hardwareResources.GetIOPort(0, 0x07);
channel3Page = base.hardwareResources.GetIOPort(0, 0x82);
memory0 = base.hardwareResources.GetMemory(0);
memory1 = base.hardwareResources.GetMemory(1);
memory2 = base.hardwareResources.GetMemory(2);
memory3 = base.hardwareResources.GetMemory(3);
return true;
}
示例8: ReleaseResources
/// <summary>
/// Releases the resources.
/// </summary>
/// <param name="hardwareResources">The hardware resources.</param>
public void ReleaseResources(IHardwareResources hardwareResources)
{
spinLock.Enter();
for (byte r = 0; r < hardwareResources.IOPointRegionCount; r++)
{
IIOPortRegion region = hardwareResources.GetIOPortRegion(r);
for (int p = 0; p < region.Size; p++)
portUsed[region.BaseIOPort + p] = false;
}
spinLock.Exit();
}
示例9: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "VMWARE_SVGA_0x" + hardwareResources.GetIOPortRegion(0).BaseIOPort.ToString("X");
indexPort = hardwareResources.GetIOPort(0, 0);
valuePort = hardwareResources.GetIOPort(0, 1);
memory = base.hardwareResources.GetMemory(0);
fifo = base.hardwareResources.GetMemory(1);
return true;
}
示例10: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "PIT_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");
modeControlPort = base.hardwareResources.GetIOPort(0, 3);
counter0Divisor = base.hardwareResources.GetIOPort(0, 0);
return true;
}
示例11: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "VGAText";
miscellaneousOutput = base.hardwareResources.GetIOPort(0, 0x1C);
crtControllerIndex = base.hardwareResources.GetIOPort(0, 0x04);
crtControllerData = base.hardwareResources.GetIOPort(0, 0x05);
crtControllerIndexColor = base.hardwareResources.GetIOPort(0, 0x24);
crtControllerDataColor = base.hardwareResources.GetIOPort(0, 0x25);
miscellaneousOutputWrite = base.hardwareResources.GetIOPort(0, 0x12);
sequencerAddress = base.hardwareResources.GetIOPort(0, 0x14);
sequencerData = base.hardwareResources.GetIOPort(0, 0x15);
graphicsControllerAddress = base.hardwareResources.GetIOPort(0, 0x1E);
graphicsControllerData = base.hardwareResources.GetIOPort(0, 0x1F);
inputStatus1ReadB = base.hardwareResources.GetIOPort(0, 0x2A);
attributeAddress = base.hardwareResources.GetIOPort(0, 0x10);
attributeData = base.hardwareResources.GetIOPort(0, 0x11);
memory = base.hardwareResources.GetMemory(0);
return true;
}
示例12: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "FDC_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");
base.parent = null; // no parent
commandPort = base.hardwareResources.GetIOPort(0, 2);
statusPort = base.hardwareResources.GetIOPort(0, 4);
dataPort = base.hardwareResources.GetIOPort(0, 5);
configPort = base.hardwareResources.GetIOPort(0, 7);
// floppyDMA = base.CreateDMAChannel(2);
// floppyIRQ = base.CreateIRQHandler(6);
return true;
}
示例13: ReleaseResources
/// <summary>
/// Releases the resources.
/// </summary>
/// <param name="hardwareResources">The hardware resources.</param>
/// <returns></returns>
public void ReleaseResources(IHardwareResources hardwareResources)
{
ioPortResources.ReleaseResources(hardwareResources);
memoryResources.ReleaseResources(hardwareResources);
}
示例14: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <param name="hardwareResources"></param>
/// <returns></returns>
public override bool Setup(IHardwareResources hardwareResources)
{
this.hardwareResources = hardwareResources;
base.name = "PIC_0x" + base.hardwareResources.GetIOPort(0, 0).Address.ToString("X");
masterCommandPort = base.hardwareResources.GetIOPort(0, 0);
masterDataPort = base.hardwareResources.GetIOPort(0, 1);
slaveCommandPort = base.hardwareResources.GetIOPort(1, 0);
slaveDataPort = base.hardwareResources.GetIOPort(1, 1);
return true;
}
示例15: Setup
/// <summary>
/// Setups this hardware device driver
/// </summary>
/// <returns></returns>
public abstract bool Setup(IHardwareResources hardwareResources);