Fixed setGpioFunction method so it doesn't reset all other pins