/* Enable/Disable the detection of a low level on the pin NRST as User Reset  */
void RSTC_SetUserResetEnable(AT91PS_RSTC rstc, unsigned char enable)
/* Enable/Disable the detection of a low level on the pin NRST as User Reset  */
void RSTC_SetUserResetEnable(AT91PS_RSTC rstc, unsigned char enable)
{
    unsigned int rmr = READ_RSTC(rstc, RSTC_RMR) & (~AT91C_RSTC_KEY);
    if (enable) {
        rmr |=  AT91C_RSTC_URSTEN;
    }
    else {
        rmr &= ~AT91C_RSTC_URSTEN;
    }
    WRITE_RSTC(rstc, RSTC_RMR, rmr | RSTC_KEY_PASSWORD);
}