[stm32] timer_get_frequency helper function

Makes the setup of timers easier...

ADC not tested..