Characteristic Locus
Inheritance object > SpiClockConfiguration
Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Hardware
Assembly Meadow.Contracts.dll

Syntax

public class SpiClockConfiguration

Constructors

SpiClockConfiguration(Frequency, ClockPolarity, ClockPhase)

Creates a SpiClockConfiguration instance

Declaration
public SpiClockConfiguration(Frequency speed, SpiClockConfiguration.ClockPolarity polarity = ClockPolarity.Normal, SpiClockConfiguration.ClockPhase phase = ClockPhase.Zero)

Parameters

Type Name Description
Frequency speed

Bus clock speed, in kHz

SpiClockConfiguration.ClockPolarity polarity

Bus clock polarity

SpiClockConfiguration.ClockPhase phase

Bus clock phase

SpiClockConfiguration(Frequency, Mode)

Creates a SpiClockConfiguration instance

Declaration
public SpiClockConfiguration(Frequency speed, SpiClockConfiguration.Mode mode)

Parameters

Type Name Description
Frequency speed

Bus clock speed, in kHz

SpiClockConfiguration.Mode mode

Bus Mode (phase and polarity)

Properties

BitsPerWord

Gets or sets the number of bits per word

Declaration
public int BitsPerWord { get; set; }

Property Value

Type Description
int

Phase

Gets or sets the current Phase of the SPI bus clock

Declaration
public SpiClockConfiguration.ClockPhase Phase { get; set; }

Property Value

Type Description
SpiClockConfiguration.ClockPhase

Polarity

Gets or sets the current Polarity of the SPI bus clock

Declaration
public SpiClockConfiguration.ClockPolarity Polarity { get; set; }

Property Value

Type Description
SpiClockConfiguration.ClockPolarity

Speed

Sets the desired speed or gets the actual speed of the SPI bus clock.

Declaration
public Frequency Speed { get; set; }

Property Value

Type Description
Frequency

Remarks

The set of supported speeds is programmatically available from the bus in the SupportedSpeeds property.

SpiMode

Gets or sets the SPI mode

Declaration
public SpiClockConfiguration.Mode SpiMode { get; }

Property Value

Type Description
SpiClockConfiguration.Mode

Methods

SetActualSpeed(Frequency)

Provided to allow setting speed value without raising a Changed event. This method is used internally.

Declaration
public void SetActualSpeed(Frequency speed)

Parameters

Type Name Description
Frequency speed

The SPI bus speed

SetBusMode(Mode)

Provided to allow setting the SPI bus mode

Declaration
public void SetBusMode(SpiClockConfiguration.Mode mode)

Parameters

Type Name Description
SpiClockConfiguration.Mode mode

The SPI bus mode

Events

Changed

Event raised when the configuration changes

Declaration
public event EventHandler Changed

Event Type

Type Description
EventHandler