Characteristic Locus
Namespace Meadow.Hardware
Assembly Meadow.dll

Syntax

public interface IIODevice

Fields

DefaultA2DReferenceVoltage

Declaration
public const float DefaultA2DReferenceVoltage = 3.3F

Field Value

Type Description
System.Single

DefaultI2cBusSpeed

The default I2C Bus speed, in Hz, used when speed parameters are not provided

Declaration
public const int DefaultI2cBusSpeed = 100000

Field Value

Type Description
System.Int32

DefaultPwmDutyCycle

Declaration
public const float DefaultPwmDutyCycle = 0.5F

Field Value

Type Description
System.Single

DefaultPwmFrequency

Declaration
public const float DefaultPwmFrequency = 100F

Field Value

Type Description
System.Single

DefaultSpiBusSpeed

The default SPI Bus speed, in kHz, used when speed parameters are not provided

Declaration
public const int DefaultSpiBusSpeed = 375

Field Value

Type Description
System.Int32

Properties

Capabilities

Gets the device capabilities.

Declaration
DeviceCapabilities Capabilities { get; }

Property Value

Type Description
DeviceCapabilities

Methods

CreateAnalogInputPort(IPin, Single)

Declaration
IAnalogInputPort CreateAnalogInputPort(IPin pin, float voltageReference = 3.3F)

Parameters

Type Name Description
IPin pin
System.Single voltageReference

Returns

Type Description
IAnalogInputPort

CreateBiDirectionalPort(IPin, Boolean, InterruptMode, ResistorMode, PortDirectionType, Double, Double, OutputType)

Declaration
IBiDirectionalPort CreateBiDirectionalPort(IPin pin, bool initialState = false, InterruptMode interruptMode = InterruptMode.None, ResistorMode resistorMode = ResistorMode.Disabled, PortDirectionType initialDirection = PortDirectionType.Input, double debounceDuration = 0, double glitchDuration = 0, OutputType output = OutputType.PushPull)

Parameters

Type Name Description
IPin pin
System.Boolean initialState
InterruptMode interruptMode
ResistorMode resistorMode
PortDirectionType initialDirection
System.Double debounceDuration
System.Double glitchDuration
OutputType output

Returns

Type Description
IBiDirectionalPort

CreateDigitalInputPort(IPin, InterruptMode, ResistorMode, Double, Double)

Declaration
IDigitalInputPort CreateDigitalInputPort(IPin pin, InterruptMode interruptMode = InterruptMode.None, ResistorMode resistorMode = ResistorMode.Disabled, double debounceDuration = 0, double glitchDuration = 0)

Parameters

Type Name Description
IPin pin
InterruptMode interruptMode
ResistorMode resistorMode
System.Double debounceDuration
System.Double glitchDuration

Returns

Type Description
IDigitalInputPort

CreateDigitalOutputPort(IPin, Boolean, OutputType)

Declaration
IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState = false, OutputType initialOutputType = OutputType.PushPull)

Parameters

Type Name Description
IPin pin
System.Boolean initialState
OutputType initialOutputType

Returns

Type Description
IDigitalOutputPort

CreateI2cBus(IPin, IPin, Int32)

Creates an I2C bus instance for the requested pins and bus speed

Declaration
II2cBus CreateI2cBus(IPin clock, IPin data, int frequencyHz = 100000)

Parameters

Type Name Description
IPin clock
IPin data
System.Int32 frequencyHz

The bus speed in (in Hz)

Returns

Type Description
II2cBus

An instance of an I2cBus

CreateI2cBus(IPin[], Int32)

Creates an I2C bus instance for the requested pins and bus speed

Declaration
II2cBus CreateI2cBus(IPin[] pins, int frequencyHz = 100000)

Parameters

Type Name Description
IPin[] pins
System.Int32 frequencyHz

The bus speed in (in Hz)

Returns

Type Description
II2cBus

An instance of an I2cBus

CreatePwmPort(IPin, Single, Single, Boolean)

Declaration
IPwmPort CreatePwmPort(IPin pin, float frequency = 100F, float dutyCycle = 0.5F, bool invert = false)

Parameters

Type Name Description
IPin pin
System.Single frequency
System.Single dutyCycle
System.Boolean invert

Returns

Type Description
IPwmPort

CreateSerialPort(SerialPortName, Int32, Int32, Parity, StopBits, Int32)

Declaration
ISerialPort CreateSerialPort(SerialPortName portName, int baudRate, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 4096)

Parameters

Type Name Description
SerialPortName portName
System.Int32 baudRate
System.Int32 dataBits
Parity parity
StopBits stopBits
System.Int32 readBufferSize

Returns

Type Description
ISerialPort

CreateSpiBus(IPin, IPin, IPin, SpiClockConfiguration)

Creates a SPI bus instance for the requested control pins and bus speed

Declaration
ISpiBus CreateSpiBus(IPin clock, IPin mosi, IPin miso, SpiClockConfiguration config)

Parameters

Type Name Description
IPin clock

The IPin instance to use as the bus clock

IPin mosi

The IPin instance to use for data transmit (master out/slave in)

IPin miso

The IPin instance to use for data receive (master in/slave out)

SpiClockConfiguration config

The bus clock configuration parameters

Returns

Type Description
ISpiBus

An instance of an IISpiBus

CreateSpiBus(IPin, IPin, IPin, Int64)

Creates a SPI bus instance for the requested control pins and bus speed

Declaration
ISpiBus CreateSpiBus(IPin clock, IPin mosi, IPin miso, long speedkHz = 375L)

Parameters

Type Name Description
IPin clock

The IPin instance to use as the bus clock

IPin mosi

The IPin instance to use for data transmit (master out/slave in)

IPin miso

The IPin instance to use for data receive (master in/slave out)

System.Int64 speedkHz

The bus speed (in kHz)

Returns

Type Description
ISpiBus

An instance of an IISpiBus

SetClock(DateTime)

Declaration
void SetClock(DateTime dateTime)

Parameters

Type Name Description
System.DateTime dateTime