Raspberry.IO.InterIntegratedCircuit.I2cDriver.Dispose C# (CSharp) Method

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void
        public void Dispose()
        {
            // Set all the I2C/BSC1 pins back to original values if changed
            if (wasSdaPinSet)
            {
                SetPinMode((uint)(int)sdaPin, Interop.BCM2835_GPIO_FSEL_INPT); // SDA
            }
            if (wasSclPinSet)
            {
                SetPinMode((uint)(int)sclPin, Interop.BCM2835_GPIO_FSEL_INPT); // SCL
            }

            Interop.munmap(gpioAddress, Interop.BCM2835_BLOCK_SIZE);
            Interop.munmap(bscAddress, Interop.BCM2835_BLOCK_SIZE);
        }