/* Calculate timebase value in order to get a timebase providing at least 1us.  */
uint8_t ADC_TimebaseCalc(uint32_t hfperFreq)
/* Calculate timebase value in order to get a timebase providing at least 1us.  */
uint8_t ADC_TimebaseCalc(uint32_t hfperFreq)
{
  if (!hfperFreq)
  {
    hfperFreq = CMU_ClockFreqGet(cmuClock_HFPER);
    if (!hfperFreq)
    {
      hfperFreq = 1;
    }
  }
  hfperFreq += 999999;
  hfperFreq /= 1000000;
  return (uint8_t)(hfperFreq - 1);
}