示例#1
0
        // Note: A constructor summary is auto-generated by the doc builder.
        /// <summary></summary>
        /// <remarks>This automatically checks that the socket supports Type I, and reserves the SDA and SCL pins.
        /// An exception will be thrown if there is a problem with these checks.</remarks>
        /// <param name="address">The address for the I2C device.</param>
        /// <param name="clockRateKhz">The clock rate, in kHz, used when communicating with the I2C device.</param>
        /// <param name="socket">The socket for this I2C device interface.</param>
        /// <param name="module">The module using this I2C interface, which can be null if unspecified.</param>
        public I2CBus(Socket socket, ushort address, int clockRateKhz, Module module)
        {
            socket.EnsureTypeIsSupported('I', module);

            if (socket.I2CBusIndirector != null)
                Interface = socket.I2CBusIndirector(socket, address, clockRateKhz, module);

            else
                Interface = new NativeI2CBus(socket, address, clockRateKhz, module);
        }