Ejemplo n.º 1
0
        private SPIResult Transfer(ADDRESS address, COMMAND command, int?value = null)
        {
            var l = new List <byte>();

            if (value.HasValue)
            {
                l.Add(build_command(address, command));
                l.Add(((byte)(value & DATA_MASK_WORD)));
            }
            else
            {
                l.Add(build_command(address, command));
            }
            var r = _spiEngine.Transfer(l);

            if (r.Succeeded)
            {
                r.Succeeded = this.ValidateOperation(r, address, command, value);
            }
            return(r);
        }