/// <summary>
 /// Reads the status of the specified pins.
 /// </summary>
 /// <param name="pins">The pins.</param>
 /// <returns>
 /// The pins status.
 /// </returns>
 public ProcessorPins Read(ProcessorPins pins)
 {
     return pins.Enumerate()
         .Select(p => Read(p) ? (ProcessorPins) ((uint) 1 << (int) p) : ProcessorPins.None)
         .Aggregate(
             ProcessorPins.None,
             (a, p) => a | p);
 }
Example #2
0
 /// <summary>
 /// Reads the status of the specified pins.
 /// </summary>
 /// <param name="pins">The pins.</param>
 /// <returns>
 /// The pins status.
 /// </returns>
 public ProcessorPins Read(ProcessorPins pins)
 {
     return(pins.Enumerate()
            .Select(p => this.Read(p) ? (ProcessorPins)(1U << (int)p) : ProcessorPins.None)
            .Aggregate(
                ProcessorPins.None,
                (a, p) => a | p));
 }
Example #3
0
        public void enumerateTest()
        {
            var pins1 = new ProcessorPins();

            pins1.Set(0, true);
            var pins = pins1.Enumerate();

            Assert.AreEqual(1, pins.Count());
            Assert.AreEqual(0, pins.ToArray()[0]);
        }