Add mode management + manual mode

Henceforth the mode management work and the manual mode is ready.
But the PWM generation isn't operational.