C# 클래스 CyrusBuilt.MonoPi.IO.SPI.SimpleSPI

A simplified SPI data access mechanism. This wraps the wiringPiSPI module in wiringPi, thus relies on wiringPi.so lib.
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi

공개 메소드들

메소드 설명
FullDuplexTransfer ( AdcChannels channel, String data ) : String

Write and read a block of data over the SPI bus. This is a full duplex operation.

GetFileDescriptor ( AdcChannels channel ) : Int32

Gets the file descriptor for the given channel.

Init ( AdcChannels channel ) : System.Boolean

Open the SPI device and set it up, etc, at the default speed (1000000).

Init ( AdcChannels channel, Int32 speed ) : System.Boolean

Open the SPI device and set it up, etc.

Read ( AdcChannels channel, Byte register ) : Byte

Reads a packet from the specified register over the specified channel.

Write ( AdcChannels channel, Byte register, Byte data ) : void

Write the specified data to the specified register on the specified channel.

메소드 상세

FullDuplexTransfer() 공개 정적인 메소드

Write and read a block of data over the SPI bus. This is a full duplex operation.
/// You initialize the SPI by calling Init() first. /// /// This module only supports a 2-channel device. Valid channels are /// and . ///
public static FullDuplexTransfer ( AdcChannels channel, String data ) : String
channel AdcChannels /// The channel to transfer on. ///
data String /// The data to transfer. ///
리턴 String

GetFileDescriptor() 공개 정적인 메소드

Gets the file descriptor for the given channel.
public static GetFileDescriptor ( AdcChannels channel ) : Int32
channel AdcChannels /// The channel to get the descriptor for. ///
리턴 System.Int32

Init() 공개 정적인 메소드

Open the SPI device and set it up, etc, at the default speed (1000000).
public static Init ( AdcChannels channel ) : System.Boolean
channel AdcChannels /// The channel to open. ///
리턴 System.Boolean

Init() 공개 정적인 메소드

Open the SPI device and set it up, etc.
public static Init ( AdcChannels channel, Int32 speed ) : System.Boolean
channel AdcChannels /// The channel to open. ///
speed System.Int32 /// The speed to negotiate the transfer rate at (ie. 38400). ///
리턴 System.Boolean

Read() 공개 정적인 메소드

Reads a packet from the specified register over the specified channel.
/// Failed to read from register. ///
public static Read ( AdcChannels channel, Byte register ) : Byte
channel AdcChannels /// The channel to comunicate with the target on. ///
register Byte /// The register to read the packet from. ///
리턴 Byte

Write() 공개 정적인 메소드

Write the specified data to the specified register on the specified channel.
public static Write ( AdcChannels channel, Byte register, Byte data ) : void
channel AdcChannels /// The channel to communicate with the target on. ///
register Byte /// The register to write the data to. ///
data Byte /// The data to write. ///
리턴 void