Characteristic Locus
Inheritance System.Object > F7Micro
Implements IIODevice
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Devices
Assembly Meadow.dll

Syntax

public class F7Micro : IIODevice

Constructors

F7Micro()

Declaration
public F7Micro()

Fields

DefaultA2DResolution

The default resolution for analog inputs

Declaration
public const int DefaultA2DResolution = 12

Field Value

Type Description
System.Int32

Properties

Capabilities

Declaration
public DeviceCapabilities Capabilities { get; protected set; }

Property Value

Type Description
DeviceCapabilities

Pins

Gets the pins.

Declaration
public F7Micro.F7MicroPinDefinitions Pins { get; protected set; }

Property Value

Type Description
F7Micro.F7MicroPinDefinitions

The pins.

SerialPortNames

Declaration
public F7Micro.SerialPortNameDefinitions SerialPortNames { get; protected set; }

Property Value

Type Description
F7Micro.SerialPortNameDefinitions

WiFiAdapter

Declaration
public WiFiAdapter WiFiAdapter { get; protected set; }

Property Value

Type Description
WiFiAdapter

Methods

BeginInvokeOnMainThread(Action)

Declaration
public void BeginInvokeOnMainThread(Action action)

Parameters

Type Name Description
System.Action action

CreateAnalogInputPort(IPin, Single)

Declaration
public 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
public 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 outputType = OutputType.PushPull)

Parameters

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

Returns

Type Description
IBiDirectionalPort

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

Declaration
public 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
public 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(I2cBusSpeed)

Creates an I2C bus instance for the default Meadow F7 pins (SCL/D08 and SDA/D07) and the requested bus speed

Declaration
public II2cBus CreateI2cBus(I2cBusSpeed busSpeed)

Parameters

Type Name Description
I2cBusSpeed busSpeed

Returns

Type Description
II2cBus

An instance of an I2cBus

CreateI2cBus(IPin, IPin, Int32)

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

Declaration
public 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) defaulting to 100k

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
public II2cBus CreateI2cBus(IPin[] pins, int frequencyHz = 100000)

Parameters

Type Name Description
IPin[] pins
System.Int32 frequencyHz

The bus speed in (in Hz) defaulting to 100k

Returns

Type Description
II2cBus

An instance of an I2cBus

CreateI2cBus(Int32)

Creates an I2C bus instance for the default Meadow F7 pins (SCL/D08 and SDA/D07) and the requested bus speed

Declaration
public II2cBus CreateI2cBus(int frequencyHz = 100000)

Parameters

Type Name Description
System.Int32 frequencyHz

The bus speed in (in Hz) defaulting to 100k

Returns

Type Description
II2cBus

An instance of an I2cBus

CreatePwmPort(IPin, Single, Single, Boolean)

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

Parameters

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

Returns

Type Description
IPwmPort

CreateSerialMessagePort(SerialPortName, Byte[], Boolean, Int32, Int32, Parity, StopBits, Int32)

Initializes a new instance of the ISerialMessagePort class that listens for serial messages defined byte[] message termination suffix.

Declaration
public ISerialMessagePort CreateSerialMessagePort(SerialPortName portName, byte[] suffixDelimiter, bool preserveDelimiter, int baudRate = 9600, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 512)

Parameters

Type Name Description
SerialPortName portName

The 'SerialPortName` of port to use.

System.Byte[] suffixDelimiter

A byte[] of the delimiter(s) that denote the end of the message.

System.Boolean preserveDelimiter

Whether or not to preseve the delimiter tokens when passing the message to subscribers.

System.Int32 baudRate

Speed, in bits per second, of the serial port.

System.Int32 dataBits

Number of data bits expected in the serial message frame. Default is 8.

Parity parity

Parity enum describing what type of cyclic-redundancy-check (CRC) bit, if any, should be expected in the serial message frame. Default is Parity.None.

StopBits stopBits

StopBits describing how many bits should be expected at the end of every character in the serial message frame. Default is StopBits.One.

System.Int32 readBufferSize

Size, in bytes, of the read buffer. Default is 512.

Returns

Type Description
ISerialMessagePort

CreateSerialMessagePort(SerialPortName, Byte[], Boolean, Int32, Int32, Int32, Parity, StopBits, Int32)

