Share via


SPI Class

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Represents an instance of the Microwire/SPI interface for a Microwire/SPI device.

Inheritance Hierarchy

System. . :: . .Object
  Microsoft.SPOT.Hardware..::..SPI

Namespace:  Microsoft.SPOT.Hardware
Assembly:  Microsoft.SPOT.Hardware (in Microsoft.SPOT.Hardware.dll)

Syntax

'Declaration
Public NotInheritable Class SPI _
    Implements IDisposable
public sealed class SPI : IDisposable
public ref class SPI sealed : IDisposable
[<Sealed>]
type SPI =  
    class
        interface IDisposable
    end
public final class SPI implements IDisposable

The SPI type exposes the following members.

Constructors

  Name Description
Public method SPI Initializes a new instance of the SPI class.

Top

Properties

  Name Description
Public property Config Returns the configuration object for the current SPI object.

Top

Methods

  Name Description
Public method Dispose Releases the pin associated with an SPI object.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method Write(array<Byte> [] () [] []) Writes an array of bytes to the interface.
Public method Write(array<UInt16> [] () [] []) Writes an array of unsigned short arguments to the interface.
Public method WriteRead(array<Byte> [] () [] [], array<Byte> [] () [] []) Writes an array of bytes to the interface, and reads an array of bytes from the interface.
Public method WriteRead(array<UInt16> [] () [] [], array<UInt16> [] () [] []) Writes an array of bytes to the interface, and reads an array of bytes from the interface into the read buffer.
Public method WriteRead(array<Byte> [] () [] [], array<Byte> [] () [] [], Int32) Writes an array of bytes to the interface, and reads an array of bytes from the interface into a specified location in the read buffer.
Public method WriteRead(array<UInt16> [] () [] [], array<UInt16> [] () [] [], Int32) Writes an array of unsigned values to the interface, and reads an array of unsigned values from the interface into a specified location in the read buffer.
Public method WriteRead(array<Byte> [] () [] [], Int32, Int32, array<Byte> [] () [] [], Int32, Int32, Int32) Writes an array of bytes to the interface, and reads an array of bytes from the interface into a specified location in the read buffer.
Public method WriteRead(array<UInt16> [] () [] [], Int32, Int32, array<UInt16> [] () [] [], Int32, Int32, Int32) Writes an array of unsigned values to the interface, and reads an array of unsigned values from the interface into a specified location in the read buffer.

Top

Remarks

The Microwire/SPI interface is a synchronous serial communications protocol in which multiple devices can be connected with one another by means of a single three-wire system. This three-wire system includes the serial data in signal, the serial data out signal, and the serial clock. You must use an additional GPIO pin as a chip select for each device that will communicate on the Microwire/SPI interface.

There are both 8-bit and 16-bit modes of operation using the overloaded read and write methods that have byte (8-bit) arguments or unsigned short (16-bit) arguments. Note that you can configure both 8-bit and 16-bit devices and have them share the SPI interface.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SPOT.Hardware Namespace