public void WriteCommandToLcd(LcdCommand command)
        {
            this.lcdRegisterSelectGpio.Write(false);
            var ret = 0;

            using (var transferBuffer = this.spi0.CreateTransferBuffer(1, SpiTransferMode.ReadWrite))
            {
                transferBuffer.Tx[0]            = Convert.ToByte(command);
                transferBuffer.Delay            = 0;
                transferBuffer.Speed            = SpiSpeed;
                transferBuffer.BitsPerWord      = BitsPerWord;
                transferBuffer.ChipSelectChange = false;
                ret = this.spi0.Transfer(transferBuffer);
            }

            if (ret < 0)
            {
                Console.WriteLine(string.Format("Error performing SPI Exchange: {0}", Console.Error.ToString()));
                Environment.Exit(1);
            }
        }
Exemple #2
0
 protected void SendCommand(LcdCommand command, byte[] data)
 {
     SendCommand((byte)command);
     SendData(data);
 }
Exemple #3
0
 protected void SendCommand(LcdCommand command)
 {
     SendCommand((byte)command);
 }
Exemple #4
0
 private void SendCommand(LcdCommand command, byte[] data)
 {
     SendCommand((byte)command);
     SendData(data);
 }
Exemple #5
0
 private void SendCommand(LcdCommand command)
 {
     SendCommand((byte)command);
 }
        public void WriteCommandToLcd(LcdCommand command)
        {
            this.lcdRegisterSelectGpio.Write(false);
            var ret = 0;

            using (var transferBuffer = this.spi0.CreateTransferBuffer(1, SpiTransferMode.ReadWrite))
            {
                transferBuffer.Tx[0] = Convert.ToByte(command);
                transferBuffer.Delay = 0;
                transferBuffer.Speed = SpiSpeed;
                transferBuffer.BitsPerWord = BitsPerWord;
                transferBuffer.ChipSelectChange = false;
                ret = this.spi0.Transfer(transferBuffer);
            }

            if (ret < 0)
            {
                Console.WriteLine(string.Format("Error performing SPI Exchange: {0}", Console.Error.ToString()));
                Environment.Exit(1);
            }
        }