TC_FindMckDivisor
Default mainpageat91libperipheralstcTC_FindMckDivisor
Description Source Call Graph
TC_FindMckDivisor
Finds the best MCK divisor given the timer frequency and MCK.
 
Syntax / parameters
unsigned char TC_FindMckDivisor (unsigned int freq, unsigned int mck, unsigned int *div, unsigned int *tcclks)

Name Type Default Description
freq unsigned int
  Desired timer frequency.
mck unsigned int
  Master clock frequency.
div unsigned int *
  Divisor value.
tcclks unsigned int *
  TCCLKS field value for divisor.
 
Return value unsigned char
  1 if a proper divisor has been found; otherwise 0.
Description
Finds the best MCK divisor given the timer frequency and MCK.
The result is guaranteed to satisfy the following equation:

      (MCK / (DIV * 65536)) <= freq <= (MCK / DIV)
    
with DIV being the highest possible value.
 
Source
The documentation for this Member was generated from the following files:
  • tc.c