/// <summary>
 /// Send one Data Byte to the Display
 /// </summary>
 /// <param name="data"></param>
 protected void SendData(byte data)
 {
     EPaperDisplayHardware.SpiDcPin = PinValue.High;
     EPaperDisplayHardware.SpiCsPin = PinValue.Low;
     EPaperDisplayHardware.WriteByte(data);
     EPaperDisplayHardware.SpiCsPin = PinValue.High;
 }
        //########################################################################################

        #region Protected Methods

        /// <summary>
        /// Send a Command to the Display
        /// </summary>
        /// <param name="command"></param>
        protected void SendCommand(byte command)
        {
            EPaperDisplayHardware.SpiDcPin = PinValue.Low;
            EPaperDisplayHardware.SpiCsPin = PinValue.Low;
            EPaperDisplayHardware.WriteByte(command);
            EPaperDisplayHardware.SpiCsPin = PinValue.High;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Send a stream to the Display
 /// </summary>
 /// <param name="stream"></param>
 public void SendData(MemoryStream stream)
 {
     EPaperDisplayHardware.SpiDcPin = PinValue.High;
     EPaperDisplayHardware.SpiCsPin = PinValue.Low;
     EPaperDisplayHardware.Write(stream);
     EPaperDisplayHardware.SpiCsPin = PinValue.High;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Send a Data Array to the Display
 /// </summary>
 /// <param name="data"></param>
 public void SendData(byte[] data)
 {
     EPaperDisplayHardware.SpiDcPin = PinValue.High;
     EPaperDisplayHardware.SpiCsPin = PinValue.Low;
     EPaperDisplayHardware.Write(data);
     EPaperDisplayHardware.SpiCsPin = PinValue.High;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Dispose
        /// </summary>
        public void Dispose()
        {
            Dispose(true);

            EPaperDisplayHardware?.Dispose();
            EPaperDisplayHardware = null;

            GC.SuppressFinalize(this);
        }
        //########################################################################################

        #region Private Methods

        /// <summary>
        /// Shut down the device
        /// </summary>
        private void DeviceShutdown()
        {
            if (EPaperDisplayHardware != null)
            {
                Sleep();

                EPaperDisplayHardware?.Dispose();
                EPaperDisplayHardware = null;
            }
        }
 /// <summary>
 /// Send a Data Array to the Display
 /// </summary>
 /// <param name="data"></param>
 protected void SendData(byte[] data)
 {
     EPaperDisplayHardware.SpiDcPin = PinValue.High;
     EPaperDisplayHardware.SpiCsPin = PinValue.Low;
     foreach (var dataByte in data)
     {
         EPaperDisplayHardware.WriteByte(dataByte);
     }
     EPaperDisplayHardware.SpiCsPin = PinValue.High;
 }