# Fourier series of an arbitrary piecewise periodic function

Take a switching function as an example:
$$u (t) = begin {cases} 1, & text { 0
How can I get the Fourier series in Mathematica?
Is there a way to obtain Fourier series of arbitrary periodic functions in pieces?