只是简单的使用这个函数配置么?
int32_t RTC_Initialize(RTC_ConfigType *RTCConfig)
数据处理是不是要自己做函数实现
- **
- * RTC_Initialize
- *
- * @param[in] RTCConfig: pointer to a RTC_ConfigType structure contains RTC configuration information.
- * [url=home.php?mod=space&uid=266161]@return[/url] 0: success, other: error value
- *
- * [url=home.php?mod=space&uid=247401]@brief[/url] Initialize the RTC module according to the RTC_ConfigType structure
- */
- int32_t RTC_Initialize(RTC_ConfigType *RTCConfig)
- {
- CKGEN_Enable(CLK_RTC, 1);
- CKGEN_SoftReset(SRST_RTC, 1);
- RTC_SetRTCO(RTCConfig->RTCOut);
- RTC_SetModulo(RTCConfig->moduloValue);
- if (RTCConfig->interruptEn)
- {
- NVIC_EnableIRQ(RTC_IRQn);
- RTC_EnableRTIE();
- }
- else
- {
- NVIC_DisableIRQ(RTC_IRQn);
- RTC_DisableRTIE();
- }
- if (RTCConfig->prescalerInterruptEn)
- {
- RTC_EnableRPIE();
- }
- else
- {
- RTC_DisableRPIE();
- }
- if (RTC_GetRTIF())
- {
- RTC_ClrRTIF();
- }
- if (RTC_GetRPIF())
- {
- RTC_ClrRPIF();
- }
- RTC_SetClkSource(RTCConfig->clockSource);
- RTC_SetPres(RTCConfig->prescalerValue);
- return 0;
- }
|