Characteristic Locus
Inheritance System.Object ObservableBase<UNIT> SensorBase<UNIT> SamplingSensorBase<UNIT> > ByteCommsSensorBase<UNIT> > AdafruitMPRLS > Bmp085 > Bmp180 > Ccs811 > DhtBase > Hih6130 > Htux1dBase > Mpl115a2 > Mpl3115a2 > Sht31d > Sht4x > Si70xx > Th02 > MaxBotix > Vl53l0x > Ags01Db > Bh1745 > Bh1750 > Max44009 > Si1145 > Tcs3472x > Tsl2591 > Veml7700 > Nau7802 > Adxl345 > Adxl362 > Apds9960 > Bno055 > Hmc5883 > Mag3110 > Mma7660fc > Mpu6050 > Ina260 > Lm75 > Mcp9808 > Tmp102
Implements IDisposable
Inherited Members SamplingSensorBase<UNIT>.StartUpdating(Nullable<TimeSpan>) SamplingSensorBase<UNIT>.StopUpdating() SensorBase<UNIT>.Updated SensorBase<UNIT>.samplingLock SensorBase<UNIT>.SamplingTokenSource SensorBase<UNIT>.Conditions SensorBase<UNIT>.IsSampling SensorBase<UNIT>.UpdateInterval SensorBase<UNIT>.ReadSensor() SensorBase<UNIT>.RaiseEventsAndNotify(IChangeResult<UNIT>) SensorBase<UNIT>.Read() ObservableBase<UNIT>.observers ObservableBase<UNIT>.NotifyObservers(IChangeResult<UNIT>) ObservableBase<UNIT>.Subscribe(IObserver<IChangeResult<UNIT>>) ObservableBase<UNIT>.CreateObserver(Action<IChangeResult<UNIT>>, Nullable<Predicate<IChangeResult<UNIT>>>)
Namespace Meadow.Foundation
Assembly Meadow.Foundation.dll

Syntax

public abstract class ByteCommsSensorBase<UNIT> : SamplingSensorBase<UNIT>, IDisposable where UNIT : struct

Type Parameters

Name Description
UNIT

Constructors

ByteCommsSensorBase(II2cBus, Byte, Int32, Int32)

Declaration
protected ByteCommsSensorBase(II2cBus i2cBus, byte address, int readBufferSize = 8, int writeBufferSize = 8)

Parameters

Type Name Description
II2cBus i2cBus
System.Byte address
System.Int32 readBufferSize
System.Int32 writeBufferSize

ByteCommsSensorBase(ISpiBus, IDigitalOutputPort, Int32, Int32, ChipSelectMode)

ByteCommsSensorBase abstract ctor for SPI

Declaration
protected ByteCommsSensorBase(ISpiBus spiBus, IDigitalOutputPort chipSelect, int readBufferSize = 8, int writeBufferSize = 8, ChipSelectMode chipSelectMode = ChipSelectMode.ActiveLow)

Parameters

Type Name Description
ISpiBus spiBus

SPI bus object

IDigitalOutputPort chipSelect

Chip select port

System.Int32 readBufferSize

Read buffer size

System.Int32 writeBufferSize

Write buffer size

ChipSelectMode chipSelectMode

Chip select mode

ByteCommsSensorBase(Int32, Int32)

ByteCommsSensorBase abstract ctor with no bus

Declaration
protected ByteCommsSensorBase(int readBufferSize = 8, int writeBufferSize = 8)

Parameters

Type Name Description
System.Int32 readBufferSize

Read buffer size

System.Int32 writeBufferSize

Write buffer size

Properties

Peripheral

Peripheral object, i.e. an I2CPeripheral or SpiPeripheral

Declaration
protected IByteCommunications Peripheral { get; set; }

Property Value

Type Description
IByteCommunications

ReadBuffer

Declaration
protected Memory<byte> ReadBuffer { get; }

Property Value

Type Description
Memory<System.Byte>

WriteBuffer

Declaration
protected Memory<byte> WriteBuffer { get; }

Property Value

Type Description
Memory<System.Byte>

Methods

Dispose()

Dispose managed resources

Declaration
public virtual void Dispose()

Dispose(Boolean)

Dispose object

Declaration
protected virtual void Dispose(bool disposing)

Parameters

Type Name Description
System.Boolean disposing

is disposing

Init(Int32, Int32)

Simple constructor for peripherals that don't use a bus and don't need an IByteCommunications

Declaration
protected virtual void Init(int readBufferSize = 8, int writeBufferSize = 8)

Parameters

Type Name Description
System.Int32 readBufferSize
System.Int32 writeBufferSize