2019-12-06 22:24:34 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace Unosquare.RaspberryIO.Abstractions {
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interfaces a SPI buses on the GPIO.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ISpiChannel {
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// <summary>
|
2019-12-06 22:24:34 +01:00
|
|
|
|
/// Gets the standard initialization file descriptor.
|
|
|
|
|
/// anything negative means error.
|
2019-12-04 18:57:18 +01:00
|
|
|
|
/// </summary>
|
2019-12-06 22:24:34 +01:00
|
|
|
|
/// <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);
|
|
|
|
|
}
|
2019-12-04 18:57:18 +01:00
|
|
|
|
}
|