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 | |
---|---|---|
SPI | Initializes a new instance of the SPI class. |
Top
Properties
Name | Description | |
---|---|---|
Config | Returns the configuration object for the current SPI object. |
Top
Methods
Name | Description | |
---|---|---|
Dispose | Releases the pin associated with an SPI object. | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Write(array<Byte> [] () [] []) | Writes an array of bytes to the interface. | |
Write(array<UInt16> [] () [] []) | Writes an array of unsigned short arguments to the interface. | |
WriteRead(array<Byte> [] () [] [], array<Byte> [] () [] []) | Writes an array of bytes to the interface, and reads an array of bytes from the interface. | |
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. | |
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. | |
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. | |
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. | |
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.