some stubs

This commit is contained in:
Dokugogagoji_cp 2008-07-02 16:42:15 +00:00
parent d10aac6969
commit d3ac47c85b
6 changed files with 156 additions and 12 deletions

View file

@ -84,6 +84,7 @@ namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
[Flags]
public enum BitPosition : byte
{
/*
PMEN = 0, //Power Management Enable
VPD = 1, //Enable Vital Product Data
IOMAP = 2, //I/O Mapping
@ -92,11 +93,13 @@ namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
DVRLOAD = 5,//Driver Load
LEDS0 = 6,
LEDS1 = 7
*/
}
[Flags]
public enum BitValue : uint
{
/*
PMEN = BinaryHelper.BitPos.BIT0,
VPD = BinaryHelper.BitPos.BIT1,
IOMAP = BinaryHelper.BitPos.BIT2,
@ -105,6 +108,7 @@ namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
DVRLOAD = BinaryHelper.BitPos.BIT5,
LEDS0 = BinaryHelper.BitPos.BIT6,
LEDS1 = BinaryHelper.BitPos.BIT7
*/
}
#endregion

View file

@ -5,7 +5,73 @@ using System.Text;
namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
{
/// <summary>
/// This register masks the interrupts that can be generated from the InterruptStatusRegister (ISR).
/// Setting a bit to 1 will enable a corresponding bit in ISR to cause an interrupt.
/// During a hardware reset all bits are set to 0.
/// </summary>
class InterruptMaskRegister
{
#region Constructor
private Kernel.MemoryAddressSpace xMem;
public static InterruptMaskRegister Load(Kernel.MemoryAddressSpace aMem)
{
return new InterruptMaskRegister(aMem);
}
private InterruptMaskRegister(Kernel.MemoryAddressSpace aMem)
{
xMem = aMem;
}
/*
public UInt16 IMR
{
get
{
return xMem.Read16((UInt32)Register.MainRegister.Bit.IntrMask);
}
set
{
xMem.Write16((UInt32)Register.MainRegister.Bit.IntrMask, value);
}
}
public override string ToString()
{
return this.IMR.ToBinary(16);
}
*/
#endregion
#region Accessors
private bool GetBit(BitPosition bit)
{
return BinaryHelper.CheckBit(this.IMR, (byte)bit);
}
private void SetBit(BitValue bit, bool value)
{
if (value)
this.IMR = (byte)(this.IMR | (byte)bit);
else
this.IMR = (byte)(this.IMR & ~(byte)bit);
}
#endregion
#region Bits
[Flags]
public enum BitPosition : byte
{
}
public enum BitValue : uint
{
}
#endregion
}
}

View file

@ -5,7 +5,90 @@ using System.Text;
namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
{
/// <summary>
/// The InterruptStatusRegister is used to indicate why an IRQ was raised. Used in conjunction with the InterruptMaskRegister.
/// </summary>
class InterruptStatusRegister
{
#region Constructor
private Kernel.MemoryAddressSpace xMem;
public static InterruptStatusRegister Load(Kernel.MemoryAddressSpace aMem)
{
return new InterruptStatusRegister(aMem);
}
private InterruptStatusRegister(Kernel.MemoryAddressSpace aMem)
{
xMem = aMem;
}
/*
public UInt16 ISR
{
get
{
return xMem.Read16((UInt32)Register.MainRegister.Bit.IntrStatus);
}
set
{
xMem.Write16((UInt32)Register.MainRegister.Bit.IntrStatus, value);
}
}
public override string ToString()
{
return this.ISR.ToBinary(16);
}*/
#endregion
#region Data
/*
public bool SoftwareInterrupt
{
get { return GetBit(BitPosition.SWINT); }
set { SetBit(BitValue.SWINT, value); }
}
public bool SystemError
{
get { return GetBit(BitPosition.SERR); }
set { SetBit(BitValue.SERR, value); }
}*/
#endregion
#region Accessors
private bool GetBit(BitPosition bit)
{
return BinaryHelper.CheckBit(this.ISR, (byte)bit);
}
private void SetBit(BitValue bit, bool value)
{
if (value)
this.ISR = (byte)(this.ISR | (byte)bit);
else
this.ISR = (byte)(this.ISR & ~(byte)bit);
}
#endregion
#region Bits
[Flags]
public enum BitPosition : byte
{
}
public enum BitValue : uint
{
}
#endregion
}
}

View file

@ -14,6 +14,9 @@ namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
UartData=0x08,
UartInfo=0x09,
MemAddrPage=0x0c,
ADCPage=0x0d,
UartPage=0x0e,
Uart1Page=0x0f,
Codec=0x10,
SerialIntContr=0x20,
Dac1SampleCount=0x24,

View file

@ -1,11 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Hardware.Audio.Devices.ES1370.Register
{
class MediaStatusRegister
{
}
}

View file

@ -56,7 +56,6 @@
<Compile Include="Audio\Devices\ES1370\Register\InterruptMaskRegister.cs" />
<Compile Include="Audio\Devices\ES1370\Register\InterruptStatusRegister.cs" />
<Compile Include="Audio\Devices\ES1370\Register\MainRegister.cs" />
<Compile Include="Audio\Devices\ES1370\Register\MediaStatusRegister.cs" />
<Compile Include="BlockDevice.cs" />
<Compile Include="USB\USBHost.cs" />
<Compile Include="USB\USBHostOHCI.cs" />