1 // 2 // Copyright (c) 2010-2018 Antmicro 3 // 4 // This file is licensed under the MIT License. 5 // Full license text is available in 'licenses/MIT.txt'. 6 // 7 using System; 8 using Antmicro.Renode.Peripherals.Bus; 9 using Antmicro.Renode.Peripherals.Sensor; 10 11 namespace Antmicro.Renode.Peripherals.Sensors 12 { 13 public class DummySensor : IDoubleWordPeripheral, ITemperatureSensor, IHumiditySensor 14 { ReadDoubleWord(long offset)15 public uint ReadDoubleWord(long offset) 16 { 17 throw new NotImplementedException(); 18 } 19 WriteDoubleWord(long offset, uint value)20 public void WriteDoubleWord(long offset, uint value) 21 { 22 throw new NotImplementedException(); 23 } 24 Reset()25 public void Reset() 26 { 27 Temperature = 0; 28 Humidity = 0; 29 } 30 31 public decimal Temperature 32 { 33 get 34 { 35 return temperature; 36 } 37 set 38 { 39 temperature = value; 40 TemperatureUpdateCounter++; 41 } 42 } 43 44 public decimal Humidity 45 { 46 get 47 { 48 return humidity; 49 } 50 set 51 { 52 humidity = value; 53 HumidityUpdateCounter++; 54 } 55 } 56 57 public int TemperatureUpdateCounter { get; set; } 58 public int HumidityUpdateCounter { get; set; } 59 60 private decimal temperature; 61 private decimal humidity; 62 } 63 } 64