/*!
 * @file        user_rtc_config.c
 *
 * @brief       RTC configurations
 *
 * @version     V1.0.0
 *
 * @date        2026-03-25
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the License.
 */

/* Includes */
#include "user_rtc_config.h"

/** @addtogroup Examples
  @{
  */

/** @addtogroup RTC_Examples
  @{
  */

/** @addtogroup RTC
  @{
*/

/** @defgroup RTC_Variables
  @{
*/


/* Configure RTC */
Rtc_ConfigType rtcConfig = {
    .format = RTC_HOURFORMAT_24,
    /* The frequency division value can be obtained by referring to the TMR_InputCapture
       example to obtain the LSI frequency calculation */
    /* frequency is LSICLK/(APSC+1)/(SPSC+1) */
    /* 1Hz = 16MHz/32/8192/61 */
    .SynchPrediv = 8192-1,
    .AsynchPrediv = 61-1,
};

/* Config date */
Rtc_DateType dateConfig = {
    .year =  20,
    .month = 8,
    .date =  8,
    .weekday = 6,
};

/* Config Time */
Rtc_TimeType timeConfig = {
    .H12 = 12,
    .hours = 23,
    .minutes = 59,
    .seconds = 30,
};


/* Config EINT */
Eint_ConfigType eintConfig = {
    .line = (uint32_t)EINT_LINE17,
    .lineCmd = ENABLE,
    .mode = EINT_MODE_INTERRUPT,
    /* Must be RISING or ALL */
    .trigger = EINT_TRIGGER_RISING,
};

/* Config Alarm */
Rtc_AlarmType alarmConfig = {
    .time.hours = 0,
    .time.minutes = 0,
    .time.seconds = 0,
    .time.H12 = (uint8_t)RTC_H12_AM,
    .AlarmDateWeekDay = 1,
    .AlarmDateWeekDaySel = RTC_WEEKDAY_SEL_DATE,
    .AlarmMask = 0x80808080U,
};


/**@} end of group RTC_Variables */
/**@} end of group RTC */
/**@} end of group RTC_Examples */
/**@} end of group Examples */
