On the generation of the large-scale and turbulent magnetic fields in solar-type stars