Skip to main content

Class SerialWombatBase

SerialWombat base class

Assembly: SerialWombat.dll
View Source
public abstract class SerialWombatBase : IDigitalInputOutputController, IDigitalInputController, IDigitalOutputController, IPwmOutputController, IAnalogInputController, IPinController, II2cPeripheral

Derived:
Meadow.Foundation.ICs.IOExpanders.Sw18AB

Implements:
Meadow.Hardware.IDigitalInputOutputController, Meadow.Hardware.IDigitalInputController, Meadow.Hardware.IDigitalOutputController, Meadow.Hardware.IPwmOutputController, Meadow.Hardware.IAnalogInputController, Meadow.Hardware.IPinController, Meadow.Hardware.II2cPeripheral

Properties

DefaultI2cAddress

The default I2C address for the peripheral

View Source
public byte DefaultI2cAddress { get; }

I2cAddress

The current I2C address for the peripheral

View Source
public SerialWombatBase.Addresses I2cAddress { get; }

SyncRoot

The sync root object

View Source
protected object SyncRoot { get; }

Logger

Logger object

View Source
protected Logger? Logger { get; }

Pins

The pins

View Source
public SerialWombatBase.PinDefinitions Pins { get; }

Version

The version

View Source
public WombatVersion Version { get; }

Info

Serial Wombat info

View Source
public WombatInfo Info { get; }

Uuid

Serial Wombat GUID

View Source
public Guid Uuid { get; }

Methods

SendPacket(Span<byte>, Span<byte>)

Send a packet of data

View Source
protected void SendPacket(Span<byte> tx, Span<byte> rx)
Parameters
TypeName
System.Span<System.Byte>tx
System.Span<System.Byte>rx

SendCommand(in Span<byte>)

Send a command

View Source
protected byte[] SendCommand(in Span<byte> command)
Returns

System.Byte[]

Parameters
TypeName
System.Span<System.Byte>command

ReadPublicData(SwPin)

Read public data from a pin

View Source
protected ushort ReadPublicData(SerialWombatBase.SwPin pin)
Returns

System.UInt16: The data as a ushort

Parameters
TypeNameDescription
Meadow.Foundation.ICs.IOExpanders.SerialWombatBase.SwPinpinThe serial wombat pin to read

ReadPublicData(IPin)

Read public data from a pin

View Source
protected ushort ReadPublicData(IPin pin)
Returns

System.UInt16: The data as a ushort

Parameters
TypeNameDescription
Meadow.Hardware.IPinpinThe pin to read

ReadPublicData(byte)

Read public data from a pin

View Source
protected ushort ReadPublicData(byte pin)
Returns

System.UInt16: The data as a ushort

Parameters
TypeNameDescription
System.BytepinThe pin to read as a byte ID

WritePublicData(SwPin, ushort)

Write public data to a pin

View Source
protected ushort WritePublicData(SerialWombatBase.SwPin pin, ushort data)
Returns

System.UInt16

Parameters
TypeName
Meadow.Foundation.ICs.IOExpanders.SerialWombatBase.SwPinpin
System.UInt16data

WritePublicData(byte, ushort)

Write public data to a pin

View Source
protected ushort WritePublicData(byte pin, ushort data)
Returns

System.UInt16

Parameters
TypeName
System.Bytepin
System.UInt16data

ReadFlash(FlashRegister18)

Read data from flash

View Source
protected uint ReadFlash(SerialWombatBase.FlashRegister18 register)
Returns

System.UInt32

Parameters
TypeName
Meadow.Foundation.ICs.IOExpanders.SerialWombatBase.FlashRegister18register

ReadFlash(uint)

Read data from flash

View Source
protected uint ReadFlash(uint address)
Returns

System.UInt32

Parameters
TypeName
System.UInt32address

ConfigureOutputPin(byte, bool, OutputType)

Configure the state and type for a pin

View Source
protected void ConfigureOutputPin(byte pin, bool state, OutputType type = OutputType.PushPull)
Parameters
TypeName
System.Bytepin
System.Booleanstate
Meadow.Hardware.OutputTypetype

ConfigureInputPin(byte, ResistorMode)

Configure the resistor mode for a pin

View Source
protected void ConfigureInputPin(byte pin, ResistorMode mode)
Parameters
TypeName
System.Bytepin
Meadow.Hardware.ResistorModemode

ConfigurePwm(byte, float, bool)

Configure the PWM parameters for a PWM pin

View Source
protected void ConfigurePwm(byte pin, float dutyCycle, bool inverted)
Parameters
TypeName
System.Bytepin
System.SingledutyCycle
System.Booleaninverted

ConfigurePwmDutyCycle(byte, float)

Configure the PWM duty cycle for a PWM pin

View Source
protected void ConfigurePwmDutyCycle(byte pin, float dutyCycle)
Parameters
TypeName
System.Bytepin
System.SingledutyCycle

ConfigurePwm(byte, Frequency)

Configure the frequency cycle for a PWM pin

View Source
protected void ConfigurePwm(byte pin, Frequency frequency)
Parameters
TypeName
System.Bytepin
Meadow.Units.Frequencyfrequency

ConfigurePwm(byte, uint)

Configure the period cycle for a PWM pin

View Source
protected void ConfigurePwm(byte pin, uint periodMicroseconds)
Parameters
TypeName
System.Bytepin
System.UInt32periodMicroseconds

ConfigureAnalogInput(byte, ushort, ushort)

Configure an analog input pin

