/** * 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. * \param powl Power length defined. */ void RSTC_SetExtResetLength(uint8_t powl) { Rstc *pHw = RSTC; uint32_t mr = pHw->RSTC_MR; mr &= ~(RSTC_MR_KEY_Msk | RSTC_MR_ERSTL_Msk); mr |= RSTC_MR_ERSTL(powl); pHw->RSTC_MR = mr | RSTC_KEY_PASSWORD; }
/** * \brief Set external reset length. * * \param p_rstc Pointer to an RSTC instance. * \param ul_length The length of external reset. */ void rstc_set_external_reset(Rstc *p_rstc, const uint32_t ul_length) { uint32_t mode = p_rstc->RSTC_MR; mode &= ~(RSTC_MR_ERSTL_Msk | RSTC_MR_KEY_Msk); mode |= (RSTC_MR_ERSTL(ul_length) | RSTC_KEY); p_rstc->RSTC_MR = mode; }