Characteristic Locus
Namespace Meadow.Hardware
Assembly Meadow.Core.NetStandard.dll

Syntax

public interface IIODevice

Properties

View Source

Capabilities

Gets the device capabilities.

Declaration
DeviceCapabilities Capabilities { get; }

Property Value

Type Description
DeviceCapabilities

Methods

View Source

CreateAnalogInputPort(IPin, Single)

Declaration
IAnalogInputPort CreateAnalogInputPort(IPin pin, float voltageReference)

Parameters

Type Name Description
IPin pin
System.Single voltageReference

Returns

Type Description
IAnalogInputPort
View Source

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

Declaration
IBiDirectionalPort CreateBiDirectionalPort(IPin pin, bool initialState = false, bool glitchFilter = false, InterruptMode interruptMode = default(InterruptMode), ResistorMode resistorMode = default(ResistorMode), PortDirectionType initialDirection = default(PortDirectionType))

Parameters

Type Name Description
IPin pin
System.Boolean initialState
System.Boolean glitchFilter
InterruptMode interruptMode
ResistorMode resistorMode
PortDirectionType initialDirection

Returns

Type Description
IBiDirectionalPort
View Source

CreateDigitalInputPort(IPin, InterruptMode, ResistorMode, Int32, Int32)

Declaration
IDigitalInputPort CreateDigitalInputPort(IPin pin, InterruptMode interruptMode = default(InterruptMode), ResistorMode resistorMode = default(ResistorMode), int debounceDuration = 0, int glitchFilterCycleCount = 0)

Parameters

Type Name Description
IPin pin
InterruptMode interruptMode
ResistorMode resistorMode
System.Int32 debounceDuration
System.Int32 glitchFilterCycleCount

Returns

Type Description
IDigitalInputPort
View Source

CreateDigitalOutputPort(IPin, Boolean)

Declaration
IDigitalOutputPort CreateDigitalOutputPort(IPin pin, bool initialState = false)

Parameters

Type Name Description
IPin pin
System.Boolean initialState

Returns

Type Description
IDigitalOutputPort
View Source

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)

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

View Source

CreateI2cBus(IPin[], Int32)

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

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

Parameters

Type Name Description
IPin[] pins
System.Int32 frequencyHz

The bus speed in (in Hz)

Returns

Type Description
II2cBus

An instance of an I2cBus

View Source

CreatePwmPort(IPin, Single, Single, Boolean)

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

Parameters

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

Returns

Type Description
IPwmPort
View Source

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
View Source

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

View Source

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)

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