code: @Override
      public void setPwm(Pin pin, int duration) {
          int offPosition = calculateOffPositionForPulseDuration(duration);
          setPwm(pin, 0, offPosition);
      }
docs: Set pulse duration in microseconds.<br>
  Make sure duration doesn't exceed period time(1'000'000/freq)!
  
  @param pin represents channel 0..15
  @param duration pulse duration in microseconds