RaspberryIO_26/Unosquare.RaspberryIO.Abstractions/ISpiChannel.cs
2019-12-06 22:24:34 +01:00

50 lines
1.3 KiB
C#

using System;
namespace Unosquare.RaspberryIO.Abstractions {
/// <summary>
/// Interfaces a SPI buses on the GPIO.
/// </summary>
public interface ISpiChannel {
/// <summary>
/// Gets the standard initialization file descriptor.
/// anything negative means error.
/// </summary>
/// <value>
/// The file descriptor.
/// </value>
Int32 FileDescriptor {
get;
}
/// <summary>
/// Gets the channel.
/// </summary>
Int32 Channel {
get;
}
/// <summary>
/// Gets the frequency.
/// </summary>
Int32 Frequency {
get;
}
/// <summary>
/// Sends data and simultaneously receives the data in the return buffer.
/// </summary>
/// <param name="buffer">The buffer.</param>
/// <returns>The read bytes from the ring-style bus.</returns>
Byte[] SendReceive(Byte[] buffer);
/// <summary>
/// Writes the specified buffer the the underlying FileDescriptor.
/// Do not use this method if you expect data back.
/// This method is efficient if used in a fire-and-forget scenario
/// like sending data over to those long RGB LED strips.
/// </summary>
/// <param name="buffer">The buffer.</param>
void Write(Byte[] buffer);
}
}