docs: @Override
      public void setState(Pin pin, PinState state) {
  
          // validate pin
          if (!hasPin(pin)) {
              throw new InvalidPinException(pin);
          }
  
          // only permit invocation on pins set to DIGITAL_OUTPUT modes
          if (pinModeCache[pin.getAddress()] != PinMode.DIGITAL_OUTPUT) {
              throw new InvalidPinModeException(pin, "Invalid pin mode on pin [" + pin.getName() + "]; cannot setState() when pin mode is [" + pinModeCache[pin.getAddress()].getName() + "]");
          }
  
          // control GPIO pin
          com.pi4j.wiringpi.Gpio.digitalWrite(pin.getAddress(), state.getValue());
  
          // for digital output pins, we will echo the event feedback
          dispatchPinDigitalStateChangeEvent(pin, state);
  
          // for the Raspberry pi, we will not cache pin state since we never use the cache to get state.
      }