/// <summary> /// Send a command to the the display controller along with parameters. /// </summary> /// <param name="command">Command to send.</param> /// <param name="data">Span to send as parameters for the command.</param> private void SendCommand(Ili9341Command command, Span <byte> data) { Span <byte> commandSpan = stackalloc byte[] { (byte)command }; SendSPI(commandSpan, true); if (data != null && data.Length > 0) { SendSPI(data); } }
/// <summary> /// Send a command to the the display controller along with associated parameters. /// </summary> /// <param name="command">Command to send.</param> /// <param name="commandParameters">parameteters for the command to be sent</param> private void SendCommand(Ili9341Command command, params byte[] commandParameters) { SendCommand(command, commandParameters.AsSpan()); }