/** * @brief RTC Tamper Configuration. * @param None * @retval None */ void Tamper_Init(void) { RTC_TamperFilterConfig((RTC_TamperFilter_TypeDef)RTC_TampFilter[TampFilterIndex]); RTC_TamperSamplingFreqConfig(RTC_TamperSamplingFreq_RTCCLK_Div32768); RTC_TamperPinsPrechargeDuration(RTC_TamperPrechargeDuration_None); RTC_TamperLevelConfig(RTC_Tamper_1, RTC_TamperLevel_Low ); RTC_TamperCmd(RTC_Tamper_1, ENABLE); RTC_ITConfig(RTC_IT_TAMP, ENABLE); }
/** * @brief RTC Tamper Configuration. * @param None * @retval None */ void Tamper_Init(void) { /* Tamper detection after time < 2 sample and time > 1 sample*/ RTC_TamperFilterConfig(RTC_TamperFilter_2Sample); /* configure 1 Sample = RTCCLK/32768 = 1s */ RTC_TamperSamplingFreqConfig(RTC_TamperSamplingFreq_RTCCLK_Div32768); /* Tamper sensitivity is to Low level */ RTC_TamperLevelConfig(RTC_Tamper_1, RTC_TamperLevel_Low ); /* Enable Tamper 1*/ RTC_TamperCmd(RTC_Tamper_1, ENABLE); /* Enable Tamper Interrupt */ RTC_ITConfig(RTC_IT_TAMP, ENABLE); }