/* Deinitializes the RTC registers to their default reset values.  */
uint8_t RTC_Config(RTC_Config_T *rtcConfig)
/* Deinitializes the RTC registers to their default reset values.  */
uint8_t RTC_Config(RTC_Config_T *rtcConfig)
{
    RTC_DisableWriteProtection();
    if (RTC_EnableInit() == ERROR)
    {
        RTC_EnableWriteProtection();
        return ERROR;
    }
    else
    {
        RTC->CTRL_B.TIMEFCFG  = (rtcConfig->format);
        RTC->PSC_B.SPSC = (rtcConfig->synchPrediv);
        RTC->PSC_B.APSC = (rtcConfig->asynchPrediv);
        RTC_DisableInit();
        RTC_EnableWriteProtection();
        return SUCCESS;
    }
}