Initializes a new instance of the ISerialMessagePort class that listens for serial messages defined by a byte[] prefix, and a fixed length.

Declaration
public ISerialMessagePort CreateSerialMessagePort(SerialPortName portName, byte[] prefixDelimiter, bool preserveDelimiter, int messageLength, int baudRate = 9600, int dataBits = 8, Parity parity = Parity.None, StopBits stopBits = StopBits.One, int readBufferSize = 512)

Parameters

Type Name Description
SerialPortName portName

The 'SerialPortName` of port to use.

System.Byte[] prefixDelimiter

A byte[] of the delimiter(s) that denote the beginning of the message.

System.Boolean preserveDelimiter

Whether or not to preseve the delimiter tokens when passing the message to subscribers.

System.Int32 messageLength

Length of the message, not including the delimiter, to be parsed out of the incoming data.

System.Int32 baudRate

Speed, in bits per second, of the serial port.

System.Int32 dataBits

Number of data bits expected in the serial message frame. Default is 8.

Parity parity

Parity enum describing what type of cyclic-redundancy-check (CRC) bit, if any, should be expected in the serial message frame. Default is Parity.None.

StopBits stopBits

StopBits describing how many bits should be expected at the end of every character in the serial message frame. Default is StopBits.One.

System.Int32 readBufferSize

Size, in bytes, of the read buffer. Default is 512.

Returns

Type Description
ISerialMessagePort

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

Initializes a new instance of a legacy ISerialPort. ISerialPort is provided for legacy compatibility, we recommend using the more modern, thread-safe ISerialMessagePort.

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

Parameters

Type Name Description
SerialPortName portName

The 'SerialPortName` of port to use.

System.Int32 baudRate

Speed, in bits per second, of the serial port.

System.Int32 dataBits

Number of data bits expected in the serial message frame. Default is 8.

Parity parity

Parity enum describing what type of cyclic-redundancy-check (CRC) bit, if any, should be expected in the serial message frame. Default is Parity.None.

StopBits stopBits

StopBits describing how many bits should be expected at the end of every character in the serial message frame. Default is StopBits.One.

System.Int32 readBufferSize

Size, in bytes, of the read buffer. Default is 1024.

Returns

Type Description
ISerialPort

CreateSpiBus(IPin, IPin, IPin, SpiClockConfiguration)

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

Declaration
public 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
public 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

CreateSpiBus(IPin[], Int64)

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

Declaration
public ISpiBus CreateSpiBus(IPin[] pins, long speedkHz = 375L)

Parameters

Type Name Description
IPin[] pins

IPint instances used for (in this order) CLK, MOSI, MISO

System.Int64 speedkHz

The bus speed (in kHz)

Returns

Type Description
ISpiBus

An instance of an IISpiBus

CreateSpiBus(Int64)

Creates a SPI bus instance for the requested bus speed with the Meadow- default IPins for CLK, MOSI and MISO

Declaration
public ISpiBus CreateSpiBus(long speedkHz = 375L)

Parameters

Type Name Description
System.Int64 speedkHz

The bus speed (in kHz)

Returns

Type Description
ISpiBus

An instance of an IISpiBus

InitEsp32CoProc()

Declaration
protected Task<bool> InitEsp32CoProc()

Returns

Type Description
System.Threading.Tasks.Task<System.Boolean>

InitWiFiAdapter()

Declaration
public Task<bool> InitWiFiAdapter()

Returns

Type Description
System.Threading.Tasks.Task<System.Boolean>

IsOnboardLed(IPin)

Tests whether or not the pin passed in belongs to an onboard LED component. Used for a dirty dirty hack.

Declaration
protected bool IsOnboardLed(IPin pin)

Parameters

Type Name Description
IPin pin

Returns

Type Description
System.Boolean

whether or no the pin belons to the onboard LED

SetClock(DateTime)

Declaration
public void SetClock(DateTime dateTime)

Parameters

Type Name Description
System.DateTime dateTime

SetSynchronizationContext(SynchronizationContext)

Declaration
public void SetSynchronizationContext(SynchronizationContext context)

Parameters

Type Name Description
System.Threading.SynchronizationContext context

Events

WiFiAdapterInitilaized

Declaration
public event EventHandler WiFiAdapterInitilaized

Event Type

Type Description
System.EventHandler