Treehopper C# API
Spi Interface Reference

An SPI interface More...

Inheritance diagram for Spi:
HardwareSpi

Public Member Functions

Task< byte[]> SendReceiveAsync (byte[] dataToWrite, SpiChipSelectPin chipSelect=null, ChipSelectMode chipSelectMode=ChipSelectMode.SpiActiveLow, double speedMhz=1, SpiBurstMode burstMode=SpiBurstMode.NoBurst, SpiMode spiMode=SpiMode.Mode00)
 Send/receive data More...
 

Properties

bool Enabled [get, set]
 Enable or disable the SPI module. More...
 

Detailed Description

An SPI interface

Member Function Documentation

◆ SendReceiveAsync()

Task<byte[]> SendReceiveAsync ( byte []  dataToWrite,
SpiChipSelectPin  chipSelect = null,
ChipSelectMode  chipSelectMode = ChipSelectMode.SpiActiveLow,
double  speedMhz = 1,
SpiBurstMode  burstMode = SpiBurstMode.NoBurst,
SpiMode  spiMode = SpiMode.Mode00 
)

Send/receive data

Parameters
dataToWritea byte array of the data to send. The length of the transaction is determined by the length of this array.
chipSelectThe chip select pin, if any, to use during this transaction.
chipSelectModeThe chip select mode to use during this transaction (if a CS pin is selected)
speedMhzThe speed to perform this transaction at.
burstModeWhether to use one of the burst modes
spiModeThe SPI mode to use during this transaction.
Returns
An awaitable byte array with the received data.

Implemented in HardwareSpi.

Property Documentation

◆ Enabled

bool Enabled
getset

Enable or disable the SPI module.


The documentation for this interface was generated from the following file: