public void unprovisionPin(GpioPin... pin) {
if (pin == null || pin.length == 0) {
throw new IllegalArgumentException("Missing pin argument.");
}
for (int index = (pin.length-1); index >= 0; index--) {
GpioPin p = pin[index];
// ensure the requested pin has been provisioned
if (!pins.contains(p)) {
throw new GpioPinNotProvisionedException(p.getPin());
}
// remove all listeners and triggers
if (p instanceof GpioPinInput) {
((GpioPinInput)p).removeAllListeners();
((GpioPinInput)p).removeAllTriggers();