![]() |
PDL for FM0+
Version1.0
Peripheral Driverl Library for FM0+
|
Data Structures | |
struct | stc_rtc_freq_corr |
frequency correction configuration More... | |
struct | stc_rtc_timer |
Real Time Clock timer configuration structure. More... | |
struct | stc_rtc_int_sel |
Interrupt configuration structure. More... | |
struct | stc_rtc_int_cb |
RTC callback functions structure. More... | |
struct | stc_rtc_time |
Real Time Clock Date and Time structure. More... | |
struct | stc_rtc_alarm |
Real Time Clock Alarm structure. More... | |
struct | stc_rtc_config |
Real Time Clock configuration. More... | |
struct | stc_rtc_intern_data |
Datatype for holding internal data needed for RTC. More... | |
Defines | |
#define | RTC_TIMEOUT (SystemCoreClock/10) |
#define | RTC_ERR (-1) |
#define | DecToBcd(x) ((((x)/10)<<4) + ((x)%10)) |
#define | BcdToDec(x) ((((x)>>4)*10) + ((x)&0x0F)) |
#define | RTC_MAX_FREQ_CORR_VALUE (0x3FFu) |
Rtccallback function prototypes. | |
#define | RTC_MAX_FREQ_CORR_CYCLE_SET_VALUE (0x3Fu) |
Maximum Frequency Correction Cycle Setting Value. | |
#define | RTC_MAX_TIMER_SET_VALUE (0x20000) |
Maxmimum Timer Setting Value [unit: second]. | |
Typedefs | |
typedef enum en_rtc_clk_sel | en_rtc_clk_sel_t |
Real Time Clock clock selection. | |
typedef enum en_rtc_rtcco_sel | en_rtc_rtcco_sel_t |
RTCCO output selection. | |
typedef struct stc_rtc_freq_corr | stc_rtc_freq_corr_t |
frequency correction configuration | |
typedef enum en_rtc_func | en_rtc_func_t |
Real Time Clock functions. | |
typedef enum en_rtc_day_of_week | en_rtc_day_of_week_t |
Day of week name definitions. | |
typedef enum en_rtc_month | en_rtc_month_t |
Month name definitions (not used in driver - to be used by user appliciation) | |
typedef enum en_rtc_time_mode | en_rtc_time_mode_t |
Real Time Clock timer mode selection. | |
typedef struct stc_rtc_timer | stc_rtc_timer_t |
Real Time Clock timer configuration structure. | |
typedef enum en_rtc_div_ratio | en_rtc_div_ratio_t |
Rtc Divider Ratio Setting. | |
typedef struct stc_rtc_int_sel | stc_rtc_int_sel_t |
Interrupt configuration structure. | |
typedef struct stc_rtc_int_cb | stc_rtc_int_cb_t |
RTC callback functions structure. | |
typedef struct stc_rtc_time | stc_rtc_time_t |
Real Time Clock Date and Time structure. | |
typedef enum en_rtc_status | en_rtc_status_t |
Real Time Clock status types. | |
typedef struct stc_rtc_alarm | stc_rtc_alarm_t |
Real Time Clock Alarm structure. | |
typedef struct stc_rtc_config | stc_rtc_config_t |
Real Time Clock configuration. | |
typedef struct stc_rtc_intern_data | stc_rtc_intern_data_t |
Datatype for holding internal data needed for RTC. | |
Enumerations | |
enum | en_rtc_clk_sel { RtcUseSubClk = 0u, RtcuseMainClk = 1u } |
Real Time Clock clock selection. More... | |
enum | en_rtc_rtcco_sel { RtccoOutput2Hz = 0, RtccoOutput1Hz = 1 } |
RTCCO output selection. More... | |
enum | en_rtc_func { RtcCount = 0u, RtcTimer = 1u, RtcFreqCorr = 2u, RtcAlarmYearEn = 3u, RtcAlarmMonthEn = 4u, RtcAlarmDayEn = 5u, RtcAlarmHourEn = 6u, RtcAlarmMinEn = 7u } |
Real Time Clock functions. More... | |
enum | en_rtc_day_of_week { RtcSunday = 0, RtcMonday = 1, RtcTuesday = 2, RtcWednesday = 3, RtcThursday = 4, RtcFriday = 5, RtcSaturday = 6 } |
Day of week name definitions. More... | |
enum | en_rtc_month { RtcJanuary = 1, RtcFebuary = 2, RtcMarch = 3, RtcApril = 4, RtcMay = 5, RtcJune = 6, RtcJuly = 7, RtcAugust = 8, RtcSeptember = 9, RtcOctober = 10, RtcNovember = 11, RtcDecember = 12 } |
Month name definitions (not used in driver - to be used by user appliciation) More... | |
enum | en_rtc_time_mode { RtcTimerOneshot = 0u, RtcTimerPeriod = 1u } |
Real Time Clock timer mode selection. More... | |
enum | en_rtc_div_ratio { RtcDivRatio1 = 0x00u, RtcDivRatio2 = 0x01u, RtcDivRatio4 = 0x02u, RtcDivRatio8 = 0x03u, RtcDivRatio16 = 0x04u, RtcDivRatio32 = 0x05u, RtcDivRatio64 = 0x06u, RtcDivRatio128 = 0x07u, RtcDivRatio256 = 0x08u, RtcDivRatio512 = 0x09u, RtcDivRatio1024 = 0x0Au, RtcDivRatio2048 = 0x0Bu, RtcDivRatio4096 = 0x0Cu, RtcDivRatio8192 = 0x0Du, RtcDivRatio16384 = 0x0Eu, RtcDivRatio32768 = 0x0Fu } |
Rtc Divider Ratio Setting. More... | |
enum | en_rtc_status { RtcRewriteError = 0u, RtcAlarmElementMatch = 1u, RtcTimerUnderFlow = 2u, RtcOneHourFlag = 3u, RtcOneMiniteFlag = 4u, RtcOneSecondFlag = 5u, RtcHalfSecondFlag = 6u, RtcRunStatus = 7u, RtcTimerStatus = 8u } |
Real Time Clock status types. More... | |
Functions | |
static void | RtcToTm (stc_rtc_time_t *pstcRtcTime, struct tm *pstcTime) |
Convert RTC time structure to time.h tm structure. | |
static void | RtcDisableNvic (void) |
Disable RTC NVIC and save original value. | |
static void | RtcRestoreNvic (void) |
Restore RTC NVIC. | |
static void | RtcInitIrq (void) |
Device dependent initialization of interrupts according CMSIS with level defined in pdl_user.h. | |
static void | RtcDeInitIrq (void) |
Device dependent de-initialization of interrupts according CMSIS with level defined in pdl.h. | |
void | Rtc_IrqHandler (void) |
RTC interrupt service routine. | |
en_result_t | Rtc_EnableInt (stc_rtc_int_sel_t *pstcIntSel, stc_rtc_int_cb_t *pstcIntCb) |
Enable RTC (and Timer) Interrupts. | |
en_result_t | Rtc_DisableInt (stc_rtc_int_sel_t *pstcIntSel) |
Disable RTC (and Timer) Interrupts. | |
en_result_t | Rtc_Init (stc_rtc_config_t *pstcConfig) |
Initialize RTC. | |
en_result_t | Rtc_DeInit (void) |
De-Initialize RTC. | |
en_result_t | Rtc_EnableFunc (en_rtc_func_t enFunc) |
Enable functions of RTC. | |
en_result_t | Rtc_DisableFunc (en_rtc_func_t enFunc) |
Disable functions of RTC. | |
boolean_t | Rtc_GetStatus (en_rtc_status_t enStatus) |
Get status of RTC according to status type. | |
en_result_t | Rtc_ClrStatus (en_rtc_status_t enStatus) |
Clear status of RTC according to status type. | |
void | Rtc_Reset (void) |
Reset RTC. | |
en_result_t | Rtc_SetDateTime (stc_rtc_time_t *pstcTimeDate, boolean_t bContinue) |
Set time and date after RTC is running. | |
en_result_t | Rtc_ReadDateTime (stc_rtc_time_t *pstcTimeDate) |
Read RTC time and date. | |
en_result_t | Rtc_SetAlarmDateTime (stc_rtc_alarm_t *pstcAlarm) |
Set time and date information of Alarm. | |
en_result_t | Rtc_GetAlarmDateTime (stc_rtc_alarm_t *pstcAlarm) |
Get time and date information of Alarm. | |
en_result_t | Rtc_SetDayOfWeek (stc_rtc_time_t *pstcRtcTime) |
Set Day of the Week. | |
en_result_t | Rtc_SetTimerCycle (uint32_t u32TimerCycle) |
Set cycle of RTC timer. | |
en_result_t | Rtc_SetFreqCorrValue (uint16_t u16Value) |
Set calibration value of RTC frequency correction module. | |
Variables | |
static stc_rtc_intern_data_t | stcRtcInternData |
static uint32_t | u32NvicData |
Provided RTC module functions:
Rtc_Init() initializes an RTC instance according the configuration of the structure type stc_rtc_config_t. Rtc_DeInit() de-initializes an RTC instance.
Rtc_EnableInt() enables RTC interrupt sources selected by parameter Rtc_EnableInt::stc_rtc_int_sel_t and sets the according interrupt callback functions in the internal data structure. Rtc_DisableInt() disables the RTC interrupt sources selected.
Rtc_IrqHandler() is RTC IRQ handler function, which is called in interrupts.c.
Rtc_EnableFunc() enables RTC function selected by the parameter Rtc_EnableFunc::enFunc and Rtc_DisableFunc() disables RTC function selected.
Rtc_Reset() resets RTC peripheral as well as RTC registers.
Rtc_GetStatus() gets the status selected by Rtc_GetStatus::enStatus and Rtc_ClrStatus() clears the RTC status selected, some status can only be cleared by hardware automatically.
Rtc_SetDateTime() can change the time and date of RTC and Rtc_GetDateTime() gets current time and date.
Rtc_SetAlarmDateTime() can change the alarm time and date, and Rtc_GetAlarmDateTime() gets the alarm time and date.
Rtc_SetTimerCycle() sets the cycle of RTC timer, note that the unit of cycle is second.
Rtc_SetFreqCorrValue() sets the frequency correction value of RTC.
Rtc_SetDayOfWeek() sets the day of week based on time structure supplied.
#define BcdToDec | ( | x | ) | ((((x)>>4)*10) + ((x)&0x0F)) |
Definition at line 77 of file rtc.c.
Referenced by Rtc_GetAlarmDateTime(), and Rtc_ReadDateTime().
#define DecToBcd | ( | x | ) | ((((x)/10)<<4) + ((x)%10)) |
Definition at line 75 of file rtc.c.
Referenced by Rtc_Init(), Rtc_IrqHandler(), Rtc_SetAlarmDateTime(), and Rtc_SetDateTime().
#define RTC_ERR (-1) |
Definition at line 73 of file rtc.c.
Referenced by Rtc_SetDayOfWeek().
#define RTC_MAX_FREQ_CORR_CYCLE_SET_VALUE (0x3Fu) |
Maximum Frequency Correction Cycle Setting Value.
Definition at line 149 of file rtc.h.
Referenced by Rtc_Init().
#define RTC_MAX_FREQ_CORR_VALUE (0x3FFu) |
Rtccallback function prototypes.
Maximum Frequency Correction Value
Definition at line 143 of file rtc.h.
Referenced by Rtc_Init(), and Rtc_SetFreqCorrValue().
#define RTC_MAX_TIMER_SET_VALUE (0x20000) |
Maxmimum Timer Setting Value [unit: second].
Definition at line 155 of file rtc.h.
Referenced by Rtc_Init(), and Rtc_SetTimerCycle().
#define RTC_TIMEOUT (SystemCoreClock/10) |
Definition at line 71 of file rtc.c.
Referenced by Rtc_Init(), Rtc_ReadDateTime(), and Rtc_SetDateTime().
typedef enum en_rtc_clk_sel en_rtc_clk_sel_t |
Real Time Clock clock selection.
typedef enum en_rtc_day_of_week en_rtc_day_of_week_t |
Day of week name definitions.
typedef enum en_rtc_div_ratio en_rtc_div_ratio_t |
Rtc Divider Ratio Setting.
Divider Ration Settings for WTC. The enumarted values do not correspond to the bit patterns of WTDIV!
typedef enum en_rtc_func en_rtc_func_t |
Real Time Clock functions.
typedef enum en_rtc_month en_rtc_month_t |
Month name definitions (not used in driver - to be used by user appliciation)
typedef enum en_rtc_rtcco_sel en_rtc_rtcco_sel_t |
RTCCO output selection.
If user needs to output RTCCO, RTCCO pin function should also be enabled in in GPIO macro.
typedef enum en_rtc_status en_rtc_status_t |
Real Time Clock status types.
typedef enum en_rtc_time_mode en_rtc_time_mode_t |
Real Time Clock timer mode selection.
typedef struct stc_rtc_alarm stc_rtc_alarm_t |
Real Time Clock Alarm structure.
typedef struct stc_rtc_config stc_rtc_config_t |
Real Time Clock configuration.
The RTC configuration settings
typedef struct stc_rtc_freq_corr stc_rtc_freq_corr_t |
frequency correction configuration
typedef struct stc_rtc_int_cb stc_rtc_int_cb_t |
RTC callback functions structure.
typedef struct stc_rtc_int_sel stc_rtc_int_sel_t |
Interrupt configuration structure.
typedef struct stc_rtc_intern_data stc_rtc_intern_data_t |
Datatype for holding internal data needed for RTC.
typedef struct stc_rtc_time stc_rtc_time_t |
Real Time Clock Date and Time structure.
typedef struct stc_rtc_timer stc_rtc_timer_t |
Real Time Clock timer configuration structure.
enum en_rtc_clk_sel |
enum en_rtc_day_of_week |
enum en_rtc_div_ratio |
Rtc Divider Ratio Setting.
Divider Ration Settings for WTC. The enumarted values do not correspond to the bit patterns of WTDIV!
enum en_rtc_func |
Real Time Clock functions.
enum en_rtc_month |
Month name definitions (not used in driver - to be used by user appliciation)
enum en_rtc_rtcco_sel |
enum en_rtc_status |
Real Time Clock status types.
enum en_rtc_time_mode |
en_result_t Rtc_ClrStatus | ( | en_rtc_status_t | enStatus | ) |
Clear status of RTC according to status type.
[in] | enStatus | RTC status type
|
Ok | RTC status is cleared normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 918 of file rtc.c.
References ErrorInvalidParameter, Ok, RtcAlarmElementMatch, RtcHalfSecondFlag, RtcOneHourFlag, RtcOneMiniteFlag, RtcOneSecondFlag, RtcRewriteError, RtcRunStatus, RtcTimerStatus, and RtcTimerUnderFlow.
en_result_t Rtc_DeInit | ( | void | ) |
en_result_t Rtc_DisableFunc | ( | en_rtc_func_t | enFunc | ) |
Disable functions of RTC.
These functions includes RTC counting, Timer, Alarm compariron and frequency correction module.
enFunc | Function types
|
Ok | RTC functions disabled normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 783 of file rtc.c.
References ErrorInvalidParameter, Ok, RtcAlarmDayEn, RtcAlarmHourEn, RtcAlarmMinEn, RtcAlarmMonthEn, RtcAlarmYearEn, RtcCount, RtcFreqCorr, and RtcTimer.
en_result_t Rtc_DisableInt | ( | stc_rtc_int_sel_t * | pstcIntSel | ) |
Disable RTC (and Timer) Interrupts.
[in] | pstcIntSel | Pointer to RTC interrupt selection structure |
Ok | Interrupts are disabled |
ErrorInvalidParameter | pstcIntSel == NULL |
Definition at line 401 of file rtc.c.
References stc_rtc_int_sel::AlarmInt, ErrorInvalidParameter, FALSE, stc_rtc_int_sel::HalfSecondInt, Ok, stc_rtc_int_sel::OneHourInt, stc_rtc_int_sel::OneMinuteInt, stc_rtc_int_sel::OneSecondInt, RtcDeInitIrq(), stc_rtc_int_sel::TimeRewriteErrorInt, stc_rtc_int_sel::TimerInt, and TRUE.
en_result_t Rtc_EnableFunc | ( | en_rtc_func_t | enFunc | ) |
Enable functions of RTC.
These functions includes RTC counting, Timer, Alarm compariron and frequency correction module.
enFunc | Function types
|
Ok | RTC functions enabled normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 726 of file rtc.c.
References ErrorInvalidParameter, Ok, RtcAlarmDayEn, RtcAlarmHourEn, RtcAlarmMinEn, RtcAlarmMonthEn, RtcAlarmYearEn, RtcCount, RtcFreqCorr, and RtcTimer.
en_result_t Rtc_EnableInt | ( | stc_rtc_int_sel_t * | pstcIntSel, |
stc_rtc_int_cb_t * | pstcIntCb | ||
) |
Enable RTC (and Timer) Interrupts.
[in] | pstcIntSel | Pointer to RTC interrupt selection structure |
[in] | pstcIntCb | Pointer to RTC interrupt callback functions structure |
Ok | Interrupts are enabled |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 325 of file rtc.c.
References stc_rtc_int_sel::AlarmInt, ErrorInvalidParameter, stc_rtc_int_sel::HalfSecondInt, Ok, stc_rtc_int_sel::OneHourInt, stc_rtc_int_sel::OneMinuteInt, stc_rtc_int_sel::OneSecondInt, stc_rtc_int_cb::pfnAlarmCallback, stc_rtc_intern_data::pfnAlarmCallback, stc_rtc_int_cb::pfnHalfSecondCallback, stc_rtc_intern_data::pfnHalfSecondCallback, stc_rtc_int_cb::pfnOneHourCallback, stc_rtc_intern_data::pfnOneHourCallback, stc_rtc_int_cb::pfnOneMinuteCallback, stc_rtc_intern_data::pfnOneMinuteCallback, stc_rtc_int_cb::pfnOneSecondCallback, stc_rtc_intern_data::pfnOneSecondCallback, stc_rtc_int_cb::pfnTimerCallback, stc_rtc_intern_data::pfnTimerCallback, stc_rtc_int_cb::pfnTimeWrtErrCallback, stc_rtc_intern_data::pfnTimeWrtErrCallback, RtcInitIrq(), stc_rtc_int_sel::TimeRewriteErrorInt, stc_rtc_int_sel::TimerInt, and TRUE.
en_result_t Rtc_GetAlarmDateTime | ( | stc_rtc_alarm_t * | pstcAlarm | ) |
Get time and date information of Alarm.
[in] | pstcAlarm | Time and date structure |
Ok | RTC Alarm time and date is read normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1194 of file rtc.c.
References BcdToDec, ErrorInvalidParameter, Ok, stc_rtc_alarm::u16Year, stc_rtc_alarm::u8Day, stc_rtc_alarm::u8Hour, stc_rtc_alarm::u8Minute, and stc_rtc_alarm::u8Month.
boolean_t Rtc_GetStatus | ( | en_rtc_status_t | enStatus | ) |
Get status of RTC according to status type.
[in] | enStatus | RTC status type
|
FALSE | If one of following conditions are met:
|
TRUE | If one of following conditions are met:
|
Definition at line 855 of file rtc.c.
References FALSE, RtcAlarmElementMatch, RtcHalfSecondFlag, RtcOneHourFlag, RtcOneMiniteFlag, RtcOneSecondFlag, RtcRewriteError, RtcRunStatus, RtcTimerStatus, RtcTimerUnderFlow, and TRUE.
en_result_t Rtc_Init | ( | stc_rtc_config_t * | pstcConfig | ) |
Initialize RTC.
This function initializes the RTC module
[in] | pstcConfig | Pointer to RTC configuration structure |
Ok | RTC initialization completed normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 488 of file rtc.c.
References __CLKMO, __CLKSO, stc_rtc_config::bEnSuboutDivider, stc_rtc_config::bInitAlarm, stc_rtc_config::bInitFreqCorr, stc_rtc_config::bInitTimeDate, stc_rtc_config::bInitTimer, DecToBcd, stc_rtc_config::enClkSel, stc_rtc_config::enDividerRatio, stc_rtc_timer::enMode, stc_rtc_config::enRtccoSel, ErrorInvalidParameter, ErrorTimeout, Ok, RTC_MAX_FREQ_CORR_CYCLE_SET_VALUE, RTC_MAX_FREQ_CORR_VALUE, RTC_MAX_TIMER_SET_VALUE, RTC_TIMEOUT, RtccoOutput2Hz, RtcDivRatio1, RtcDivRatio1024, RtcDivRatio128, RtcDivRatio16, RtcDivRatio16384, RtcDivRatio2, RtcDivRatio2048, RtcDivRatio256, RtcDivRatio32, RtcDivRatio32768, RtcDivRatio4, RtcDivRatio4096, RtcDivRatio512, RtcDivRatio64, RtcDivRatio8, RtcDivRatio8192, RtcTimerOneshot, RtcTimerPeriod, RtcuseMainClk, RtcUseSubClk, stc_rtc_config::stcAlarm, stc_rtc_config::stcFreqCorrConfig, stc_rtc_config::stcTimeDate, stc_rtc_config::stcTimer, TRUE, stc_rtc_freq_corr::u16FreqCorrCycle, stc_rtc_freq_corr::u16FreqCorrValue, stc_rtc_time::u16Year, stc_rtc_alarm::u16Year, stc_rtc_timer::u32TimerCycle, stc_rtc_time::u8Day, stc_rtc_alarm::u8Day, stc_rtc_time::u8DayOfWeek, stc_rtc_time::u8Hour, stc_rtc_alarm::u8Hour, stc_rtc_time::u8Minute, stc_rtc_alarm::u8Minute, stc_rtc_time::u8Month, stc_rtc_alarm::u8Month, and stc_rtc_time::u8Second.
void Rtc_IrqHandler | ( | void | ) |
RTC interrupt service routine.
Definition at line 184 of file rtc.c.
References DecToBcd, FALSE, stc_rtc_intern_data::pfnAlarmCallback, stc_rtc_intern_data::pfnHalfSecondCallback, stc_rtc_intern_data::pfnOneHourCallback, stc_rtc_intern_data::pfnOneMinuteCallback, stc_rtc_intern_data::pfnOneSecondCallback, stc_rtc_intern_data::pfnTimerCallback, stc_rtc_intern_data::pfnTimeWrtErrCallback, Rtc_ReadDateTime(), TRUE, stc_rtc_time::u16Year, stc_rtc_time::u8Day, stc_rtc_time::u8Hour, stc_rtc_time::u8Minute, and stc_rtc_time::u8Month.
Referenced by TIM_IRQHandler().
en_result_t Rtc_ReadDateTime | ( | stc_rtc_time_t * | pstcTimeDate | ) |
Read RTC time and date.
[in] | pstcTimeDate | Time and date structure |
Ok | RTC time and date is read normally |
ErrorInvalidParameter | If one of following conditions are met:
|
ErrorTimeout | Time and date read timeout |
Definition at line 1096 of file rtc.c.
References BcdToDec, ErrorInvalidParameter, ErrorTimeout, Ok, RTC_TIMEOUT, RtcDisableNvic(), RtcRestoreNvic(), stc_rtc_time::u16Year, stc_rtc_time::u8Day, stc_rtc_time::u8DayOfWeek, stc_rtc_time::u8Hour, stc_rtc_time::u8Minute, stc_rtc_time::u8Month, and stc_rtc_time::u8Second.
Referenced by Rtc_IrqHandler().
en_result_t Rtc_SetAlarmDateTime | ( | stc_rtc_alarm_t * | pstcAlarm | ) |
Set time and date information of Alarm.
[in] | pstcAlarm | Time and date structure |
Ok | RTC Alarm time and date is set normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1168 of file rtc.c.
References DecToBcd, ErrorInvalidParameter, Ok, stc_rtc_alarm::u16Year, stc_rtc_alarm::u8Day, stc_rtc_alarm::u8Hour, stc_rtc_alarm::u8Minute, and stc_rtc_alarm::u8Month.
en_result_t Rtc_SetDateTime | ( | stc_rtc_time_t * | pstcTimeDate, |
boolean_t | bContinue | ||
) |
Set time and date after RTC is running.
[in] | pstcTimeDate | Time and date structure |
[in] | bContinue | RTC counting continues or not
|
Ok | RTC time and date is set normally |
ErrorInvalidParameter | If one of following conditions are met:
|
ErrorInvalidMode | RTC is running |
ErrorTimeout | RTC rewrite timeout |
Definition at line 978 of file rtc.c.
References DecToBcd, ErrorInvalidMode, ErrorInvalidParameter, ErrorTimeout, Ok, RTC_TIMEOUT, RtcDisableNvic(), RtcRestoreNvic(), TRUE, stc_rtc_time::u16Year, stc_rtc_time::u8Day, stc_rtc_time::u8DayOfWeek, stc_rtc_time::u8Hour, stc_rtc_time::u8Minute, stc_rtc_time::u8Month, and stc_rtc_time::u8Second.
en_result_t Rtc_SetDayOfWeek | ( | stc_rtc_time_t * | pstcRtcTime | ) |
Set Day of the Week.
This function calculates the day of the week from YY-MM-DD in the Time structure. It uses mktime of time.h library.
[in,out] | pstcRtcTime | RTC Time structure |
Ok | Internal data has been setup |
ErrorInvalidParameter | pstcRtcTime == NULL or mktime failed |
Definition at line 1230 of file rtc.c.
References ErrorInvalidParameter, Ok, RTC_ERR, RtcToTm(), and stc_rtc_time::u8DayOfWeek.
en_result_t Rtc_SetFreqCorrValue | ( | uint16_t | u16Value | ) |
Set calibration value of RTC frequency correction module.
[in] | u16Value | Calibration value |
Ok | RTC timer cycle is set normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1294 of file rtc.c.
References ErrorInvalidParameter, Ok, and RTC_MAX_FREQ_CORR_VALUE.
en_result_t Rtc_SetTimerCycle | ( | uint32_t | u32TimerCycle | ) |
Set cycle of RTC timer.
[in] | u32TimerCycle | Timer cycle |
Ok | RTC timer cycle is set normally |
ErrorInvalidParameter | If one of following conditions are met:
|
Definition at line 1272 of file rtc.c.
References ErrorInvalidParameter, Ok, and RTC_MAX_TIMER_SET_VALUE.
static void RtcDeInitIrq | ( | void | ) | [static] |
Device dependent de-initialization of interrupts according CMSIS with level defined in pdl.h.
Definition at line 173 of file rtc.c.
References PDL_DEFAULT_INTERRUPT_LEVEL.
Referenced by Rtc_DisableInt().
static void RtcDisableNvic | ( | void | ) | [static] |
Disable RTC NVIC and save original value.
Definition at line 116 of file rtc.c.
References u32NvicData.
Referenced by Rtc_ReadDateTime(), and Rtc_SetDateTime().
static void RtcInitIrq | ( | void | ) | [static] |
Device dependent initialization of interrupts according CMSIS with level defined in pdl_user.h.
Definition at line 159 of file rtc.c.
References PDL_IRQ_LEVEL_CLK_WC_RTC.
Referenced by Rtc_EnableInt().
static void RtcRestoreNvic | ( | void | ) | [static] |
Restore RTC NVIC.
Definition at line 126 of file rtc.c.
References u32NvicData.
Referenced by Rtc_ReadDateTime(), and Rtc_SetDateTime().
static void RtcToTm | ( | stc_rtc_time_t * | pstcRtcTime, |
struct tm * | pstcTime | ||
) | [static] |
Convert RTC time structure to time.h tm structure.
[in] | pstcRtcTime | RTC Time structure |
[out] | pstcTime | tm Time structure |
Definition at line 140 of file rtc.c.
References stc_rtc_time::u16Year, stc_rtc_time::u8Day, stc_rtc_time::u8Hour, stc_rtc_time::u8Minute, stc_rtc_time::u8Month, and stc_rtc_time::u8Second.
Referenced by Rtc_SetDayOfWeek().
stc_rtc_intern_data_t stcRtcInternData [static] |
uint32_t u32NvicData [static] |
Definition at line 106 of file rtc.c.
Referenced by RtcDisableNvic(), and RtcRestoreNvic().