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. |
(MCK / (DIV * 65536)) <= freq <= (MCK / DIV)with DIV being the highest possible value.