/* Configures a Timer Counter to operate in the given mode. Timer is stopped after configuration and must be restarted with TC_Start(). to obtain the target frequency.  */
void TC_Configure(AT91S_TC *pTc, unsigned int mode)
/* Configures a Timer Counter to operate in the given mode. Timer is stopped after configuration and must be restarted with TC_Start(). to obtain the target frequency.  */
void TC_Configure(AT91S_TC *pTc, unsigned int mode)
{
    pTc->TC_CCR = AT91C_TC_CLKDIS;
    pTc->TC_IDR = 0xFFFFFFFF;
    pTc->TC_SR;
    pTc->TC_CMR = mode;
}