Пример #1
0
        /// <summary>
        /// Reads the bytes data from the SPI slave device.
        /// </summary>
        /// <param name="buffer">The Data buffer.</param>
        public void Read(byte[] buffer)
        {
            var length = Convert.ToUInt32(buffer.Length);
            var ret    = NativeSpi.Read(_handle, buffer, length);

            if (ret != Internals.Errors.ErrorCode.None)
            {
                throw ExceptionFactory.CreateException(ret);
            }
        }