AnsweredAssumed Answered

Discovering LPTMR frequency

Question asked by Robert Poor on Mar 24, 2017
Latest reply on Apr 12, 2017 by Robert Poor

On my KL27Z, I have configured LPTMR0 to source its clock from kLPTMR_PrescalerClock_0 (which is MCGIRCLK, right?) like this:

  lptmr_config_t lptmrConfig;



  lptmrConfig.prescalerClockSource = kLPTMR_PrescalerClock_0;  // MCGIRCLK?

  LPTMR_Init(LPTMR0, &lptmrConfig);

What is the correct way to find its frequency?  I could do something like this:

uint64_t clock_freq_in_hz = CLOCK_GetFreq(kCLOCK_McgInternalRefClk);

... but I'm not sure that kCLOCK_McgInternalRefClk is the right constant (though empirically it appears to be correct).  Is there a more dependable way to get the LPTMR's clock frequency, perhaps one that uses the actual state of its configuration registers?