cpu: added pwm driver for the stm32f4

This PR is base on #1466.