/* Setup the external reset length. The length is asserted during a time of pow(2, powl+1) Slow Clock(32KHz). The duration is between 60us and 2s.  */
void RSTC_SetExtResetLength(unsigned char powl)
/* Setup the external reset length. The length is asserted during a time of pow(2, powl+1) Slow Clock(32KHz). The duration is between 60us and 2s.  */
void RSTC_SetExtResetLength(unsigned char powl)
{
    unsigned int rmr = AT91C_BASE_RSTC->RSTC_RMR;
    rmr &= ~(AT91C_RSTC_KEY | AT91C_RSTC_ERSTL);
    rmr |=  (powl << 8) & AT91C_RSTC_ERSTL;
    AT91C_BASE_RSTC->RSTC_RMR = rmr | RSTC_KEY_PASSWORD;
}