View Source
protected void ConfigureAnalogInput(byte pin, ushort sampleCount = 64, ushort iirFilterConstant = 65408)
Parameters
TypeName
System.Bytepin
System.UInt16sampleCount
System.UInt16iirFilterConstant

ConfigureUltrasonicSensor(IPin, IPin, bool)

Configure an ultrasonic pin

View Source
protected void ConfigureUltrasonicSensor(IPin trigger, IPin echo, bool autoTrigger = true)
Parameters
TypeName
Meadow.Hardware.IPintrigger
Meadow.Hardware.IPinecho
System.BooleanautoTrigger

ReadUltrasonicSensorPulses(IPin)

Read pulses from an ultrasonic sensor

View Source
protected ushort ReadUltrasonicSensorPulses(IPin echo)
Returns

System.UInt16

Parameters
TypeName
Meadow.Hardware.IPinecho

ManualTriggerUltrasonicSensor(IPin)

Manually trigger an ultra sonic sensor

View Source
protected void ManualTriggerUltrasonicSensor(IPin echo)
Parameters
TypeName
Meadow.Hardware.IPinecho

GetSupplyVoltage()

Get supply voltage

View Source
public Voltage GetSupplyVoltage()
Returns

Meadow.Units.Voltage

GetTemperature()

Get Temperature

View Source
public Temperature GetTemperature()
Returns

Meadow.Units.Temperature

CreateDigitalOutputPort(IPin, bool, OutputType)

Create a digital output port for a pin

View Source
public IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState = false, OutputType outputType = OutputType.PushPull)
Returns

Meadow.Hardware.IDigitalOutputPort

Parameters
TypeName
Meadow.Hardware.IPinpin
System.BooleaninitialState
Meadow.Hardware.OutputTypeoutputType

CreateDigitalInputPort(IPin, ResistorMode)

Create a digital input port for a pin

View Source
public IDigitalInputPort CreateDigitalInputPort(IPin pin, ResistorMode resistorMode = ResistorMode.Disabled)
Returns

Meadow.Hardware.IDigitalInputPort

Parameters
TypeName
Meadow.Hardware.IPinpin
Meadow.Hardware.ResistorModeresistorMode

CreateDigitalInputPort(IPin)

Create a digital input port for a pin

View Source
public IDigitalInputPort CreateDigitalInputPort(IPin pin)
Returns

Meadow.Hardware.IDigitalInputPort

Parameters
TypeName
Meadow.Hardware.IPinpin

CreatePwmPort(IPin, Frequency, float, bool)

Create a PWM port for a pin

View Source
public IPwmPort CreatePwmPort(IPin pin, Frequency frequency, float dutyCycle = 0.5, bool invert = false)
Returns

Meadow.Hardware.IPwmPort

Parameters
TypeName
Meadow.Hardware.IPinpin
Meadow.Units.Frequencyfrequency
System.SingledutyCycle
System.Booleaninvert

CreateAnalogInputPort(IPin, int)

Create an analog input port for a pin

View Source
public IAnalogInputPort CreateAnalogInputPort(IPin pin, int sampleCount = 64)
Returns

Meadow.Hardware.IAnalogInputPort

Parameters
TypeName
Meadow.Hardware.IPinpin
System.Int32sampleCount

CreateAnalogInputPort(IPin, int, TimeSpan, Voltage)

Create an analog input port for a pin

View Source
public IAnalogInputPort CreateAnalogInputPort(IPin pin, int sampleCount, TimeSpan sampleInterval, Voltage voltageReference)
Returns

Meadow.Hardware.IAnalogInputPort

Parameters
TypeName
Meadow.Hardware.IPinpin
System.Int32sampleCount
System.TimeSpansampleInterval
Meadow.Units.VoltagevoltageReference

CreateAnalogInputArray(params IPin[])

Creates an IAnalogInputArray instance from the specified set of pins

View Source
public IAnalogInputArray CreateAnalogInputArray(params IPin[] pins)
Returns

Meadow.Hardware.IAnalogInputArray

Parameters
TypeNameDescription
Meadow.Hardware.IPin[]pinsThe pins to use for the IAnalogInputArray

CreateDistanceSensor(IPin, IPin)

Create a distance sensor for a pin

View Source
public IRangeFinder CreateDistanceSensor(IPin trigger, IPin echo)
Returns

Meadow.Peripherals.Sensors.Distance.IRangeFinder

Parameters
TypeName
Meadow.Hardware.IPintrigger
Meadow.Hardware.IPinecho

CreateDistanceSensor(IPin, IPin, TimeSpan)

Create a distance sensor for a pin

View Source
public IRangeFinder CreateDistanceSensor(IPin trigger, IPin echo, TimeSpan readPeriod)
Returns

Meadow.Peripherals.Sensors.Distance.IRangeFinder

Parameters
TypeName
Meadow.Hardware.IPintrigger
Meadow.Hardware.IPinecho
System.TimeSpanreadPeriod

CreateServo(IPin)

Create a servo for a pin

View Source
public IServo CreateServo(IPin pin)
Returns

Meadow.Foundation.Servos.IServo

Parameters
TypeName
Meadow.Hardware.IPinpin

Implements

  • Meadow.Hardware.IDigitalInputOutputController
  • Meadow.Hardware.IDigitalInputController
  • Meadow.Hardware.IDigitalOutputController
  • Meadow.Hardware.IPwmOutputController
  • Meadow.Hardware.IAnalogInputController
  • Meadow.Hardware.IPinController
  • Meadow.Hardware.II2cPeripheral