Exemplo n.º 1
0
 public TegraTimer(Machine machine)
 {
     IRQ = new GPIO();
     sync = new object();
     clockSource = machine.ObtainClockSource();
     Reset();
 }
Exemplo n.º 2
0
 public ComparingTimer(Machine machine, long frequency, long compare, long limit)
 {
     if(compare > limit || compare < 0)
     {
         throw new ConstructionException(string.Format(CompareHigherThanLimitMessage, compare, limit));
     }
     this.limit = limit;
     initialCompare = compare;
     clockSource = machine.ObtainClockSource();
     clockSource.AddClockEntry(new ClockEntry(compare, ClockEntry.FrequencyToRatio(this, frequency), CompareReached, false, workMode: WorkMode.OneShot));
 }
Exemplo n.º 3
0
        public LimitTimer(Machine machine, long frequency, long limit = int.MaxValue, Direction direction = Direction.Descending, bool enabled = false, WorkMode workMode = WorkMode.Periodic)
        {
            if(limit == 0)
            {
                throw new ArgumentException("Limit cannot be zero.");
            }
            irqSync = new object();
            clockSource = machine.ObtainClockSource();

            initialFrequency = frequency;
            initialLimit = limit;
            initialDirection = direction;
            initialEnabled = enabled;
            initialWorkMode = workMode;
            InternalReset();
        }
Exemplo n.º 4
0
 public SimpleTicker(long periodInMs, Machine machine)
 {
     var clockSource = machine.ObtainClockSource();
     clockSource.AddClockEntry(new ClockEntry(periodInMs, ClockEntry.FrequencyToRatio(this, 1000), OnTick));
 }
Exemplo n.º 5
0
 public PowerPc(string cpuType, Machine machine, EndiannessEnum endianness = EndiannessEnum.BigEndian): base(cpuType, machine, endianness)
 {
     irqSync = new object();
     machine.ObtainClockSource().AddClockEntry(
         new ClockEntry(long.MaxValue/2, ClockEntry.FrequencyToRatio(this, 128000000), DecrementerHandler, false, Direction.Descending));
 }