/* return kStatus_Success: Success in setting the time and starting the RTC kStatus_InvalidArgument: Error because the datetime format is incorrect  */
status_t RTC_SetDatetime(RTC_Type *base, const rtc_datetime_t *datetime)
/* return kStatus_Success: Success in setting the time and starting the RTC kStatus_InvalidArgument: Error because the datetime format is incorrect  */
status_t RTC_SetDatetime(RTC_Type *base, const rtc_datetime_t *datetime)
{
    assert(datetime);
    if (!(RTC_CheckDatetimeFormat(datetime)))
    {
        return kStatus_InvalidArgument;
    }
    base->COUNT = RTC_ConvertDatetimeToSeconds(datetime);
    return kStatus_Success;
}