Ejemplo n.º 1
0
 /// <summary>
 /// Get data from SPI-slave
 /// </summary>
 /// <param name="recData">ByteArray for polled data</param>
 protected void GetByteStream(byte[] recData)
 {
     if (SPIhandle != null)
     {
         // Activate CS-signal and CS-address, if necessary
         setCSsignal();
         SPIhandle.Read(recData);
         // Resets CS-signal and CS-address
         resetCSsignal();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Transceive data to/from SPI-slave
 /// </summary>
 /// <param name="sendData">Byte-Array for data transmission</param>
 /// <param name="recData">ByteArray for polled data</param>
 protected void TranceiveByteStram(byte[] sendData, byte[] recData)
 {
     if (SPIhandle != null)
     {
         // Activate CS-signal and CS-address, if necessary
         setCSsignal();
         SPIhandle.TransferFullDuplex(sendData, recData);
         // Resets CS-signal and CS-address
         resetCSsignal();
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Send data to SPI-slave
 /// </summary>
 /// <param name="sendData">Byte-Array for transmission</param>
 protected void SendByteStram(byte[] sendData)
 {
     if (SPIhandle != null)
     {
         /// Activate CS-signal and CS-address, if necessary
         setCSsignal();
         SPIhandle.Write(sendData);
         // Resets CS-signal and CS-address
         resetCSsignal();
     }
 }