Defines an I2C read action.
Inheritance: Raspberry.IO.InterIntegratedCircuit.I2cAction
コード例 #1
0
        /// <summary>
        /// Reads the specified number of bytes.
        /// </summary>
        /// <param name="byteCount">The byte count.</param>
        /// <returns>The buffer.</returns>
        public byte[] Read(int byteCount)
        {
            var readAction = new I2cReadAction(new byte[byteCount]);
            Execute(new I2cTransaction(readAction));

            return readAction.Buffer;
        }
コード例 #2
0
        /// <summary>
        /// Reads the specified number of bytes.
        /// </summary>
        /// <param name="byteCount">The byte count.</param>
        /// <returns>The buffer.</returns>
        public byte[] Read(int byteCount)
        {
            var readAction = new I2cReadAction(new byte[byteCount]);

            Execute(new I2cTransaction(readAction));

            return(readAction.Buffer);
        }