Generation of microseconds-duration square pulses in a passively mode-locked fiber laser