SPITransfer() public static method

public static SPITransfer ( SerialPort sp, byte dataToTransfer ) : bool
sp System.IO.Ports.SerialPort
dataToTransfer byte
return bool
Exemplo n.º 1
0
 public static void Strobe(SerialPort sp, byte dataToWrite)
 {
     Serial.SelectRf(sp);
     Serial.WaitMISO(sp);
     Serial.SPITransfer(sp, dataToWrite);
     Serial.DeselectRf(sp);
 }
Exemplo n.º 2
0
 public static void WriteRegister(SerialPort sp, byte registerAddress, byte dataToWrite)
 {
     Serial.SelectRf(sp);
     Serial.WaitMISO(sp);
     Serial.SPITransfer(sp, registerAddress);
     Serial.SPITransfer(sp, dataToWrite);
     Serial.DeselectRf(sp);
 }
Exemplo n.º 3
0
 public static void WriteBurstRegister(SerialPort sp, byte registerAddress, byte[] buffer)
 {
     Serial.SelectRf(sp);
     Serial.WaitMISO(sp);
     Serial.SPITransfer(sp, (byte)(registerAddress | CCRegister.WRITE_BURST));
     foreach (byte dataToTransfer in buffer)
     {
         Serial.SPITransfer(sp, dataToTransfer);
     }
     Serial.DeselectRf(sp);
 }