东亚 范 / Mbed 2 deprecated NucleoStandbyTest_WKUP

Dependencies:   WakeUp mbed

Fork of NucleoStandbyTest by Michael Walker

Committer:
MichaelW
Date:
Sat May 07 11:51:56 2016 +0000
Revision:
0:1ecaa40f74d0
Working Code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MichaelW 0:1ecaa40f74d0 1 /**
MichaelW 0:1ecaa40f74d0 2 * @brief Enable the RTC WakeUp Timer peripheral.
MichaelW 0:1ecaa40f74d0 3 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 4 * @retval None
MichaelW 0:1ecaa40f74d0 5 */
MichaelW 0:1ecaa40f74d0 6 #define __HAL_RTC_WAKEUPTIMER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= (RTC_CR_WUTE))
MichaelW 0:1ecaa40f74d0 7
MichaelW 0:1ecaa40f74d0 8 /**
MichaelW 0:1ecaa40f74d0 9 * @brief Disable the RTC WakeUp Timer peripheral.
MichaelW 0:1ecaa40f74d0 10 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 11 * @retval None
MichaelW 0:1ecaa40f74d0 12 */
MichaelW 0:1ecaa40f74d0 13 #define __HAL_RTC_WAKEUPTIMER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(RTC_CR_WUTE))
MichaelW 0:1ecaa40f74d0 14
MichaelW 0:1ecaa40f74d0 15 /**
MichaelW 0:1ecaa40f74d0 16 * @brief Enable the RTC WakeUpTimer interrupt.
MichaelW 0:1ecaa40f74d0 17 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 18 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be enabled.
MichaelW 0:1ecaa40f74d0 19 * This parameter can be:
MichaelW 0:1ecaa40f74d0 20 * @arg RTC_IT_WUT: WakeUpTimer interrupt
MichaelW 0:1ecaa40f74d0 21 * @retval None
MichaelW 0:1ecaa40f74d0 22 */
MichaelW 0:1ecaa40f74d0 23 #define __HAL_RTC_WAKEUPTIMER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR |= (__INTERRUPT__))
MichaelW 0:1ecaa40f74d0 24
MichaelW 0:1ecaa40f74d0 25 /**
MichaelW 0:1ecaa40f74d0 26 * @brief Disable the RTC WakeUpTimer interrupt.
MichaelW 0:1ecaa40f74d0 27 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 28 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt sources to be disabled.
MichaelW 0:1ecaa40f74d0 29 * This parameter can be:
MichaelW 0:1ecaa40f74d0 30 * @arg RTC_IT_WUT: WakeUpTimer interrupt
MichaelW 0:1ecaa40f74d0 31 * @retval None
MichaelW 0:1ecaa40f74d0 32 */
MichaelW 0:1ecaa40f74d0 33 #define __HAL_RTC_WAKEUPTIMER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CR &= ~(__INTERRUPT__))
MichaelW 0:1ecaa40f74d0 34
MichaelW 0:1ecaa40f74d0 35 /**
MichaelW 0:1ecaa40f74d0 36 * @brief Check whether the specified RTC WakeUpTimer interrupt has occurred or not.
MichaelW 0:1ecaa40f74d0 37 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 38 * @param __INTERRUPT__: specifies the RTC WakeUpTimer interrupt to check.
MichaelW 0:1ecaa40f74d0 39 * This parameter can be:
MichaelW 0:1ecaa40f74d0 40 * @arg RTC_IT_WUT: WakeUpTimer interrupt
MichaelW 0:1ecaa40f74d0 41 * @retval None
MichaelW 0:1ecaa40f74d0 42 */
MichaelW 0:1ecaa40f74d0 43 #define __HAL_RTC_WAKEUPTIMER_GET_IT(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->ISR) & ((__INTERRUPT__)>> 4)) != RESET) ? SET : RESET)
MichaelW 0:1ecaa40f74d0 44
MichaelW 0:1ecaa40f74d0 45 /**
MichaelW 0:1ecaa40f74d0 46 * @brief Check whether the specified RTC Wake Up timer interrupt has been enabled or not.
MichaelW 0:1ecaa40f74d0 47 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 48 * @param __INTERRUPT__: specifies the RTC Wake Up timer interrupt sources to check.
MichaelW 0:1ecaa40f74d0 49 * This parameter can be:
MichaelW 0:1ecaa40f74d0 50 * @arg RTC_IT_WUT: WakeUpTimer interrupt
MichaelW 0:1ecaa40f74d0 51 * @retval None
MichaelW 0:1ecaa40f74d0 52 */
MichaelW 0:1ecaa40f74d0 53 #define __HAL_RTC_WAKEUPTIMER_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((((__HANDLE__)->Instance->CR) & (__INTERRUPT__)) != RESET) ? SET : RESET)
MichaelW 0:1ecaa40f74d0 54
MichaelW 0:1ecaa40f74d0 55 /**
MichaelW 0:1ecaa40f74d0 56 * @brief Get the selected RTC WakeUpTimer's flag status.
MichaelW 0:1ecaa40f74d0 57 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 58 * @param __FLAG__: specifies the RTC WakeUpTimer Flag is pending or not.
MichaelW 0:1ecaa40f74d0 59 * This parameter can be:
MichaelW 0:1ecaa40f74d0 60 * @arg RTC_FLAG_WUTF
MichaelW 0:1ecaa40f74d0 61 * @arg RTC_FLAG_WUTWF
MichaelW 0:1ecaa40f74d0 62 * @retval None
MichaelW 0:1ecaa40f74d0 63 */
MichaelW 0:1ecaa40f74d0 64 #define __HAL_RTC_WAKEUPTIMER_GET_FLAG(__HANDLE__, __FLAG__) (((((__HANDLE__)->Instance->ISR) & (__FLAG__)) != RESET) ? SET : RESET)
MichaelW 0:1ecaa40f74d0 65
MichaelW 0:1ecaa40f74d0 66 /**
MichaelW 0:1ecaa40f74d0 67 * @brief Clear the RTC Wake Up timer's pending flags.
MichaelW 0:1ecaa40f74d0 68 * @param __HANDLE__: specifies the RTC handle.
MichaelW 0:1ecaa40f74d0 69 * @param __FLAG__: specifies the RTC WakeUpTimer Flag to clear.
MichaelW 0:1ecaa40f74d0 70 * This parameter can be:
MichaelW 0:1ecaa40f74d0 71 * @arg RTC_FLAG_WUTF
MichaelW 0:1ecaa40f74d0 72 * @retval None
MichaelW 0:1ecaa40f74d0 73 */
MichaelW 0:1ecaa40f74d0 74 #define __HAL_RTC_WAKEUPTIMER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ISR) = (~(((__FLAG__) | RTC_ISR_INIT)& 0x0000FFFF)|((__HANDLE__)->Instance->ISR & RTC_ISR_INIT))
MichaelW 0:1ecaa40f74d0 75
MichaelW 0:1ecaa40f74d0 76 /* WAKE-UP TIMER EXTI */
MichaelW 0:1ecaa40f74d0 77 /* ------------------ */
MichaelW 0:1ecaa40f74d0 78 /**
MichaelW 0:1ecaa40f74d0 79 * @brief Enable interrupt on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 80 * @retval None
MichaelW 0:1ecaa40f74d0 81 */
MichaelW 0:1ecaa40f74d0 82 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_IT() (EXTI->IMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 83
MichaelW 0:1ecaa40f74d0 84 /**
MichaelW 0:1ecaa40f74d0 85 * @brief Disable interrupt on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 86 * @retval None
MichaelW 0:1ecaa40f74d0 87 */
MichaelW 0:1ecaa40f74d0 88 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_IT() (EXTI->IMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
MichaelW 0:1ecaa40f74d0 89
MichaelW 0:1ecaa40f74d0 90 /**
MichaelW 0:1ecaa40f74d0 91 * @brief Enable event on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 92 * @retval None.
MichaelW 0:1ecaa40f74d0 93 */
MichaelW 0:1ecaa40f74d0 94 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_EVENT() (EXTI->EMR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 95
MichaelW 0:1ecaa40f74d0 96 /**
MichaelW 0:1ecaa40f74d0 97 * @brief Disable event on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 98 * @retval None.
MichaelW 0:1ecaa40f74d0 99 */
MichaelW 0:1ecaa40f74d0 100 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_EVENT() (EXTI->EMR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
MichaelW 0:1ecaa40f74d0 101
MichaelW 0:1ecaa40f74d0 102 /**
MichaelW 0:1ecaa40f74d0 103 * @brief Enable falling edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 104 * @retval None.
MichaelW 0:1ecaa40f74d0 105 */
MichaelW 0:1ecaa40f74d0 106 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE() (EXTI->FTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 107
MichaelW 0:1ecaa40f74d0 108 /**
MichaelW 0:1ecaa40f74d0 109 * @brief Disable falling edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 110 * @retval None.
MichaelW 0:1ecaa40f74d0 111 */
MichaelW 0:1ecaa40f74d0 112 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE() (EXTI->FTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
MichaelW 0:1ecaa40f74d0 113
MichaelW 0:1ecaa40f74d0 114 /**
MichaelW 0:1ecaa40f74d0 115 * @brief Enable rising edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 116 * @retval None.
MichaelW 0:1ecaa40f74d0 117 */
MichaelW 0:1ecaa40f74d0 118 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE() (EXTI->RTSR |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 119
MichaelW 0:1ecaa40f74d0 120 /**
MichaelW 0:1ecaa40f74d0 121 * @brief Disable rising edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 122 * @retval None.
MichaelW 0:1ecaa40f74d0 123 */
MichaelW 0:1ecaa40f74d0 124 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE() (EXTI->RTSR &= ~(RTC_EXTI_LINE_WAKEUPTIMER_EVENT))
MichaelW 0:1ecaa40f74d0 125
MichaelW 0:1ecaa40f74d0 126 /**
MichaelW 0:1ecaa40f74d0 127 * @brief Enable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 128 * @retval None.
MichaelW 0:1ecaa40f74d0 129 */
MichaelW 0:1ecaa40f74d0 130 #define __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_ENABLE_FALLING_EDGE();
MichaelW 0:1ecaa40f74d0 131
MichaelW 0:1ecaa40f74d0 132 /**
MichaelW 0:1ecaa40f74d0 133 * @brief Disable rising & falling edge trigger on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 134 * This parameter can be:
MichaelW 0:1ecaa40f74d0 135 * @retval None.
MichaelW 0:1ecaa40f74d0 136 */
MichaelW 0:1ecaa40f74d0 137 #define __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_FALLING_EDGE() __HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_RISING_EDGE();__HAL_RTC_WAKEUPTIMER_EXTI_DISABLE_FALLING_EDGE();
MichaelW 0:1ecaa40f74d0 138
MichaelW 0:1ecaa40f74d0 139 /**
MichaelW 0:1ecaa40f74d0 140 * @brief Check whether the RTC WakeUp Timer associated Exti line interrupt flag is set or not.
MichaelW 0:1ecaa40f74d0 141 * @retval Line Status.
MichaelW 0:1ecaa40f74d0 142 */
MichaelW 0:1ecaa40f74d0 143 #define __HAL_RTC_WAKEUPTIMER_EXTI_GET_FLAG() (EXTI->PR & RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 144
MichaelW 0:1ecaa40f74d0 145 /**
MichaelW 0:1ecaa40f74d0 146 * @brief Clear the RTC WakeUp Timer associated Exti line flag.
MichaelW 0:1ecaa40f74d0 147 * @retval None.
MichaelW 0:1ecaa40f74d0 148 */
MichaelW 0:1ecaa40f74d0 149 #define __HAL_RTC_WAKEUPTIMER_EXTI_CLEAR_FLAG() (EXTI->PR = RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 150
MichaelW 0:1ecaa40f74d0 151 /**
MichaelW 0:1ecaa40f74d0 152 * @brief Generate a Software interrupt on the RTC WakeUp Timer associated Exti line.
MichaelW 0:1ecaa40f74d0 153 * @retval None.
MichaelW 0:1ecaa40f74d0 154 */
MichaelW 0:1ecaa40f74d0 155 #define __HAL_RTC_WAKEUPTIMER_EXTI_GENERATE_SWIT() (EXTI->SWIER |= RTC_EXTI_LINE_WAKEUPTIMER_EVENT)
MichaelW 0:1ecaa40f74d0 156
MichaelW 0:1ecaa40f74d0 157
MichaelW 0:1ecaa40f74d0 158 /** @defgroup RTCEx_Backup_Registers_Definitions RTCEx Backup Registers Definition
MichaelW 0:1ecaa40f74d0 159 * @{
MichaelW 0:1ecaa40f74d0 160 */
MichaelW 0:1ecaa40f74d0 161 #define RTC_BKP_DR0 ((uint32_t)0x00000000)
MichaelW 0:1ecaa40f74d0 162 #define RTC_BKP_DR1 ((uint32_t)0x00000001)
MichaelW 0:1ecaa40f74d0 163 #define RTC_BKP_DR2 ((uint32_t)0x00000002)
MichaelW 0:1ecaa40f74d0 164 #define RTC_BKP_DR3 ((uint32_t)0x00000003)
MichaelW 0:1ecaa40f74d0 165 #define RTC_BKP_DR4 ((uint32_t)0x00000004)
MichaelW 0:1ecaa40f74d0 166 /**
MichaelW 0:1ecaa40f74d0 167 * @}
MichaelW 0:1ecaa40f74d0 168 */
MichaelW 0:1ecaa40f74d0 169 /* !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F030xC) && !defined(STM32F070x6) && !defined(STM32F070xB) */
MichaelW 0:1ecaa40f74d0 170
MichaelW 0:1ecaa40f74d0 171 /** @defgroup RTCEx_Time_Stamp_Edges_definitions RTCEx Time Stamp Edges definition
MichaelW 0:1ecaa40f74d0 172 * @{
MichaelW 0:1ecaa40f74d0 173 */
MichaelW 0:1ecaa40f74d0 174 #define RTC_TIMESTAMPEDGE_RISING ((uint32_t)0x00000000)
MichaelW 0:1ecaa40f74d0 175 #define RTC_TIMESTAMPEDGE_FALLING ((uint32_t)0x00000008)
MichaelW 0:1ecaa40f74d0 176
MichaelW 0:1ecaa40f74d0 177 /**
MichaelW 0:1ecaa40f74d0 178 * @}
MichaelW 0:1ecaa40f74d0 179 */
MichaelW 0:1ecaa40f74d0 180
MichaelW 0:1ecaa40f74d0 181 /** @defgroup RTCEx_TimeStamp_Pin_Selections RTCEx TimeStamp Pin Selection
MichaelW 0:1ecaa40f74d0 182 * @{
MichaelW 0:1ecaa40f74d0 183 */
MichaelW 0:1ecaa40f74d0 184 #define RTC_TIMESTAMPPIN_DEFAULT ((uint32_t)0x00000000)
MichaelW 0:1ecaa40f74d0 185
MichaelW 0:1ecaa40f74d0 186 /**
MichaelW 0:1ecaa40f74d0 187 * @}
MichaelW 0:1ecaa40f74d0 188 */
MichaelW 0:1ecaa40f74d0 189
MichaelW 0:1ecaa40f74d0 190
MichaelW 0:1ecaa40f74d0 191 /** @defgroup RTCEx_Tamper_Pins_Definitions RTCEx Tamper Pins Definition
MichaelW 0:1ecaa40f74d0 192 * @{
MichaelW 0:1ecaa40f74d0 193 */
MichaelW 0:1ecaa40f74d0 194 #define RTC_TAMPER_1 RTC_TAFCR_TAMP1E
MichaelW 0:1ecaa40f74d0 195 #define RTC_TAMPER_2 RTC_TAFCR_TAMP2E
MichaelW 0:1ecaa40f74d0 196 #if defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) || defined(STM32F091xC) || defined(STM32F098xx)
MichaelW 0:1ecaa40f74d0 197 #define RTC_TAMPER_3 RTC_TAFCR_TAMP3E
MichaelW 0:1ecaa40f74d0 198 #endif
MichaelW 0:1ecaa40f74d0 199
MichaelW 0:1ecaa40f74d0 200 /**
MichaelW 0:1ecaa40f74d0 201 * @}
MichaelW 0:1ecaa40f74d0 202 */
MichaelW 0:1ecaa40f74d0 203
MichaelW 0:1ecaa40f74d0 204
MichaelW 0:1ecaa40f74d0 205
MichaelW 0:1ecaa40f74d0 206 /** @defgroup RTCEx_Tamper_Trigger_Definitions RTCEx Tamper Trigger Definition
MichaelW 0:1ecaa40f74d0 207 * @{
MichaelW 0:1ecaa40f74d0 208 */
MichaelW 0:1ecaa40f74d0 209 #define RTC_TAMPERTRIGGER_RISINGEDGE ((uint32_t)0x00000000)
MichaelW 0:1ecaa40f74d0 210 #define RTC_TAMPERTRIGGER_FALLINGEDGE ((uint32_t)0x00000002)
MichaelW 0:1ecaa40f74d0 211 #define RTC_TAMPERTRIGGER_LOWLEVEL RTC_TAMPERTRIGGER_RISINGEDGE
MichaelW 0:1ecaa40f74d0 212 #define RTC_TAMPERTRIGGER_HIGHLEVEL RTC_TAMPERTRIGGER_FALLINGEDGE
MichaelW 0:1ecaa40f74d0 213
MichaelW 0:1ecaa40f74d0 214
MichaelW 0:1ecaa40f74d0 215 /**
MichaelW 0:1ecaa40f74d0 216 * @}
MichaelW 0:1ecaa40f74d0 217 */
MichaelW 0:1ecaa40f74d0 218
MichaelW 0:1ecaa40f74d0 219 /** @defgroup RTCEx_Tamper_Filter_Definitions RTCEx Tamper Filter Definition
MichaelW 0:1ecaa40f74d0 220 * @{
MichaelW 0:1ecaa40f74d0 221 */
MichaelW 0:1ecaa40f74d0 222 #define RTC_TAMPERFILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */
MichaelW 0:1ecaa40f74d0 223
MichaelW 0:1ecaa40f74d0 224 #define RTC_TAMPERFILTER_2SAMPLE ((uint32_t)0x00000800) /*!< Tamper is activated after 2
MichaelW 0:1ecaa40f74d0 225 consecutive samples at the active level */
MichaelW 0:1ecaa40f74d0 226 #define RTC_TAMPERFILTER_4SAMPLE ((uint32_t)0x00001000) /*!< Tamper is activated after 4
MichaelW 0:1ecaa40f74d0 227 consecutive samples at the active level */
MichaelW 0:1ecaa40f74d0 228 #define RTC_TAMPERFILTER_8SAMPLE ((uint32_t)0x00001800) /*!< Tamper is activated after 8
MichaelW 0:1ecaa40f74d0 229 consecutive samples at the active level. */
MichaelW 0:1ecaa40f74d0 230
MichaelW 0:1ecaa40f74d0 231 /**
MichaelW 0:1ecaa40f74d0 232 * @}
MichaelW 0:1ecaa40f74d0 233 */
MichaelW 0:1ecaa40f74d0 234
MichaelW 0:1ecaa40f74d0 235 /** @defgroup RTCEx_Tamper_Sampling_Frequencies_Definitions RTCEx Tamper Sampling Frequencies Definition
MichaelW 0:1ecaa40f74d0 236 * @{
MichaelW 0:1ecaa40f74d0 237 */
MichaelW 0:1ecaa40f74d0 238 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 239 with a frequency = RTCCLK / 32768 */
MichaelW 0:1ecaa40f74d0 240 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV16384 ((uint32_t)0x00000100) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 241 with a frequency = RTCCLK / 16384 */
MichaelW 0:1ecaa40f74d0 242 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV8192 ((uint32_t)0x00000200) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 243 with a frequency = RTCCLK / 8192 */
MichaelW 0:1ecaa40f74d0 244 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV4096 ((uint32_t)0x00000300) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 245 with a frequency = RTCCLK / 4096 */
MichaelW 0:1ecaa40f74d0 246 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV2048 ((uint32_t)0x00000400) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 247 with a frequency = RTCCLK / 2048 */
MichaelW 0:1ecaa40f74d0 248 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV1024 ((uint32_t)0x00000500) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 249 with a frequency = RTCCLK / 1024 */
MichaelW 0:1ecaa40f74d0 250 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV512 ((uint32_t)0x00000600) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 251 with a frequency = RTCCLK / 512 */
MichaelW 0:1ecaa40f74d0 252 #define RTC_TAMPERSAMPLINGFREQ_RTCCLK_DIV256 ((uint32_t)0x00000700) /*!< Each of the tamper inputs are sampled
MichaelW 0:1ecaa40f74d0 253 with a frequency = RTCCLK / 256 */
MichaelW 0:1ecaa40f74d0 254
MichaelW 0:1ecaa40f74d0 255 /**
MichaelW 0:1ecaa40f74d0 256 * @}
MichaelW 0:1ecaa40f74d0 257 */
MichaelW 0:1ecaa40f74d0 258
MichaelW 0:1ecaa40f74d0 259 /** @defgroup RTCEx_Tamper_Pin_Precharge_Duration_Definitions RTCEx Tamper Pin Precharge Duration Definition
MichaelW 0:1ecaa40f74d0 260 * @{
MichaelW 0:1ecaa40f74d0 261 */
MichaelW 0:1ecaa40f74d0 262 #define RTC_TAMPERPRECHARGEDURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before
MichaelW 0:1ecaa40f74d0 263 sampling during 1 RTCCLK cycle */
MichaelW 0:1ecaa40f74d0 264 #define RTC_TAMPERPRECHARGEDURATION_2RTCCLK ((uint32_t)0x00002000) /*!< Tamper pins are pre-charged before
MichaelW 0:1ecaa40f74d0 265 sampling during 2 RTCCLK cycles */
MichaelW 0:1ecaa40f74d0 266 #define RTC_TAMPERPRECHARGEDURATION_4RTCCLK ((uint32_t)0x00004000) /*!< Tamper pins are pre-charged before
MichaelW 0:1ecaa40f74d0 267 sampling during 4 RTCCLK cycles */
MichaelW 0:1ecaa40f74d0 268 #define RTC_TAMPERPRECHARGEDURATION_8RTCCLK ((uint32_t)0x00006000) /*!< Tamper pins are pre-charged before
MichaelW 0:1ecaa40f74d0 269 sampling during 8 RTCCLK cycles */
MichaelW 0:1ecaa40f74d0 270
MichaelW 0:1ecaa40f74d0 271 /**
MichaelW 0:1ecaa40f74d0 272 * @}
MichaelW 0:1ecaa40f74d0 273 */
MichaelW 0:1ecaa40f74d0 274
MichaelW 0:1ecaa40f74d0 275 /** @defgroup RTCEx_Tamper_TimeStampOnTamperDetection_Definitions RTCEx Tamper TimeStampOnTamperDetection Definition
MichaelW 0:1ecaa40f74d0 276 * @{
MichaelW 0:1ecaa40f74d0 277 */
MichaelW 0:1ecaa40f74d0 278 #define RTC_TIMESTAMPONTAMPERDETECTION_ENABLE ((uint32_t)RTC_TAFCR_TAMPTS) /*!< TimeStamp on Tamper Detection event saved */
MichaelW 0:1ecaa40f74d0 279 #define RTC_TIMESTAMPONTAMPERDETECTION_DISABLE ((uint32_t)0x00000000) /*!< TimeStamp on Tamper Detection event is not saved */
MichaelW 0:1ecaa40f74d0 280
MichaelW 0:1ecaa40f74d0 281 /**
MichaelW 0:1ecaa40f74d0 282 * @}
MichaelW 0:1ecaa40f74d0 283 */
MichaelW 0:1ecaa40f74d0 284
MichaelW 0:1ecaa40f74d0 285 /** @defgroup RTCEx_Tamper_Pull_UP_Definitions RTCEx Tamper Pull UP Definition
MichaelW 0:1ecaa40f74d0 286 * @{
MichaelW 0:1ecaa40f74d0 287 */
MichaelW 0:1ecaa40f74d0 288 #define RTC_TAMPER_PULLUP_ENABLE ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before sampling */
MichaelW 0:1ecaa40f74d0 289 #define RTC_TAMPER_PULLUP_DISABLE ((uint32_t)RTC_TAFCR_TAMPPUDIS) /*!< TimeStamp on Tamper Detection event is not saved */
MichaelW 0:1ecaa40f74d0 290
MichaelW 0:1ecaa40f74d0 291 /**
MichaelW 0:1ecaa40f74d0 292 * @}
MichaelW 0:1ecaa40f74d0 293 */
MichaelW 0:1ecaa40f74d0 294
MichaelW 0:1ecaa40f74d0 295 /** @defgroup RTCEx_Wakeup_Timer_Definitions RTCEx Wakeup Timer Definition
MichaelW 0:1ecaa40f74d0 296 * @{
MichaelW 0:1ecaa40f74d0 297 */
MichaelW 0:1ecaa40f74d0 298 #define RTC_WAKEUPCLOCK_RTCCLK_DIV16 ((uint32_t)0x00000000)
MichaelW 0:1ecaa40f74d0 299 #define RTC_WAKEUPCLOCK_RTCCLK_DIV8 ((uint32_t)0x00000001)
MichaelW 0:1ecaa40f74d0 300 #define RTC_WAKEUPCLOCK_RTCCLK_DIV4 ((uint32_t)0x00000002)
MichaelW 0:1ecaa40f74d0 301 #define RTC_WAKEUPCLOCK_RTCCLK_DIV2 ((uint32_t)0x00000003)
MichaelW 0:1ecaa40f74d0 302 #define RTC_WAKEUPCLOCK_CK_SPRE_16BITS ((uint32_t)0x00000004)
MichaelW 0:1ecaa40f74d0 303 #define RTC_WAKEUPCLOCK_CK_SPRE_17BITS ((uint32_t)0x00000006)
MichaelW 0:1ecaa40f74d0 304
MichaelW 0:1ecaa40f74d0 305