Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
Inc/stm32l4xx_ll_rtc.h@2:7aef7655b0a8, 2015-11-25 (annotated)
- Committer:
- EricLew
- Date:
- Wed Nov 25 17:30:43 2015 +0000
- Revision:
- 2:7aef7655b0a8
- Parent:
- 0:80ee8f3b695e
commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
EricLew | 0:80ee8f3b695e | 1 | /** |
EricLew | 0:80ee8f3b695e | 2 | ****************************************************************************** |
EricLew | 0:80ee8f3b695e | 3 | * @file stm32l4xx_ll_rtc.h |
EricLew | 0:80ee8f3b695e | 4 | * @author MCD Application Team |
EricLew | 0:80ee8f3b695e | 5 | * @version V1.1.0 |
EricLew | 0:80ee8f3b695e | 6 | * @date 16-September-2015 |
EricLew | 0:80ee8f3b695e | 7 | * @brief Header file of RTC LL module. |
EricLew | 0:80ee8f3b695e | 8 | ****************************************************************************** |
EricLew | 0:80ee8f3b695e | 9 | * @attention |
EricLew | 0:80ee8f3b695e | 10 | * |
EricLew | 0:80ee8f3b695e | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
EricLew | 0:80ee8f3b695e | 12 | * |
EricLew | 0:80ee8f3b695e | 13 | * Redistribution and use in source and binary forms, with or without modification, |
EricLew | 0:80ee8f3b695e | 14 | * are permitted provided that the following conditions are met: |
EricLew | 0:80ee8f3b695e | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
EricLew | 0:80ee8f3b695e | 16 | * this list of conditions and the following disclaimer. |
EricLew | 0:80ee8f3b695e | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
EricLew | 0:80ee8f3b695e | 18 | * this list of conditions and the following disclaimer in the documentation |
EricLew | 0:80ee8f3b695e | 19 | * and/or other materials provided with the distribution. |
EricLew | 0:80ee8f3b695e | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
EricLew | 0:80ee8f3b695e | 21 | * may be used to endorse or promote products derived from this software |
EricLew | 0:80ee8f3b695e | 22 | * without specific prior written permission. |
EricLew | 0:80ee8f3b695e | 23 | * |
EricLew | 0:80ee8f3b695e | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
EricLew | 0:80ee8f3b695e | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
EricLew | 0:80ee8f3b695e | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
EricLew | 0:80ee8f3b695e | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
EricLew | 0:80ee8f3b695e | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
EricLew | 0:80ee8f3b695e | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
EricLew | 0:80ee8f3b695e | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
EricLew | 0:80ee8f3b695e | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
EricLew | 0:80ee8f3b695e | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
EricLew | 0:80ee8f3b695e | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
EricLew | 0:80ee8f3b695e | 34 | * |
EricLew | 0:80ee8f3b695e | 35 | ****************************************************************************** |
EricLew | 0:80ee8f3b695e | 36 | */ |
EricLew | 0:80ee8f3b695e | 37 | |
EricLew | 0:80ee8f3b695e | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 39 | #ifndef __STM32L4xx_LL_RTC_H |
EricLew | 0:80ee8f3b695e | 40 | #define __STM32L4xx_LL_RTC_H |
EricLew | 0:80ee8f3b695e | 41 | |
EricLew | 0:80ee8f3b695e | 42 | #ifdef __cplusplus |
EricLew | 0:80ee8f3b695e | 43 | extern "C" { |
EricLew | 0:80ee8f3b695e | 44 | #endif |
EricLew | 0:80ee8f3b695e | 45 | |
EricLew | 0:80ee8f3b695e | 46 | /* Includes ------------------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 47 | #include "stm32l4xx.h" |
EricLew | 0:80ee8f3b695e | 48 | |
EricLew | 0:80ee8f3b695e | 49 | /** @addtogroup STM32L4xx_LL_Driver |
EricLew | 0:80ee8f3b695e | 50 | * @{ |
EricLew | 0:80ee8f3b695e | 51 | */ |
EricLew | 0:80ee8f3b695e | 52 | |
EricLew | 0:80ee8f3b695e | 53 | #if defined(RTC) |
EricLew | 0:80ee8f3b695e | 54 | |
EricLew | 0:80ee8f3b695e | 55 | /** @defgroup RTC_LL RTC LL |
EricLew | 0:80ee8f3b695e | 56 | * @{ |
EricLew | 0:80ee8f3b695e | 57 | */ |
EricLew | 0:80ee8f3b695e | 58 | |
EricLew | 0:80ee8f3b695e | 59 | /* Private types -------------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 60 | /* Private variables ---------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 61 | |
EricLew | 0:80ee8f3b695e | 62 | /* Private constants ---------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 63 | /** @defgroup RTC_LL_Private_Constants RTC Private Constants |
EricLew | 0:80ee8f3b695e | 64 | * @{ |
EricLew | 0:80ee8f3b695e | 65 | */ |
EricLew | 0:80ee8f3b695e | 66 | |
EricLew | 0:80ee8f3b695e | 67 | /* Define used for feature activation */ |
EricLew | 0:80ee8f3b695e | 68 | #if defined(RTC_TAMPCR_TAMP3E) |
EricLew | 0:80ee8f3b695e | 69 | #define RTC_FEATURE_TAMPER3 |
EricLew | 0:80ee8f3b695e | 70 | #endif /* RTC_TAMPCR_TAMP3E */ |
EricLew | 0:80ee8f3b695e | 71 | |
EricLew | 0:80ee8f3b695e | 72 | /* Masks Definition */ |
EricLew | 0:80ee8f3b695e | 73 | #define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) |
EricLew | 0:80ee8f3b695e | 74 | #define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) |
EricLew | 0:80ee8f3b695e | 75 | |
EricLew | 0:80ee8f3b695e | 76 | /* Write protection defines */ |
EricLew | 0:80ee8f3b695e | 77 | #define RTC_WRITE_PROTECTION_DISABLE ((uint8_t)0xFF) |
EricLew | 0:80ee8f3b695e | 78 | #define RTC_WRITE_PROTECTION_ENABLE_1 ((uint8_t)0xCA) |
EricLew | 0:80ee8f3b695e | 79 | #define RTC_WRITE_PROTECTION_ENABLE_2 ((uint8_t)0x53) |
EricLew | 0:80ee8f3b695e | 80 | |
EricLew | 0:80ee8f3b695e | 81 | /* Defines used for the bit position in the register and perform offsets */ |
EricLew | 0:80ee8f3b695e | 82 | #define RTC_POSITION_TR_HT (uint32_t)POSITION_VAL(RTC_TR_HT) |
EricLew | 0:80ee8f3b695e | 83 | #define RTC_POSITION_TR_HU (uint32_t)POSITION_VAL(RTC_TR_HU) |
EricLew | 0:80ee8f3b695e | 84 | #define RTC_POSITION_TR_MT (uint32_t)POSITION_VAL(RTC_TR_MNT) |
EricLew | 0:80ee8f3b695e | 85 | #define RTC_POSITION_TR_MU (uint32_t)POSITION_VAL(RTC_TR_MNU) |
EricLew | 0:80ee8f3b695e | 86 | #define RTC_POSITION_TR_ST (uint32_t)POSITION_VAL(RTC_TR_ST) |
EricLew | 0:80ee8f3b695e | 87 | #define RTC_POSITION_TR_SU (uint32_t)POSITION_VAL(RTC_TR_SU) |
EricLew | 0:80ee8f3b695e | 88 | #define RTC_POSITION_DR_YT (uint32_t)POSITION_VAL(RTC_DR_YT) |
EricLew | 0:80ee8f3b695e | 89 | #define RTC_POSITION_DR_YU (uint32_t)POSITION_VAL(RTC_DR_YU) |
EricLew | 0:80ee8f3b695e | 90 | #define RTC_POSITION_DR_MT (uint32_t)POSITION_VAL(RTC_DR_MT) |
EricLew | 0:80ee8f3b695e | 91 | #define RTC_POSITION_DR_MU (uint32_t)POSITION_VAL(RTC_DR_MU) |
EricLew | 0:80ee8f3b695e | 92 | #define RTC_POSITION_DR_DT (uint32_t)POSITION_VAL(RTC_DR_DT) |
EricLew | 0:80ee8f3b695e | 93 | #define RTC_POSITION_DR_DU (uint32_t)POSITION_VAL(RTC_DR_DU) |
EricLew | 0:80ee8f3b695e | 94 | #define RTC_POSITION_DR_WDU (uint32_t)POSITION_VAL(RTC_DR_WDU) |
EricLew | 0:80ee8f3b695e | 95 | #define RTC_POSITION_ALMA_DT (uint32_t)POSITION_VAL(RTC_ALRMAR_DT) |
EricLew | 0:80ee8f3b695e | 96 | #define RTC_POSITION_ALMA_DU (uint32_t)POSITION_VAL(RTC_ALRMAR_DU) |
EricLew | 0:80ee8f3b695e | 97 | #define RTC_POSITION_ALMA_HT (uint32_t)POSITION_VAL(RTC_ALRMAR_HT) |
EricLew | 0:80ee8f3b695e | 98 | #define RTC_POSITION_ALMA_HU (uint32_t)POSITION_VAL(RTC_ALRMAR_HU) |
EricLew | 0:80ee8f3b695e | 99 | #define RTC_POSITION_ALMA_MT (uint32_t)POSITION_VAL(RTC_ALRMAR_MNT) |
EricLew | 0:80ee8f3b695e | 100 | #define RTC_POSITION_ALMA_MU (uint32_t)POSITION_VAL(RTC_ALRMAR_MNU) |
EricLew | 0:80ee8f3b695e | 101 | #define RTC_POSITION_ALMA_SU (uint32_t)POSITION_VAL(RTC_ALRMAR_SU) |
EricLew | 0:80ee8f3b695e | 102 | #define RTC_POSITION_ALMA_ST (uint32_t)POSITION_VAL(RTC_ALRMAR_ST) |
EricLew | 0:80ee8f3b695e | 103 | #define RTC_POSITION_ALMB_DT (uint32_t)POSITION_VAL(RTC_ALRMBR_DT) |
EricLew | 0:80ee8f3b695e | 104 | #define RTC_POSITION_ALMB_DU (uint32_t)POSITION_VAL(RTC_ALRMBR_DU) |
EricLew | 0:80ee8f3b695e | 105 | #define RTC_POSITION_ALMB_HT (uint32_t)POSITION_VAL(RTC_ALRMBR_HT) |
EricLew | 0:80ee8f3b695e | 106 | #define RTC_POSITION_ALMB_HU (uint32_t)POSITION_VAL(RTC_ALRMBR_HU) |
EricLew | 0:80ee8f3b695e | 107 | #define RTC_POSITION_ALMB_MT (uint32_t)POSITION_VAL(RTC_ALRMBR_MNT) |
EricLew | 0:80ee8f3b695e | 108 | #define RTC_POSITION_ALMB_MU (uint32_t)POSITION_VAL(RTC_ALRMBR_MNU) |
EricLew | 0:80ee8f3b695e | 109 | #define RTC_POSITION_ALMB_SU (uint32_t)POSITION_VAL(RTC_ALRMBR_SU) |
EricLew | 0:80ee8f3b695e | 110 | #define RTC_POSITION_ALMB_ST (uint32_t)POSITION_VAL(RTC_ALRMBR_ST) |
EricLew | 0:80ee8f3b695e | 111 | #define RTC_POSITION_PRER_PREDIV_A (uint32_t)POSITION_VAL(RTC_PRER_PREDIV_A) |
EricLew | 0:80ee8f3b695e | 112 | #define RTC_POSITION_ALMA_MASKSS (uint32_t)POSITION_VAL(RTC_ALRMASSR_MASKSS) |
EricLew | 0:80ee8f3b695e | 113 | #define RTC_POSITION_ALMB_MASKSS (uint32_t)POSITION_VAL(RTC_ALRMBSSR_MASKSS) |
EricLew | 0:80ee8f3b695e | 114 | #define RTC_POSITION_TS_HU (uint32_t)POSITION_VAL(RTC_TSTR_HU) |
EricLew | 0:80ee8f3b695e | 115 | #define RTC_POSITION_TS_MNU (uint32_t)POSITION_VAL(RTC_TSTR_MNU) |
EricLew | 0:80ee8f3b695e | 116 | #define RTC_POSITION_TS_WDU (uint32_t)POSITION_VAL(RTC_TSDR_WDU) |
EricLew | 0:80ee8f3b695e | 117 | #define RTC_POSITION_TS_MU (uint32_t)POSITION_VAL(RTC_TSDR_MU) |
EricLew | 0:80ee8f3b695e | 118 | |
EricLew | 0:80ee8f3b695e | 119 | /* Defines used to combine date & time */ |
EricLew | 0:80ee8f3b695e | 120 | #define RTC_OFFSET_WEEKDAY (uint32_t)24 |
EricLew | 0:80ee8f3b695e | 121 | #define RTC_OFFSET_DAY (uint32_t)16 |
EricLew | 0:80ee8f3b695e | 122 | #define RTC_OFFSET_MONTH (uint32_t)8 |
EricLew | 0:80ee8f3b695e | 123 | #define RTC_OFFSET_HOUR (uint32_t)16 |
EricLew | 0:80ee8f3b695e | 124 | #define RTC_OFFSET_MINUTE (uint32_t)8 |
EricLew | 0:80ee8f3b695e | 125 | |
EricLew | 0:80ee8f3b695e | 126 | /** |
EricLew | 0:80ee8f3b695e | 127 | * @} |
EricLew | 0:80ee8f3b695e | 128 | */ |
EricLew | 0:80ee8f3b695e | 129 | |
EricLew | 0:80ee8f3b695e | 130 | /* Private macros ------------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 131 | |
EricLew | 0:80ee8f3b695e | 132 | /* Exported types ------------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 133 | /* Exported constants --------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 134 | /** @defgroup RTC_LL_Exported_Constants RTC Exported Constants |
EricLew | 0:80ee8f3b695e | 135 | * @{ |
EricLew | 0:80ee8f3b695e | 136 | */ |
EricLew | 0:80ee8f3b695e | 137 | |
EricLew | 0:80ee8f3b695e | 138 | /** @defgroup RTC_LL_EC_GET_FLAG Get Flags Defines |
EricLew | 0:80ee8f3b695e | 139 | * @brief Flags defines which can be used with LL_RTC_ReadReg function |
EricLew | 0:80ee8f3b695e | 140 | * @{ |
EricLew | 0:80ee8f3b695e | 141 | */ |
EricLew | 0:80ee8f3b695e | 142 | #define LL_RTC_ISR_ITSF RTC_ISR_ITSF |
EricLew | 0:80ee8f3b695e | 143 | #define LL_RTC_ISR_RECALPF RTC_ISR_RECALPF |
EricLew | 0:80ee8f3b695e | 144 | #define LL_RTC_ISR_TAMP3F RTC_ISR_TAMP3F |
EricLew | 0:80ee8f3b695e | 145 | #define LL_RTC_ISR_TAMP2F RTC_ISR_TAMP2F |
EricLew | 0:80ee8f3b695e | 146 | #define LL_RTC_ISR_TAMP1F RTC_ISR_TAMP1F |
EricLew | 0:80ee8f3b695e | 147 | #define LL_RTC_ISR_TSOVF RTC_ISR_TSOVF |
EricLew | 0:80ee8f3b695e | 148 | #define LL_RTC_ISR_TSF RTC_ISR_TSF |
EricLew | 0:80ee8f3b695e | 149 | #define LL_RTC_ISR_WUTF RTC_ISR_WUTF |
EricLew | 0:80ee8f3b695e | 150 | #define LL_RTC_ISR_ALRBF RTC_ISR_ALRBF |
EricLew | 0:80ee8f3b695e | 151 | #define LL_RTC_ISR_ALRAF RTC_ISR_ALRAF |
EricLew | 0:80ee8f3b695e | 152 | #define LL_RTC_ISR_INITF RTC_ISR_INITF |
EricLew | 0:80ee8f3b695e | 153 | #define LL_RTC_ISR_RSF RTC_ISR_RSF |
EricLew | 0:80ee8f3b695e | 154 | #define LL_RTC_ISR_INITS RTC_ISR_INITS |
EricLew | 0:80ee8f3b695e | 155 | #define LL_RTC_ISR_SHPF RTC_ISR_SHPF |
EricLew | 0:80ee8f3b695e | 156 | #define LL_RTC_ISR_WUTWF RTC_ISR_WUTWF |
EricLew | 0:80ee8f3b695e | 157 | #define LL_RTC_ISR_ALRBWF RTC_ISR_ALRBWF |
EricLew | 0:80ee8f3b695e | 158 | #define LL_RTC_ISR_ALRAWF RTC_ISR_ALRAWF |
EricLew | 0:80ee8f3b695e | 159 | /** |
EricLew | 0:80ee8f3b695e | 160 | * @} |
EricLew | 0:80ee8f3b695e | 161 | */ |
EricLew | 0:80ee8f3b695e | 162 | |
EricLew | 0:80ee8f3b695e | 163 | /** @defgroup RTC_LL_EC_IT IT Defines |
EricLew | 0:80ee8f3b695e | 164 | * @brief IT defines which can be used with LL_RTC_ReadReg and LL_RTC_WriteReg functions |
EricLew | 0:80ee8f3b695e | 165 | * @{ |
EricLew | 0:80ee8f3b695e | 166 | */ |
EricLew | 0:80ee8f3b695e | 167 | #define LL_RTC_CR_TSIE RTC_CR_TSIE |
EricLew | 0:80ee8f3b695e | 168 | #define LL_RTC_CR_WUTIE RTC_CR_WUTIE |
EricLew | 0:80ee8f3b695e | 169 | #define LL_RTC_CR_ALRBIE RTC_CR_ALRBIE |
EricLew | 0:80ee8f3b695e | 170 | #define LL_RTC_CR_ALRAIE RTC_CR_ALRAIE |
EricLew | 0:80ee8f3b695e | 171 | #define LL_RTC_TAMPCR_TAMP3IE RTC_TAMPCR_TAMP3IE |
EricLew | 0:80ee8f3b695e | 172 | #define LL_RTC_TAMPCR_TAMP2IE RTC_TAMPCR_TAMP2IE |
EricLew | 0:80ee8f3b695e | 173 | #define LL_RTC_TAMPCR_TAMP1IE RTC_TAMPCR_TAMP1IE |
EricLew | 0:80ee8f3b695e | 174 | #define LL_RTC_TAMPCR_TAMPIE RTC_TAMPCR_TAMPIE |
EricLew | 0:80ee8f3b695e | 175 | /** |
EricLew | 0:80ee8f3b695e | 176 | * @} |
EricLew | 0:80ee8f3b695e | 177 | */ |
EricLew | 0:80ee8f3b695e | 178 | |
EricLew | 0:80ee8f3b695e | 179 | /** @defgroup RTC_LL_EC_WEEKDAY WEEKDAY |
EricLew | 0:80ee8f3b695e | 180 | * @{ |
EricLew | 0:80ee8f3b695e | 181 | */ |
EricLew | 0:80ee8f3b695e | 182 | #define LL_RTC_WEEKDAY_MONDAY ((uint32_t)0x01) /*!< Monday */ |
EricLew | 0:80ee8f3b695e | 183 | #define LL_RTC_WEEKDAY_TUESDAY ((uint32_t)0x02) /*!< Tuesday */ |
EricLew | 0:80ee8f3b695e | 184 | #define LL_RTC_WEEKDAY_WEDNESDAY ((uint32_t)0x03) /*!< Wednesday */ |
EricLew | 0:80ee8f3b695e | 185 | #define LL_RTC_WEEKDAY_THURSDAY ((uint32_t)0x04) /*!< Thrusday */ |
EricLew | 0:80ee8f3b695e | 186 | #define LL_RTC_WEEKDAY_FRIDAY ((uint32_t)0x05) /*!< Friday */ |
EricLew | 0:80ee8f3b695e | 187 | #define LL_RTC_WEEKDAY_SATURDAY ((uint32_t)0x06) /*!< Saturday */ |
EricLew | 0:80ee8f3b695e | 188 | #define LL_RTC_WEEKDAY_SUNDAY ((uint32_t)0x07) /*!< Sunday */ |
EricLew | 0:80ee8f3b695e | 189 | /** |
EricLew | 0:80ee8f3b695e | 190 | * @} |
EricLew | 0:80ee8f3b695e | 191 | */ |
EricLew | 0:80ee8f3b695e | 192 | |
EricLew | 0:80ee8f3b695e | 193 | /** @defgroup RTC_LL_EC_MONTH MONTH |
EricLew | 0:80ee8f3b695e | 194 | * @{ |
EricLew | 0:80ee8f3b695e | 195 | */ |
EricLew | 0:80ee8f3b695e | 196 | #define LL_RTC_MONTH_JANUARY ((uint8_t)0x01) /*!< January */ |
EricLew | 0:80ee8f3b695e | 197 | #define LL_RTC_MONTH_FEBRUARY ((uint8_t)0x02) /*!< February */ |
EricLew | 0:80ee8f3b695e | 198 | #define LL_RTC_MONTH_MARCH ((uint8_t)0x03) /*!< March */ |
EricLew | 0:80ee8f3b695e | 199 | #define LL_RTC_MONTH_APRIL ((uint8_t)0x04) /*!< April */ |
EricLew | 0:80ee8f3b695e | 200 | #define LL_RTC_MONTH_MAY ((uint8_t)0x05) /*!< May */ |
EricLew | 0:80ee8f3b695e | 201 | #define LL_RTC_MONTH_JUNE ((uint8_t)0x06) /*!< June */ |
EricLew | 0:80ee8f3b695e | 202 | #define LL_RTC_MONTH_JULY ((uint8_t)0x07) /*!< July */ |
EricLew | 0:80ee8f3b695e | 203 | #define LL_RTC_MONTH_AUGUST ((uint8_t)0x08) /*!< August */ |
EricLew | 0:80ee8f3b695e | 204 | #define LL_RTC_MONTH_SEPTEMBER ((uint8_t)0x09) /*!< September */ |
EricLew | 0:80ee8f3b695e | 205 | #define LL_RTC_MONTH_OCTOBER ((uint8_t)0x10) /*!< October */ |
EricLew | 0:80ee8f3b695e | 206 | #define LL_RTC_MONTH_NOVEMBER ((uint8_t)0x11) /*!< November */ |
EricLew | 0:80ee8f3b695e | 207 | #define LL_RTC_MONTH_DECEMBER ((uint8_t)0x12) /*!< December */ |
EricLew | 0:80ee8f3b695e | 208 | /** |
EricLew | 0:80ee8f3b695e | 209 | * @} |
EricLew | 0:80ee8f3b695e | 210 | */ |
EricLew | 0:80ee8f3b695e | 211 | |
EricLew | 0:80ee8f3b695e | 212 | /** @defgroup RTC_LL_EC_HOURFORMAT HOURFORMAT |
EricLew | 0:80ee8f3b695e | 213 | * @{ |
EricLew | 0:80ee8f3b695e | 214 | */ |
EricLew | 0:80ee8f3b695e | 215 | #define LL_RTC_HOURFORMAT_24HOUR (uint32_t)0x00000000 /*!< 24 hour/day format */ |
EricLew | 0:80ee8f3b695e | 216 | #define LL_RTC_HOURFORMAT_AMPM RTC_CR_FMT /*!< AM/PM hour format */ |
EricLew | 0:80ee8f3b695e | 217 | /** |
EricLew | 0:80ee8f3b695e | 218 | * @} |
EricLew | 0:80ee8f3b695e | 219 | */ |
EricLew | 0:80ee8f3b695e | 220 | |
EricLew | 0:80ee8f3b695e | 221 | /** @defgroup RTC_LL_EC_ALARMOUT ALARMOUT |
EricLew | 0:80ee8f3b695e | 222 | * @{ |
EricLew | 0:80ee8f3b695e | 223 | */ |
EricLew | 0:80ee8f3b695e | 224 | #define LL_RTC_ALARMOUT_DISABLE ((uint32_t)0x00000000) /*!< Output disabled */ |
EricLew | 0:80ee8f3b695e | 225 | #define LL_RTC_ALARMOUT_ALMA RTC_CR_OSEL_0 /*!< Alarm A output enabled */ |
EricLew | 0:80ee8f3b695e | 226 | #define LL_RTC_ALARMOUT_ALMB RTC_CR_OSEL_1 /*!< Alarm B output enabled */ |
EricLew | 0:80ee8f3b695e | 227 | #define LL_RTC_ALARMOUT_WAKEUP RTC_CR_OSEL /*!< Wakeup output enabled */ |
EricLew | 0:80ee8f3b695e | 228 | /** |
EricLew | 0:80ee8f3b695e | 229 | * @} |
EricLew | 0:80ee8f3b695e | 230 | */ |
EricLew | 0:80ee8f3b695e | 231 | |
EricLew | 0:80ee8f3b695e | 232 | /** @defgroup RTC_LL_EC_ALARM_OUTPUTTYPE ALARM OUTPUTTYPE |
EricLew | 0:80ee8f3b695e | 233 | * @{ |
EricLew | 0:80ee8f3b695e | 234 | */ |
EricLew | 0:80ee8f3b695e | 235 | #define LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN (uint32_t)0x00000000 /*!< RTC_ALARM, when mapped on PC13, is open-drain output */ |
EricLew | 0:80ee8f3b695e | 236 | #define LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL RTC_OR_ALARMOUTTYPE /*!< RTC_ALARM, when mapped on PC13, is push-pull output */ |
EricLew | 0:80ee8f3b695e | 237 | /** |
EricLew | 0:80ee8f3b695e | 238 | * @} |
EricLew | 0:80ee8f3b695e | 239 | */ |
EricLew | 0:80ee8f3b695e | 240 | |
EricLew | 0:80ee8f3b695e | 241 | /** @defgroup RTC_LL_EC_OUTPUTPOLARITY_PIN OUTPUTPOLARITY PIN |
EricLew | 0:80ee8f3b695e | 242 | * @{ |
EricLew | 0:80ee8f3b695e | 243 | */ |
EricLew | 0:80ee8f3b695e | 244 | #define LL_RTC_OUTPUTPOLARITY_PIN_HIGH (uint32_t)0x00000000 /*!< Pin is high when ALRAF/ALRBF/WUTF is asserted (depending on OSEL)*/ |
EricLew | 0:80ee8f3b695e | 245 | #define LL_RTC_OUTPUTPOLARITY_PIN_LOW RTC_CR_POL /*!< Pin is low when ALRAF/ALRBF/WUTF is asserted (depending on OSEL) */ |
EricLew | 0:80ee8f3b695e | 246 | /** |
EricLew | 0:80ee8f3b695e | 247 | * @} |
EricLew | 0:80ee8f3b695e | 248 | */ |
EricLew | 0:80ee8f3b695e | 249 | |
EricLew | 0:80ee8f3b695e | 250 | /** @defgroup RTC_LL_EC_TIME_FORMAT_AM_OR TIME FORMAT AM OR |
EricLew | 0:80ee8f3b695e | 251 | * @{ |
EricLew | 0:80ee8f3b695e | 252 | */ |
EricLew | 0:80ee8f3b695e | 253 | #define LL_RTC_TIME_FORMAT_AM_OR_24 (uint32_t)0x00000000 /*!< AM or 24-hour format */ |
EricLew | 0:80ee8f3b695e | 254 | #define LL_RTC_TIME_FORMAT_PM RTC_TR_PM /*!< PM */ |
EricLew | 0:80ee8f3b695e | 255 | /** |
EricLew | 0:80ee8f3b695e | 256 | * @} |
EricLew | 0:80ee8f3b695e | 257 | */ |
EricLew | 0:80ee8f3b695e | 258 | |
EricLew | 0:80ee8f3b695e | 259 | /** @defgroup RTC_LL_EC_SHIFT_SECOND SHIFT SECOND |
EricLew | 0:80ee8f3b695e | 260 | * @{ |
EricLew | 0:80ee8f3b695e | 261 | */ |
EricLew | 0:80ee8f3b695e | 262 | #define LL_RTC_SHIFT_SECOND_DELAY (uint32_t)0x00000000 /* Delay (seconds) = SUBFS / (PREDIV_S + 1) */ |
EricLew | 0:80ee8f3b695e | 263 | #define LL_RTC_SHIFT_SECOND_ADVANCE RTC_SHIFTR_ADD1S /* Advance (seconds) = (1 - (SUBFS / (PREDIV_S + 1))) */ |
EricLew | 0:80ee8f3b695e | 264 | /** |
EricLew | 0:80ee8f3b695e | 265 | * @} |
EricLew | 0:80ee8f3b695e | 266 | */ |
EricLew | 0:80ee8f3b695e | 267 | |
EricLew | 0:80ee8f3b695e | 268 | /** @defgroup RTC_LL_EC_ALMA_MASK ALMA MASK |
EricLew | 0:80ee8f3b695e | 269 | * @{ |
EricLew | 0:80ee8f3b695e | 270 | */ |
EricLew | 0:80ee8f3b695e | 271 | #define LL_RTC_ALMA_MASK_NONE ((uint32_t)0x00000000) /*!< No masks applied on Alarm A*/ |
EricLew | 0:80ee8f3b695e | 272 | #define LL_RTC_ALMA_MASK_DATEWEEKDAY RTC_ALRMAR_MSK4 /*!< Date/day do not care in Alarm A comparison */ |
EricLew | 0:80ee8f3b695e | 273 | #define LL_RTC_ALMA_MASK_HOURS RTC_ALRMAR_MSK3 /*!< Hours do not care in Alarm A comparison */ |
EricLew | 0:80ee8f3b695e | 274 | #define LL_RTC_ALMA_MASK_MINUTES RTC_ALRMAR_MSK2 /*!< Minutes do not care in Alarm A comparison */ |
EricLew | 0:80ee8f3b695e | 275 | #define LL_RTC_ALMA_MASK_SECONDS RTC_ALRMAR_MSK1 /*!< Seconds do not care in Alarm A comparison */ |
EricLew | 0:80ee8f3b695e | 276 | #define LL_RTC_ALMA_MASK_ALL (RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1) /*!< Masks all */ |
EricLew | 0:80ee8f3b695e | 277 | /** |
EricLew | 0:80ee8f3b695e | 278 | * @} |
EricLew | 0:80ee8f3b695e | 279 | */ |
EricLew | 0:80ee8f3b695e | 280 | |
EricLew | 0:80ee8f3b695e | 281 | /** @defgroup RTC_LL_EC_ALMA_TIME_FORMAT ALMA TIME FORMAT |
EricLew | 0:80ee8f3b695e | 282 | * @{ |
EricLew | 0:80ee8f3b695e | 283 | */ |
EricLew | 0:80ee8f3b695e | 284 | #define LL_RTC_ALMA_TIME_FORMAT_AM (uint32_t)0x00000000 /*!< AM or 24-hour format */ |
EricLew | 0:80ee8f3b695e | 285 | #define LL_RTC_ALMA_TIME_FORMAT_PM RTC_ALRMAR_PM /*!< PM */ |
EricLew | 0:80ee8f3b695e | 286 | /** |
EricLew | 0:80ee8f3b695e | 287 | * @} |
EricLew | 0:80ee8f3b695e | 288 | */ |
EricLew | 0:80ee8f3b695e | 289 | |
EricLew | 0:80ee8f3b695e | 290 | /** @defgroup RTC_LL_EC_ALMB_MASK ALMB MASK |
EricLew | 0:80ee8f3b695e | 291 | * @{ |
EricLew | 0:80ee8f3b695e | 292 | */ |
EricLew | 0:80ee8f3b695e | 293 | #define LL_RTC_ALMB_MASK_NONE ((uint32_t)0x00000000) /*!< No masks applied on Alarm B*/ |
EricLew | 0:80ee8f3b695e | 294 | #define LL_RTC_ALMB_MASK_DATEWEEKDAY RTC_ALRMBR_MSK4 /*!< Date/day do not care in Alarm B comparison */ |
EricLew | 0:80ee8f3b695e | 295 | #define LL_RTC_ALMB_MASK_HOURS RTC_ALRMBR_MSK3 /*!< Hours do not care in Alarm B comparison */ |
EricLew | 0:80ee8f3b695e | 296 | #define LL_RTC_ALMB_MASK_MINUTES RTC_ALRMBR_MSK2 /*!< Minutes do not care in Alarm B comparison */ |
EricLew | 0:80ee8f3b695e | 297 | #define LL_RTC_ALMB_MASK_SECONDS RTC_ALRMBR_MSK1 /*!< Seconds do not care in Alarm B comparison */ |
EricLew | 0:80ee8f3b695e | 298 | #define LL_RTC_ALMB_MASK_ALL (RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1) /*!< Masks all */ |
EricLew | 0:80ee8f3b695e | 299 | /** |
EricLew | 0:80ee8f3b695e | 300 | * @} |
EricLew | 0:80ee8f3b695e | 301 | */ |
EricLew | 0:80ee8f3b695e | 302 | |
EricLew | 0:80ee8f3b695e | 303 | /** @defgroup RTC_LL_EC_ALMB_TIME_FORMAT ALMB TIME FORMAT |
EricLew | 0:80ee8f3b695e | 304 | * @{ |
EricLew | 0:80ee8f3b695e | 305 | */ |
EricLew | 0:80ee8f3b695e | 306 | #define LL_RTC_ALMB_TIME_FORMAT_AM (uint32_t)0x00000000 /*!< AM or 24-hour format */ |
EricLew | 0:80ee8f3b695e | 307 | #define LL_RTC_ALMB_TIME_FORMAT_PM RTC_ALRMBR_PM /*!< PM */ |
EricLew | 0:80ee8f3b695e | 308 | /** |
EricLew | 0:80ee8f3b695e | 309 | * @} |
EricLew | 0:80ee8f3b695e | 310 | */ |
EricLew | 0:80ee8f3b695e | 311 | |
EricLew | 0:80ee8f3b695e | 312 | /** @defgroup RTC_LL_EC_TIMESTAMP_EDGE TIMESTAMP EDGE |
EricLew | 0:80ee8f3b695e | 313 | * @{ |
EricLew | 0:80ee8f3b695e | 314 | */ |
EricLew | 0:80ee8f3b695e | 315 | #define LL_RTC_TIMESTAMP_EDGE_RISING (uint32_t)0x00000000 /*!< RTC_TS input rising edge generates a time-stamp event */ |
EricLew | 0:80ee8f3b695e | 316 | #define LL_RTC_TIMESTAMP_EDGE_FALLING RTC_CR_TSEDGE /*!< RTC_TS input falling edge generates a time-stamp even */ |
EricLew | 0:80ee8f3b695e | 317 | /** |
EricLew | 0:80ee8f3b695e | 318 | * @} |
EricLew | 0:80ee8f3b695e | 319 | */ |
EricLew | 0:80ee8f3b695e | 320 | |
EricLew | 0:80ee8f3b695e | 321 | /** @defgroup RTC_LL_EC_TS_TIME_FORMAT TS TIME FORMAT |
EricLew | 0:80ee8f3b695e | 322 | * @{ |
EricLew | 0:80ee8f3b695e | 323 | */ |
EricLew | 0:80ee8f3b695e | 324 | #define LL_RTC_TS_TIME_FORMAT_AM (uint32_t)0x00000000 /*!< AM or 24-hour format */ |
EricLew | 0:80ee8f3b695e | 325 | #define LL_RTC_TS_TIME_FORMAT_PM RTC_TSTR_PM /*!< PM */ |
EricLew | 0:80ee8f3b695e | 326 | /** |
EricLew | 0:80ee8f3b695e | 327 | * @} |
EricLew | 0:80ee8f3b695e | 328 | */ |
EricLew | 0:80ee8f3b695e | 329 | |
EricLew | 0:80ee8f3b695e | 330 | /** @defgroup RTC_LL_EC_TAMPER TAMPER |
EricLew | 0:80ee8f3b695e | 331 | * @{ |
EricLew | 0:80ee8f3b695e | 332 | */ |
EricLew | 0:80ee8f3b695e | 333 | #define LL_RTC_TAMPER_1 RTC_TAMPCR_TAMP1E /*!< RTC_TAMP1 input detection */ |
EricLew | 0:80ee8f3b695e | 334 | #define LL_RTC_TAMPER_2 RTC_TAMPCR_TAMP2E /*!< RTC_TAMP2 input detection */ |
EricLew | 0:80ee8f3b695e | 335 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 336 | #define LL_RTC_TAMPER_3 RTC_TAMPCR_TAMP3E /*!< RTC_TAMP3 input detection */ |
EricLew | 0:80ee8f3b695e | 337 | #endif /* RTC_FEATURE_TAMPER3 */ |
EricLew | 0:80ee8f3b695e | 338 | /** |
EricLew | 0:80ee8f3b695e | 339 | * @} |
EricLew | 0:80ee8f3b695e | 340 | */ |
EricLew | 0:80ee8f3b695e | 341 | |
EricLew | 0:80ee8f3b695e | 342 | /** @defgroup RTC_LL_EC_TAMPER_MASK TAMPER MASK |
EricLew | 0:80ee8f3b695e | 343 | * @{ |
EricLew | 0:80ee8f3b695e | 344 | */ |
EricLew | 0:80ee8f3b695e | 345 | #define LL_RTC_TAMPER_MASK_TAMPER1 RTC_TAMPCR_TAMP1MF /*!< Tamper 1 event generates a trigger event. TAMP1F is masked and internally cleared by hardware.The backup registers are not erased */ |
EricLew | 0:80ee8f3b695e | 346 | #define LL_RTC_TAMPER_MASK_TAMPER2 RTC_TAMPCR_TAMP2MF /*!< Tamper 2 event generates a trigger event. TAMP2F is masked and internally cleared by hardware. The backup registers are not erased. */ |
EricLew | 0:80ee8f3b695e | 347 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 348 | #define LL_RTC_TAMPER_MASK_TAMPER3 RTC_TAMPCR_TAMP3MF /*!< Tamper 3 event generates a trigger event. TAMP3F is masked and internally cleared by hardware. The backup registers are not erased */ |
EricLew | 0:80ee8f3b695e | 349 | #endif |
EricLew | 0:80ee8f3b695e | 350 | /** |
EricLew | 0:80ee8f3b695e | 351 | * @} |
EricLew | 0:80ee8f3b695e | 352 | */ |
EricLew | 0:80ee8f3b695e | 353 | |
EricLew | 0:80ee8f3b695e | 354 | /** @defgroup RTC_LL_EC_TAMPER_NOERASE TAMPER NOERASE |
EricLew | 0:80ee8f3b695e | 355 | * @{ |
EricLew | 0:80ee8f3b695e | 356 | */ |
EricLew | 0:80ee8f3b695e | 357 | #define LL_RTC_TAMPER_NOERASE_TAMPER1 RTC_TAMPCR_TAMP1NOERASE /*!< Tamper 1 event does not erase the backup registers. */ |
EricLew | 0:80ee8f3b695e | 358 | #define LL_RTC_TAMPER_NOERASE_TAMPER2 RTC_TAMPCR_TAMP2NOERASE /*!< Tamper 2 event does not erase the backup registers. */ |
EricLew | 0:80ee8f3b695e | 359 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 360 | #define LL_RTC_TAMPER_NOERASE_TAMPER3 RTC_TAMPCR_TAMP3NOERASE /*!< Tamper 3 event does not erase the backup registers. */ |
EricLew | 0:80ee8f3b695e | 361 | #endif |
EricLew | 0:80ee8f3b695e | 362 | /** |
EricLew | 0:80ee8f3b695e | 363 | * @} |
EricLew | 0:80ee8f3b695e | 364 | */ |
EricLew | 0:80ee8f3b695e | 365 | |
EricLew | 0:80ee8f3b695e | 366 | /** @defgroup RTC_LL_EC_TAMPER_DURATION TAMPER DURATION |
EricLew | 0:80ee8f3b695e | 367 | * @{ |
EricLew | 0:80ee8f3b695e | 368 | */ |
EricLew | 0:80ee8f3b695e | 369 | #define LL_RTC_TAMPER_DURATION_1RTCCLK ((uint32_t)0x00000000) /*!< Tamper pins are pre-charged before sampling during 1 RTCCLK cycle */ |
EricLew | 0:80ee8f3b695e | 370 | #define LL_RTC_TAMPER_DURATION_2RTCCLK RTC_TAMPCR_TAMPPRCH_0 /*!< Tamper pins are pre-charged before sampling during 2 RTCCLK cycles */ |
EricLew | 0:80ee8f3b695e | 371 | #define LL_RTC_TAMPER_DURATION_4RTCCLK RTC_TAMPCR_TAMPPRCH_1 /*!< Tamper pins are pre-charged before sampling during 4 RTCCLK cycles */ |
EricLew | 0:80ee8f3b695e | 372 | #define LL_RTC_TAMPER_DURATION_8RTCCLK RTC_TAMPCR_TAMPPRCH /*!< Tamper pins are pre-charged before sampling during 8 RTCCLK cycles */ |
EricLew | 0:80ee8f3b695e | 373 | /** |
EricLew | 0:80ee8f3b695e | 374 | * @} |
EricLew | 0:80ee8f3b695e | 375 | */ |
EricLew | 0:80ee8f3b695e | 376 | |
EricLew | 0:80ee8f3b695e | 377 | /** @defgroup RTC_LL_EC_TAMPER_FILTER TAMPER FILTER |
EricLew | 0:80ee8f3b695e | 378 | * @{ |
EricLew | 0:80ee8f3b695e | 379 | */ |
EricLew | 0:80ee8f3b695e | 380 | #define LL_RTC_TAMPER_FILTER_DISABLE ((uint32_t)0x00000000) /*!< Tamper filter is disabled */ |
EricLew | 0:80ee8f3b695e | 381 | #define LL_RTC_TAMPER_FILTER_2SAMPLE RTC_TAMPCR_TAMPFLT_0 /*!< Tamper is activated after 2 consecutive samples at the active level */ |
EricLew | 0:80ee8f3b695e | 382 | #define LL_RTC_TAMPER_FILTER_4SAMPLE RTC_TAMPCR_TAMPFLT_1 /*!< Tamper is activated after 4 consecutive samples at the active level */ |
EricLew | 0:80ee8f3b695e | 383 | #define LL_RTC_TAMPER_FILTER_8SAMPLE RTC_TAMPCR_TAMPFLT /*!< Tamper is activated after 8 consecutive samples at the active level. */ |
EricLew | 0:80ee8f3b695e | 384 | /** |
EricLew | 0:80ee8f3b695e | 385 | * @} |
EricLew | 0:80ee8f3b695e | 386 | */ |
EricLew | 0:80ee8f3b695e | 387 | |
EricLew | 0:80ee8f3b695e | 388 | /** @defgroup RTC_LL_EC_TAMPER_SAMPLFREQDIV TAMPER SAMPLFREQDIV |
EricLew | 0:80ee8f3b695e | 389 | * @{ |
EricLew | 0:80ee8f3b695e | 390 | */ |
EricLew | 0:80ee8f3b695e | 391 | #define LL_RTC_TAMPER_SAMPLFREQDIV_32768 ((uint32_t)0x00000000) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 32768 */ |
EricLew | 0:80ee8f3b695e | 392 | #define LL_RTC_TAMPER_SAMPLFREQDIV_16384 RTC_TAMPCR_TAMPFREQ_0 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 16384 */ |
EricLew | 0:80ee8f3b695e | 393 | #define LL_RTC_TAMPER_SAMPLFREQDIV_8192 RTC_TAMPCR_TAMPFREQ_1 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 8192 */ |
EricLew | 0:80ee8f3b695e | 394 | #define LL_RTC_TAMPER_SAMPLFREQDIV_4096 (RTC_TAMPCR_TAMPFREQ_1 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 4096 */ |
EricLew | 0:80ee8f3b695e | 395 | #define LL_RTC_TAMPER_SAMPLFREQDIV_2048 RTC_TAMPCR_TAMPFREQ_2 /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 2048 */ |
EricLew | 0:80ee8f3b695e | 396 | #define LL_RTC_TAMPER_SAMPLFREQDIV_1024 (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_0) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 1024 */ |
EricLew | 0:80ee8f3b695e | 397 | #define LL_RTC_TAMPER_SAMPLFREQDIV_512 (RTC_TAMPCR_TAMPFREQ_2 | RTC_TAMPCR_TAMPFREQ_1) /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 512 */ |
EricLew | 0:80ee8f3b695e | 398 | #define LL_RTC_TAMPER_SAMPLFREQDIV_256 RTC_TAMPCR_TAMPFREQ /*!< Each of the tamper inputs are sampled with a frequency = RTCCLK / 256 */ |
EricLew | 0:80ee8f3b695e | 399 | /** |
EricLew | 0:80ee8f3b695e | 400 | * @} |
EricLew | 0:80ee8f3b695e | 401 | */ |
EricLew | 0:80ee8f3b695e | 402 | |
EricLew | 0:80ee8f3b695e | 403 | /** @defgroup RTC_LL_EC_TAMPER_ACTIVELEVEL TAMPER ACTIVELEVEL |
EricLew | 0:80ee8f3b695e | 404 | * @{ |
EricLew | 0:80ee8f3b695e | 405 | */ |
EricLew | 0:80ee8f3b695e | 406 | #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 RTC_TAMPCR_TAMP1TRG /*!< RTC_TAMP1 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/ |
EricLew | 0:80ee8f3b695e | 407 | #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 RTC_TAMPCR_TAMP2TRG /*!< RTC_TAMP2 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/ |
EricLew | 0:80ee8f3b695e | 408 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 409 | #define LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 RTC_TAMPCR_TAMP3TRG /*!< RTC_TAMP3 input falling edge (if TAMPFLT = 00) or staying high (if TAMPFLT != 00) triggers a tamper detection event*/ |
EricLew | 0:80ee8f3b695e | 410 | #endif |
EricLew | 0:80ee8f3b695e | 411 | /** |
EricLew | 0:80ee8f3b695e | 412 | * @} |
EricLew | 0:80ee8f3b695e | 413 | */ |
EricLew | 0:80ee8f3b695e | 414 | |
EricLew | 0:80ee8f3b695e | 415 | /** @defgroup RTC_LL_EC_WAKEUPCLOCK_DIV WAKEUPCLOCK DIV |
EricLew | 0:80ee8f3b695e | 416 | * @{ |
EricLew | 0:80ee8f3b695e | 417 | */ |
EricLew | 0:80ee8f3b695e | 418 | #define LL_RTC_WAKEUPCLOCK_DIV_16 ((uint32_t)0x00000000) /*!< RTC/16 clock is selected */ |
EricLew | 0:80ee8f3b695e | 419 | #define LL_RTC_WAKEUPCLOCK_DIV_8 (RTC_CR_WUCKSEL_0) /*!< RTC/8 clock is selected */ |
EricLew | 0:80ee8f3b695e | 420 | #define LL_RTC_WAKEUPCLOCK_DIV_4 (RTC_CR_WUCKSEL_1) /*!< RTC/4 clock is selected */ |
EricLew | 0:80ee8f3b695e | 421 | #define LL_RTC_WAKEUPCLOCK_DIV_2 (RTC_CR_WUCKSEL_1 | RTC_CR_WUCKSEL_0) /*!< RTC/2 clock is selected */ |
EricLew | 0:80ee8f3b695e | 422 | #define LL_RTC_WAKEUPCLOCK_CKSPRE (RTC_CR_WUCKSEL_2) /*!< ck_spre (usually 1 Hz) clock is selected */ |
EricLew | 0:80ee8f3b695e | 423 | #define LL_RTC_WAKEUPCLOCK_CKSPRE_WUT (RTC_CR_WUCKSEL_2 | RTC_CR_WUCKSEL_1) /*!< ck_spre (usually 1 Hz) clock is selected and 2exp16 is added to the WUT counter value*/ |
EricLew | 0:80ee8f3b695e | 424 | /** |
EricLew | 0:80ee8f3b695e | 425 | * @} |
EricLew | 0:80ee8f3b695e | 426 | */ |
EricLew | 0:80ee8f3b695e | 427 | |
EricLew | 0:80ee8f3b695e | 428 | /** @defgroup RTC_LL_EC_BKP BKP |
EricLew | 0:80ee8f3b695e | 429 | * @{ |
EricLew | 0:80ee8f3b695e | 430 | */ |
EricLew | 0:80ee8f3b695e | 431 | #define LL_RTC_BKP_DR0 ((uint32_t)0x00000000) |
EricLew | 0:80ee8f3b695e | 432 | #define LL_RTC_BKP_DR1 ((uint32_t)0x00000001) |
EricLew | 0:80ee8f3b695e | 433 | #define LL_RTC_BKP_DR2 ((uint32_t)0x00000002) |
EricLew | 0:80ee8f3b695e | 434 | #define LL_RTC_BKP_DR3 ((uint32_t)0x00000003) |
EricLew | 0:80ee8f3b695e | 435 | #define LL_RTC_BKP_DR4 ((uint32_t)0x00000004) |
EricLew | 0:80ee8f3b695e | 436 | #define LL_RTC_BKP_DR5 ((uint32_t)0x00000005) |
EricLew | 0:80ee8f3b695e | 437 | #define LL_RTC_BKP_DR6 ((uint32_t)0x00000006) |
EricLew | 0:80ee8f3b695e | 438 | #define LL_RTC_BKP_DR7 ((uint32_t)0x00000007) |
EricLew | 0:80ee8f3b695e | 439 | #define LL_RTC_BKP_DR8 ((uint32_t)0x00000008) |
EricLew | 0:80ee8f3b695e | 440 | #define LL_RTC_BKP_DR9 ((uint32_t)0x00000009) |
EricLew | 0:80ee8f3b695e | 441 | #define LL_RTC_BKP_DR10 ((uint32_t)0x0000000A) |
EricLew | 0:80ee8f3b695e | 442 | #define LL_RTC_BKP_DR11 ((uint32_t)0x0000000B) |
EricLew | 0:80ee8f3b695e | 443 | #define LL_RTC_BKP_DR12 ((uint32_t)0x0000000C) |
EricLew | 0:80ee8f3b695e | 444 | #define LL_RTC_BKP_DR13 ((uint32_t)0x0000000D) |
EricLew | 0:80ee8f3b695e | 445 | #define LL_RTC_BKP_DR14 ((uint32_t)0x0000000E) |
EricLew | 0:80ee8f3b695e | 446 | #define LL_RTC_BKP_DR15 ((uint32_t)0x0000000F) |
EricLew | 0:80ee8f3b695e | 447 | #define LL_RTC_BKP_DR16 ((uint32_t)0x00000010) |
EricLew | 0:80ee8f3b695e | 448 | #define LL_RTC_BKP_DR17 ((uint32_t)0x00000011) |
EricLew | 0:80ee8f3b695e | 449 | #define LL_RTC_BKP_DR18 ((uint32_t)0x00000012) |
EricLew | 0:80ee8f3b695e | 450 | #define LL_RTC_BKP_DR19 ((uint32_t)0x00000013) |
EricLew | 0:80ee8f3b695e | 451 | #define LL_RTC_BKP_DR20 ((uint32_t)0x00000014) |
EricLew | 0:80ee8f3b695e | 452 | #define LL_RTC_BKP_DR21 ((uint32_t)0x00000015) |
EricLew | 0:80ee8f3b695e | 453 | #define LL_RTC_BKP_DR22 ((uint32_t)0x00000016) |
EricLew | 0:80ee8f3b695e | 454 | #define LL_RTC_BKP_DR23 ((uint32_t)0x00000017) |
EricLew | 0:80ee8f3b695e | 455 | #define LL_RTC_BKP_DR24 ((uint32_t)0x00000018) |
EricLew | 0:80ee8f3b695e | 456 | #define LL_RTC_BKP_DR25 ((uint32_t)0x00000019) |
EricLew | 0:80ee8f3b695e | 457 | #define LL_RTC_BKP_DR26 ((uint32_t)0x0000001A) |
EricLew | 0:80ee8f3b695e | 458 | #define LL_RTC_BKP_DR27 ((uint32_t)0x0000001B) |
EricLew | 0:80ee8f3b695e | 459 | #define LL_RTC_BKP_DR28 ((uint32_t)0x0000001C) |
EricLew | 0:80ee8f3b695e | 460 | #define LL_RTC_BKP_DR29 ((uint32_t)0x0000001D) |
EricLew | 0:80ee8f3b695e | 461 | #define LL_RTC_BKP_DR30 ((uint32_t)0x0000001E) |
EricLew | 0:80ee8f3b695e | 462 | #define LL_RTC_BKP_DR31 ((uint32_t)0x0000001F) |
EricLew | 0:80ee8f3b695e | 463 | /** |
EricLew | 0:80ee8f3b695e | 464 | * @} |
EricLew | 0:80ee8f3b695e | 465 | */ |
EricLew | 0:80ee8f3b695e | 466 | |
EricLew | 0:80ee8f3b695e | 467 | /** @defgroup RTC_LL_EC_CALIB_OUTPUT CALIB OUTPUT |
EricLew | 0:80ee8f3b695e | 468 | * @{ |
EricLew | 0:80ee8f3b695e | 469 | */ |
EricLew | 0:80ee8f3b695e | 470 | #define LL_RTC_CALIB_OUTPUT_NONE (uint32_t)0x00000000 /*!< Calibration output disabled */ |
EricLew | 0:80ee8f3b695e | 471 | #define LL_RTC_CALIB_OUTPUT_1HZ (RTC_CR_COE | RTC_CR_COSEL) /*!< Calibration output is 512 Hz */ |
EricLew | 0:80ee8f3b695e | 472 | #define LL_RTC_CALIB_OUTPUT_512HZ (RTC_CR_COE) /*!< Calibration output is 1 Hz */ |
EricLew | 0:80ee8f3b695e | 473 | /** |
EricLew | 0:80ee8f3b695e | 474 | * @} |
EricLew | 0:80ee8f3b695e | 475 | */ |
EricLew | 0:80ee8f3b695e | 476 | |
EricLew | 0:80ee8f3b695e | 477 | /** @defgroup RTC_LL_EC_CALIB_INSERTPULSE CALIB INSERTPULSE |
EricLew | 0:80ee8f3b695e | 478 | * @{ |
EricLew | 0:80ee8f3b695e | 479 | */ |
EricLew | 0:80ee8f3b695e | 480 | #define LL_RTC_CALIB_INSERTPULSE_NONE (uint32_t)0x00000000 /*!< No RTCCLK pulses are added */ |
EricLew | 0:80ee8f3b695e | 481 | #define LL_RTC_CALIB_INSERTPULSE_SET RTC_CALR_CALP /*!< One RTCCLK pulse is effectively inserted every 2exp11 pulses (frequency increased by 488.5 ppm) */ |
EricLew | 0:80ee8f3b695e | 482 | /** |
EricLew | 0:80ee8f3b695e | 483 | * @} |
EricLew | 0:80ee8f3b695e | 484 | */ |
EricLew | 0:80ee8f3b695e | 485 | |
EricLew | 0:80ee8f3b695e | 486 | /** @defgroup RTC_LL_EC_CALIB_PERIOD CALIB PERIOD |
EricLew | 0:80ee8f3b695e | 487 | * @{ |
EricLew | 0:80ee8f3b695e | 488 | */ |
EricLew | 0:80ee8f3b695e | 489 | #define LL_RTC_CALIB_PERIOD_32SEC (uint32_t)0x00000000 /*!< Use a 32-second calibration cycle period */ |
EricLew | 0:80ee8f3b695e | 490 | #define LL_RTC_CALIB_PERIOD_16SEC RTC_CALR_CALW16 /*!< Use a 16-second calibration cycle period */ |
EricLew | 0:80ee8f3b695e | 491 | #define LL_RTC_CALIB_PERIOD_8SEC RTC_CALR_CALW8 /*!< Use a 8-second calibration cycle period */ |
EricLew | 0:80ee8f3b695e | 492 | /** |
EricLew | 0:80ee8f3b695e | 493 | * @} |
EricLew | 0:80ee8f3b695e | 494 | */ |
EricLew | 0:80ee8f3b695e | 495 | |
EricLew | 0:80ee8f3b695e | 496 | /** |
EricLew | 0:80ee8f3b695e | 497 | * @} |
EricLew | 0:80ee8f3b695e | 498 | */ |
EricLew | 0:80ee8f3b695e | 499 | |
EricLew | 0:80ee8f3b695e | 500 | /* Exported macro ------------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 501 | /** @defgroup RTC_LL_Exported_Macros RTC Exported Macros |
EricLew | 0:80ee8f3b695e | 502 | * @{ |
EricLew | 0:80ee8f3b695e | 503 | */ |
EricLew | 0:80ee8f3b695e | 504 | |
EricLew | 0:80ee8f3b695e | 505 | /** @defgroup RTC_LL_EM_WRITE_READ Common Write and read registers Macros |
EricLew | 0:80ee8f3b695e | 506 | * @{ |
EricLew | 0:80ee8f3b695e | 507 | */ |
EricLew | 0:80ee8f3b695e | 508 | |
EricLew | 0:80ee8f3b695e | 509 | /** |
EricLew | 0:80ee8f3b695e | 510 | * @brief Write a value in RTC register |
EricLew | 0:80ee8f3b695e | 511 | * @param __INSTANCE__ RTC Instance |
EricLew | 0:80ee8f3b695e | 512 | * @param __REG__ Register to be written |
EricLew | 0:80ee8f3b695e | 513 | * @param __VALUE__ Value to be written in the register |
EricLew | 0:80ee8f3b695e | 514 | * @retval None |
EricLew | 0:80ee8f3b695e | 515 | */ |
EricLew | 0:80ee8f3b695e | 516 | #define LL_RTC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__)) |
EricLew | 0:80ee8f3b695e | 517 | |
EricLew | 0:80ee8f3b695e | 518 | /** |
EricLew | 0:80ee8f3b695e | 519 | * @brief Read a value in RTC register |
EricLew | 0:80ee8f3b695e | 520 | * @param __INSTANCE__ RTC Instance |
EricLew | 0:80ee8f3b695e | 521 | * @param __REG__ Register to be read |
EricLew | 0:80ee8f3b695e | 522 | * @retval Register value |
EricLew | 0:80ee8f3b695e | 523 | */ |
EricLew | 0:80ee8f3b695e | 524 | #define LL_RTC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) |
EricLew | 0:80ee8f3b695e | 525 | /** |
EricLew | 0:80ee8f3b695e | 526 | * @} |
EricLew | 0:80ee8f3b695e | 527 | */ |
EricLew | 0:80ee8f3b695e | 528 | |
EricLew | 0:80ee8f3b695e | 529 | /** @defgroup RTC_LL_EM_Convert Convert helper Macros |
EricLew | 0:80ee8f3b695e | 530 | * @{ |
EricLew | 0:80ee8f3b695e | 531 | */ |
EricLew | 0:80ee8f3b695e | 532 | |
EricLew | 0:80ee8f3b695e | 533 | /** |
EricLew | 0:80ee8f3b695e | 534 | * @brief Helper macro to convert a value from 2 digit decimal format to BCD format |
EricLew | 0:80ee8f3b695e | 535 | * @param __VALUE__ Byte to be converted |
EricLew | 0:80ee8f3b695e | 536 | * @retval Converted byte |
EricLew | 0:80ee8f3b695e | 537 | */ |
EricLew | 0:80ee8f3b695e | 538 | #define __LL_RTC_CONVERT_BIN2BCD(__VALUE__) (uint8_t)((((__VALUE__) / 10) << 4) | ((__VALUE__) % 10)) |
EricLew | 0:80ee8f3b695e | 539 | |
EricLew | 0:80ee8f3b695e | 540 | /** |
EricLew | 0:80ee8f3b695e | 541 | * @brief Helper macro to convert a value from BCD format to 2 digit decimal format |
EricLew | 0:80ee8f3b695e | 542 | * @param __VALUE__ BCD value to be converted |
EricLew | 0:80ee8f3b695e | 543 | * @retval Converted byte |
EricLew | 0:80ee8f3b695e | 544 | */ |
EricLew | 0:80ee8f3b695e | 545 | #define __LL_RTC_CONVERT_BCD2BIN(__VALUE__) (uint8_t)(((uint8_t)((__VALUE__) & (uint8_t)0xF0) >> (uint8_t)0x4) * 10 + ((__VALUE__) & (uint8_t)0x0F)) |
EricLew | 0:80ee8f3b695e | 546 | |
EricLew | 0:80ee8f3b695e | 547 | /** |
EricLew | 0:80ee8f3b695e | 548 | * @} |
EricLew | 0:80ee8f3b695e | 549 | */ |
EricLew | 0:80ee8f3b695e | 550 | |
EricLew | 0:80ee8f3b695e | 551 | /** @defgroup RTC_LL_EM_Date Date helper Macros |
EricLew | 0:80ee8f3b695e | 552 | * @{ |
EricLew | 0:80ee8f3b695e | 553 | */ |
EricLew | 0:80ee8f3b695e | 554 | |
EricLew | 0:80ee8f3b695e | 555 | /** |
EricLew | 0:80ee8f3b695e | 556 | * @brief Helper macro to retrieve weekday. |
EricLew | 0:80ee8f3b695e | 557 | * @param __RTC_DATE__ Date returned by @ref LL_RTC_DATE_Get function. |
EricLew | 0:80ee8f3b695e | 558 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 559 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 560 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 561 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 562 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 563 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 564 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 565 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 566 | */ |
EricLew | 0:80ee8f3b695e | 567 | #define __LL_RTC_GET_WEEKDAY(__RTC_DATE__) (((__RTC_DATE__) >> RTC_OFFSET_WEEKDAY) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 568 | |
EricLew | 0:80ee8f3b695e | 569 | /** |
EricLew | 0:80ee8f3b695e | 570 | * @brief Helper macro to retrieve Year in BCD format |
EricLew | 0:80ee8f3b695e | 571 | * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get |
EricLew | 0:80ee8f3b695e | 572 | * @retval Year in BCD format (0x00 . . . 0x99) |
EricLew | 0:80ee8f3b695e | 573 | */ |
EricLew | 0:80ee8f3b695e | 574 | #define __LL_RTC_GET_YEAR(__RTC_DATE__) ((__RTC_DATE__) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 575 | |
EricLew | 0:80ee8f3b695e | 576 | /** |
EricLew | 0:80ee8f3b695e | 577 | * @brief Helper macro to retrieve Month in BCD format |
EricLew | 0:80ee8f3b695e | 578 | * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get |
EricLew | 0:80ee8f3b695e | 579 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 580 | * @arg @ref LL_RTC_MONTH_JANUARY |
EricLew | 0:80ee8f3b695e | 581 | * @arg @ref LL_RTC_MONTH_FEBRUARY |
EricLew | 0:80ee8f3b695e | 582 | * @arg @ref LL_RTC_MONTH_MARCH |
EricLew | 0:80ee8f3b695e | 583 | * @arg @ref LL_RTC_MONTH_APRIL |
EricLew | 0:80ee8f3b695e | 584 | * @arg @ref LL_RTC_MONTH_MAY |
EricLew | 0:80ee8f3b695e | 585 | * @arg @ref LL_RTC_MONTH_JUNE |
EricLew | 0:80ee8f3b695e | 586 | * @arg @ref LL_RTC_MONTH_JULY |
EricLew | 0:80ee8f3b695e | 587 | * @arg @ref LL_RTC_MONTH_AUGUST |
EricLew | 0:80ee8f3b695e | 588 | * @arg @ref LL_RTC_MONTH_SEPTEMBER |
EricLew | 0:80ee8f3b695e | 589 | * @arg @ref LL_RTC_MONTH_OCTOBER |
EricLew | 0:80ee8f3b695e | 590 | * @arg @ref LL_RTC_MONTH_NOVEMBER |
EricLew | 0:80ee8f3b695e | 591 | * @arg @ref LL_RTC_MONTH_DECEMBER |
EricLew | 0:80ee8f3b695e | 592 | */ |
EricLew | 0:80ee8f3b695e | 593 | #define __LL_RTC_GET_MONTH(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_MONTH) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 594 | |
EricLew | 0:80ee8f3b695e | 595 | /** |
EricLew | 0:80ee8f3b695e | 596 | * @brief Helper macro to retrieve Day in BCD format |
EricLew | 0:80ee8f3b695e | 597 | * @param __RTC_DATE__ Value returned by @ref LL_RTC_DATE_Get |
EricLew | 0:80ee8f3b695e | 598 | * @retval Day in BCD format (0x01 . . . 0x31) |
EricLew | 0:80ee8f3b695e | 599 | */ |
EricLew | 0:80ee8f3b695e | 600 | #define __LL_RTC_GET_DAY(__RTC_DATE__) (((__RTC_DATE__) >>RTC_OFFSET_DAY) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 601 | |
EricLew | 0:80ee8f3b695e | 602 | /** |
EricLew | 0:80ee8f3b695e | 603 | * @} |
EricLew | 0:80ee8f3b695e | 604 | */ |
EricLew | 0:80ee8f3b695e | 605 | |
EricLew | 0:80ee8f3b695e | 606 | /** @defgroup RTC_LL_EM_Time Time helper Macros |
EricLew | 0:80ee8f3b695e | 607 | * @{ |
EricLew | 0:80ee8f3b695e | 608 | */ |
EricLew | 0:80ee8f3b695e | 609 | |
EricLew | 0:80ee8f3b695e | 610 | /** |
EricLew | 0:80ee8f3b695e | 611 | * @brief Helper macro to retrieve hour in BCD format |
EricLew | 0:80ee8f3b695e | 612 | * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function |
EricLew | 0:80ee8f3b695e | 613 | * @retval Hour in BCD format (0x01. . .0x12 or 0x00. . .0x23) |
EricLew | 0:80ee8f3b695e | 614 | */ |
EricLew | 0:80ee8f3b695e | 615 | #define __LL_RTC_GET_HOUR(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_HOUR) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 616 | |
EricLew | 0:80ee8f3b695e | 617 | /** |
EricLew | 0:80ee8f3b695e | 618 | * @brief Helper macro to retrieve minute in BCD format |
EricLew | 0:80ee8f3b695e | 619 | * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function |
EricLew | 0:80ee8f3b695e | 620 | * @retval Minute in BCD format (0x00. . .0x59) |
EricLew | 0:80ee8f3b695e | 621 | */ |
EricLew | 0:80ee8f3b695e | 622 | #define __LL_RTC_GET_MINUTE(__RTC_TIME__) (((__RTC_TIME__) >> RTC_OFFSET_MINUTE) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 623 | |
EricLew | 0:80ee8f3b695e | 624 | /** |
EricLew | 0:80ee8f3b695e | 625 | * @brief Helper macro to retrieve second in BCD format |
EricLew | 0:80ee8f3b695e | 626 | * @param __RTC_TIME__ RTC time returned by @ref LL_RTC_TIME_Get function |
EricLew | 0:80ee8f3b695e | 627 | * @retval Second in format (0x00. . .0x59) |
EricLew | 0:80ee8f3b695e | 628 | */ |
EricLew | 0:80ee8f3b695e | 629 | #define __LL_RTC_GET_SECOND(__RTC_TIME__) ((__RTC_TIME__) & 0x000000FF) |
EricLew | 0:80ee8f3b695e | 630 | |
EricLew | 0:80ee8f3b695e | 631 | /** |
EricLew | 0:80ee8f3b695e | 632 | * @} |
EricLew | 0:80ee8f3b695e | 633 | */ |
EricLew | 0:80ee8f3b695e | 634 | |
EricLew | 0:80ee8f3b695e | 635 | /** |
EricLew | 0:80ee8f3b695e | 636 | * @} |
EricLew | 0:80ee8f3b695e | 637 | */ |
EricLew | 0:80ee8f3b695e | 638 | |
EricLew | 0:80ee8f3b695e | 639 | /* Exported functions --------------------------------------------------------*/ |
EricLew | 0:80ee8f3b695e | 640 | /** @defgroup RTC_LL_Exported_Functions RTC Exported Functions |
EricLew | 0:80ee8f3b695e | 641 | * @{ |
EricLew | 0:80ee8f3b695e | 642 | */ |
EricLew | 0:80ee8f3b695e | 643 | |
EricLew | 0:80ee8f3b695e | 644 | /** @defgroup RTC_LL_EF_Configuration Configuration |
EricLew | 0:80ee8f3b695e | 645 | * @{ |
EricLew | 0:80ee8f3b695e | 646 | */ |
EricLew | 0:80ee8f3b695e | 647 | |
EricLew | 0:80ee8f3b695e | 648 | /** |
EricLew | 0:80ee8f3b695e | 649 | * @brief Set Hour format (24 hour/day or AM/PM hour format) |
EricLew | 0:80ee8f3b695e | 650 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 651 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 652 | * @rmtoll CR FMT LL_RTC_SetHourFormat |
EricLew | 0:80ee8f3b695e | 653 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 654 | * @param Format This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 655 | * @arg @ref LL_RTC_HOURFORMAT_24HOUR |
EricLew | 0:80ee8f3b695e | 656 | * @arg @ref LL_RTC_HOURFORMAT_AMPM |
EricLew | 0:80ee8f3b695e | 657 | * @retval None |
EricLew | 0:80ee8f3b695e | 658 | */ |
EricLew | 0:80ee8f3b695e | 659 | __STATIC_INLINE void LL_RTC_SetHourFormat(RTC_TypeDef *RTCx, uint32_t Format) |
EricLew | 0:80ee8f3b695e | 660 | { |
EricLew | 0:80ee8f3b695e | 661 | MODIFY_REG(RTCx->CR, RTC_CR_FMT, Format); |
EricLew | 0:80ee8f3b695e | 662 | } |
EricLew | 0:80ee8f3b695e | 663 | |
EricLew | 0:80ee8f3b695e | 664 | /** |
EricLew | 0:80ee8f3b695e | 665 | * @brief Get Hour format (24 hour/day or AM/PM hour format) |
EricLew | 0:80ee8f3b695e | 666 | * @rmtoll CR FMT LL_RTC_GetHourFormat |
EricLew | 0:80ee8f3b695e | 667 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 668 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 669 | * @arg @ref LL_RTC_HOURFORMAT_24HOUR |
EricLew | 0:80ee8f3b695e | 670 | * @arg @ref LL_RTC_HOURFORMAT_AMPM |
EricLew | 0:80ee8f3b695e | 671 | */ |
EricLew | 0:80ee8f3b695e | 672 | __STATIC_INLINE uint32_t LL_RTC_GetHourFormat(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 673 | { |
EricLew | 0:80ee8f3b695e | 674 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_FMT)); |
EricLew | 0:80ee8f3b695e | 675 | } |
EricLew | 0:80ee8f3b695e | 676 | |
EricLew | 0:80ee8f3b695e | 677 | /** |
EricLew | 0:80ee8f3b695e | 678 | * @brief Select the flag to be routed to RTC_ALARM output |
EricLew | 0:80ee8f3b695e | 679 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 680 | * @rmtoll CR OSEL LL_RTC_SetAlarmOutEvent |
EricLew | 0:80ee8f3b695e | 681 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 682 | * @param AlarmOutput This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 683 | * @arg @ref LL_RTC_ALARMOUT_DISABLE |
EricLew | 0:80ee8f3b695e | 684 | * @arg @ref LL_RTC_ALARMOUT_ALMA |
EricLew | 0:80ee8f3b695e | 685 | * @arg @ref LL_RTC_ALARMOUT_ALMB |
EricLew | 0:80ee8f3b695e | 686 | * @arg @ref LL_RTC_ALARMOUT_WAKEUP |
EricLew | 0:80ee8f3b695e | 687 | * @retval None |
EricLew | 0:80ee8f3b695e | 688 | */ |
EricLew | 0:80ee8f3b695e | 689 | __STATIC_INLINE void LL_RTC_SetAlarmOutEvent(RTC_TypeDef *RTCx, uint32_t AlarmOutput) |
EricLew | 0:80ee8f3b695e | 690 | { |
EricLew | 0:80ee8f3b695e | 691 | MODIFY_REG(RTCx->CR, RTC_CR_OSEL, AlarmOutput); |
EricLew | 0:80ee8f3b695e | 692 | } |
EricLew | 0:80ee8f3b695e | 693 | |
EricLew | 0:80ee8f3b695e | 694 | /** |
EricLew | 0:80ee8f3b695e | 695 | * @brief Get the flag to be routed to RTC_ALARM output |
EricLew | 0:80ee8f3b695e | 696 | * @rmtoll CR OSEL LL_RTC_GetAlarmOutEvent |
EricLew | 0:80ee8f3b695e | 697 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 698 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 699 | * @arg @ref LL_RTC_ALARMOUT_DISABLE |
EricLew | 0:80ee8f3b695e | 700 | * @arg @ref LL_RTC_ALARMOUT_ALMA |
EricLew | 0:80ee8f3b695e | 701 | * @arg @ref LL_RTC_ALARMOUT_ALMB |
EricLew | 0:80ee8f3b695e | 702 | * @arg @ref LL_RTC_ALARMOUT_WAKEUP |
EricLew | 0:80ee8f3b695e | 703 | */ |
EricLew | 0:80ee8f3b695e | 704 | __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutEvent(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 705 | { |
EricLew | 0:80ee8f3b695e | 706 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_OSEL)); |
EricLew | 0:80ee8f3b695e | 707 | } |
EricLew | 0:80ee8f3b695e | 708 | |
EricLew | 0:80ee8f3b695e | 709 | /** |
EricLew | 0:80ee8f3b695e | 710 | * @brief Set RTC_ALARM output type (ALARM in push-pull or open-drain output) |
EricLew | 0:80ee8f3b695e | 711 | * @note used only when RTC_ALARM is mapped on PC13 |
EricLew | 0:80ee8f3b695e | 712 | * @rmtoll OR ALARMOUTTYPE LL_RTC_SetAlarmOutputType |
EricLew | 0:80ee8f3b695e | 713 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 714 | * @param Output This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 715 | * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN |
EricLew | 0:80ee8f3b695e | 716 | * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL |
EricLew | 0:80ee8f3b695e | 717 | * @retval None |
EricLew | 0:80ee8f3b695e | 718 | */ |
EricLew | 0:80ee8f3b695e | 719 | __STATIC_INLINE void LL_RTC_SetAlarmOutputType(RTC_TypeDef *RTCx, uint32_t Output) |
EricLew | 0:80ee8f3b695e | 720 | { |
EricLew | 0:80ee8f3b695e | 721 | MODIFY_REG(RTCx->OR, RTC_OR_ALARMOUTTYPE, Output); |
EricLew | 0:80ee8f3b695e | 722 | } |
EricLew | 0:80ee8f3b695e | 723 | |
EricLew | 0:80ee8f3b695e | 724 | /** |
EricLew | 0:80ee8f3b695e | 725 | * @brief Get RTC_ALARM output type (ALARM in push-pull or open-drain output) |
EricLew | 0:80ee8f3b695e | 726 | * @note used only when RTC_ALARM is mapped on PC13 |
EricLew | 0:80ee8f3b695e | 727 | * @rmtoll OR ALARMOUTTYPE LL_RTC_GetAlarmOutputType |
EricLew | 0:80ee8f3b695e | 728 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 729 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 730 | * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_OPENDRAIN |
EricLew | 0:80ee8f3b695e | 731 | * @arg @ref LL_RTC_ALARM_OUTPUTTYPE_PUSHPULL |
EricLew | 0:80ee8f3b695e | 732 | */ |
EricLew | 0:80ee8f3b695e | 733 | __STATIC_INLINE uint32_t LL_RTC_GetAlarmOutputType(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 734 | { |
EricLew | 0:80ee8f3b695e | 735 | return (uint32_t)(READ_BIT(RTCx->OR, RTC_OR_ALARMOUTTYPE)); |
EricLew | 0:80ee8f3b695e | 736 | } |
EricLew | 0:80ee8f3b695e | 737 | |
EricLew | 0:80ee8f3b695e | 738 | /** |
EricLew | 0:80ee8f3b695e | 739 | * @brief Enable initialization mode (Initialization mode used to program time and date |
EricLew | 0:80ee8f3b695e | 740 | * register (RTC_TR and RTC_DR), and prescaler register (RTC_PRER). |
EricLew | 0:80ee8f3b695e | 741 | * Counters are stopped and start counting from the new value when INIT is |
EricLew | 0:80ee8f3b695e | 742 | * reset. |
EricLew | 0:80ee8f3b695e | 743 | * @rmtoll ISR INIT LL_RTC_EnableInitMode |
EricLew | 0:80ee8f3b695e | 744 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 745 | * @retval None |
EricLew | 0:80ee8f3b695e | 746 | */ |
EricLew | 0:80ee8f3b695e | 747 | __STATIC_INLINE void LL_RTC_EnableInitMode(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 748 | { |
EricLew | 0:80ee8f3b695e | 749 | /* Set the Initialization mode */ |
EricLew | 0:80ee8f3b695e | 750 | WRITE_REG(RTCx->ISR, RTC_INIT_MASK); |
EricLew | 0:80ee8f3b695e | 751 | } |
EricLew | 0:80ee8f3b695e | 752 | |
EricLew | 0:80ee8f3b695e | 753 | /** |
EricLew | 0:80ee8f3b695e | 754 | * @brief Disable initialization mode (Free running mode) |
EricLew | 0:80ee8f3b695e | 755 | * @rmtoll ISR INIT LL_RTC_DisableInitMode |
EricLew | 0:80ee8f3b695e | 756 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 757 | * @retval None |
EricLew | 0:80ee8f3b695e | 758 | */ |
EricLew | 0:80ee8f3b695e | 759 | __STATIC_INLINE void LL_RTC_DisableInitMode(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 760 | { |
EricLew | 0:80ee8f3b695e | 761 | /* Exit Initialization mode */ |
EricLew | 0:80ee8f3b695e | 762 | WRITE_REG(RTCx->ISR, (uint32_t)~RTC_ISR_INIT); |
EricLew | 0:80ee8f3b695e | 763 | } |
EricLew | 0:80ee8f3b695e | 764 | |
EricLew | 0:80ee8f3b695e | 765 | /** |
EricLew | 0:80ee8f3b695e | 766 | * @brief Set Output polarity (pin is low when ALRAF/ALRBF/WUTF is asserted) |
EricLew | 0:80ee8f3b695e | 767 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 768 | * @rmtoll CR POL LL_RTC_SetOutputPolarity |
EricLew | 0:80ee8f3b695e | 769 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 770 | * @param Polarity This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 771 | * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH |
EricLew | 0:80ee8f3b695e | 772 | * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW |
EricLew | 0:80ee8f3b695e | 773 | * @retval None |
EricLew | 0:80ee8f3b695e | 774 | */ |
EricLew | 0:80ee8f3b695e | 775 | __STATIC_INLINE void LL_RTC_SetOutputPolarity(RTC_TypeDef *RTCx, uint32_t Polarity) |
EricLew | 0:80ee8f3b695e | 776 | { |
EricLew | 0:80ee8f3b695e | 777 | MODIFY_REG(RTCx->CR, RTC_CR_POL, Polarity); |
EricLew | 0:80ee8f3b695e | 778 | } |
EricLew | 0:80ee8f3b695e | 779 | |
EricLew | 0:80ee8f3b695e | 780 | /** |
EricLew | 0:80ee8f3b695e | 781 | * @brief Get Output polarity |
EricLew | 0:80ee8f3b695e | 782 | * @rmtoll CR POL LL_RTC_GetOutputPolarity |
EricLew | 0:80ee8f3b695e | 783 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 784 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 785 | * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_HIGH |
EricLew | 0:80ee8f3b695e | 786 | * @arg @ref LL_RTC_OUTPUTPOLARITY_PIN_LOW |
EricLew | 0:80ee8f3b695e | 787 | */ |
EricLew | 0:80ee8f3b695e | 788 | __STATIC_INLINE uint32_t LL_RTC_GetOutputPolarity(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 789 | { |
EricLew | 0:80ee8f3b695e | 790 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_POL)); |
EricLew | 0:80ee8f3b695e | 791 | } |
EricLew | 0:80ee8f3b695e | 792 | |
EricLew | 0:80ee8f3b695e | 793 | /** |
EricLew | 0:80ee8f3b695e | 794 | * @brief Enable Bypass the shadow registers |
EricLew | 0:80ee8f3b695e | 795 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 796 | * @rmtoll CR BYPSHAD LL_RTC_EnableShadowRegBypass |
EricLew | 0:80ee8f3b695e | 797 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 798 | * @retval None |
EricLew | 0:80ee8f3b695e | 799 | */ |
EricLew | 0:80ee8f3b695e | 800 | __STATIC_INLINE void LL_RTC_EnableShadowRegBypass(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 801 | { |
EricLew | 0:80ee8f3b695e | 802 | SET_BIT(RTCx->CR, RTC_CR_BYPSHAD); |
EricLew | 0:80ee8f3b695e | 803 | } |
EricLew | 0:80ee8f3b695e | 804 | |
EricLew | 0:80ee8f3b695e | 805 | /** |
EricLew | 0:80ee8f3b695e | 806 | * @brief Disable Bypass the shadow registers |
EricLew | 0:80ee8f3b695e | 807 | * @rmtoll CR BYPSHAD LL_RTC_DisableShadowRegBypass |
EricLew | 0:80ee8f3b695e | 808 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 809 | * @retval None |
EricLew | 0:80ee8f3b695e | 810 | */ |
EricLew | 0:80ee8f3b695e | 811 | __STATIC_INLINE void LL_RTC_DisableShadowRegBypass(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 812 | { |
EricLew | 0:80ee8f3b695e | 813 | CLEAR_BIT(RTCx->CR, RTC_CR_BYPSHAD); |
EricLew | 0:80ee8f3b695e | 814 | } |
EricLew | 0:80ee8f3b695e | 815 | |
EricLew | 0:80ee8f3b695e | 816 | /** |
EricLew | 0:80ee8f3b695e | 817 | * @brief Check if Shadow registers bypass is enabled or not. |
EricLew | 0:80ee8f3b695e | 818 | * @rmtoll CR BYPSHAD LL_RTC_IsShadowRegBypassEnabled |
EricLew | 0:80ee8f3b695e | 819 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 820 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 821 | */ |
EricLew | 0:80ee8f3b695e | 822 | __STATIC_INLINE uint32_t LL_RTC_IsShadowRegBypassEnabled(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 823 | { |
EricLew | 0:80ee8f3b695e | 824 | return (READ_BIT(RTCx->CR, RTC_CR_BYPSHAD) == (RTC_CR_BYPSHAD)); |
EricLew | 0:80ee8f3b695e | 825 | } |
EricLew | 0:80ee8f3b695e | 826 | |
EricLew | 0:80ee8f3b695e | 827 | /** |
EricLew | 0:80ee8f3b695e | 828 | * @brief Enable RTC_REFIN reference clock detection (50 or 60 Hz) |
EricLew | 0:80ee8f3b695e | 829 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 830 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 831 | * @rmtoll CR REFCKON LL_RTC_EnableRefClock |
EricLew | 0:80ee8f3b695e | 832 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 833 | * @retval None |
EricLew | 0:80ee8f3b695e | 834 | */ |
EricLew | 0:80ee8f3b695e | 835 | __STATIC_INLINE void LL_RTC_EnableRefClock(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 836 | { |
EricLew | 0:80ee8f3b695e | 837 | SET_BIT(RTCx->CR, RTC_CR_REFCKON); |
EricLew | 0:80ee8f3b695e | 838 | } |
EricLew | 0:80ee8f3b695e | 839 | |
EricLew | 0:80ee8f3b695e | 840 | /** |
EricLew | 0:80ee8f3b695e | 841 | * @brief Disable RTC_REFIN reference clock detection (50 or 60 Hz) |
EricLew | 0:80ee8f3b695e | 842 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 843 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 844 | * @rmtoll CR REFCKON LL_RTC_DisableRefClock |
EricLew | 0:80ee8f3b695e | 845 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 846 | * @retval None |
EricLew | 0:80ee8f3b695e | 847 | */ |
EricLew | 0:80ee8f3b695e | 848 | __STATIC_INLINE void LL_RTC_DisableRefClock(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 849 | { |
EricLew | 0:80ee8f3b695e | 850 | CLEAR_BIT(RTCx->CR, RTC_CR_REFCKON); |
EricLew | 0:80ee8f3b695e | 851 | } |
EricLew | 0:80ee8f3b695e | 852 | |
EricLew | 0:80ee8f3b695e | 853 | /** |
EricLew | 0:80ee8f3b695e | 854 | * @brief Set Asynchronous prescaler factor |
EricLew | 0:80ee8f3b695e | 855 | * @rmtoll PRER PREDIV_A LL_RTC_SetAsynchPrescaler |
EricLew | 0:80ee8f3b695e | 856 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 857 | * @param AsynchPrescaler Value between 0 and 0x7F |
EricLew | 0:80ee8f3b695e | 858 | * @retval None |
EricLew | 0:80ee8f3b695e | 859 | */ |
EricLew | 0:80ee8f3b695e | 860 | __STATIC_INLINE void LL_RTC_SetAsynchPrescaler(RTC_TypeDef *RTCx, uint32_t AsynchPrescaler) |
EricLew | 0:80ee8f3b695e | 861 | { |
EricLew | 0:80ee8f3b695e | 862 | MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_A, AsynchPrescaler << RTC_POSITION_PRER_PREDIV_A); |
EricLew | 0:80ee8f3b695e | 863 | } |
EricLew | 0:80ee8f3b695e | 864 | |
EricLew | 0:80ee8f3b695e | 865 | /** |
EricLew | 0:80ee8f3b695e | 866 | * @brief Set Synchronous prescaler factor |
EricLew | 0:80ee8f3b695e | 867 | * @rmtoll PRER PREDIV_S LL_RTC_SetSynchPrescaler |
EricLew | 0:80ee8f3b695e | 868 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 869 | * @param SyncPrescaler Value between 0 and 0x7FFF |
EricLew | 0:80ee8f3b695e | 870 | * @retval None |
EricLew | 0:80ee8f3b695e | 871 | */ |
EricLew | 0:80ee8f3b695e | 872 | __STATIC_INLINE void LL_RTC_SetSynchPrescaler(RTC_TypeDef *RTCx, uint32_t SyncPrescaler) |
EricLew | 0:80ee8f3b695e | 873 | { |
EricLew | 0:80ee8f3b695e | 874 | MODIFY_REG(RTCx->PRER, RTC_PRER_PREDIV_S, SyncPrescaler); |
EricLew | 0:80ee8f3b695e | 875 | } |
EricLew | 0:80ee8f3b695e | 876 | |
EricLew | 0:80ee8f3b695e | 877 | /** |
EricLew | 0:80ee8f3b695e | 878 | * @brief Get Asynchronous prescaler factor |
EricLew | 0:80ee8f3b695e | 879 | * @rmtoll PRER PREDIV_A LL_RTC_GetAsynchPrescaler |
EricLew | 0:80ee8f3b695e | 880 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 881 | * @retval Value between 0 and 0x7F |
EricLew | 0:80ee8f3b695e | 882 | */ |
EricLew | 0:80ee8f3b695e | 883 | __STATIC_INLINE uint32_t LL_RTC_GetAsynchPrescaler(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 884 | { |
EricLew | 0:80ee8f3b695e | 885 | return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_A) >> RTC_POSITION_PRER_PREDIV_A); |
EricLew | 0:80ee8f3b695e | 886 | } |
EricLew | 0:80ee8f3b695e | 887 | |
EricLew | 0:80ee8f3b695e | 888 | /** |
EricLew | 0:80ee8f3b695e | 889 | * @brief Get Synchronous prescaler factor |
EricLew | 0:80ee8f3b695e | 890 | * @rmtoll PRER PREDIV_S LL_RTC_GetSynchPrescaler |
EricLew | 0:80ee8f3b695e | 891 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 892 | * @retval Value between 0 and 0x7FFF |
EricLew | 0:80ee8f3b695e | 893 | */ |
EricLew | 0:80ee8f3b695e | 894 | __STATIC_INLINE uint32_t LL_RTC_GetSynchPrescaler(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 895 | { |
EricLew | 0:80ee8f3b695e | 896 | return (uint32_t)(READ_BIT(RTCx->PRER, RTC_PRER_PREDIV_S)); |
EricLew | 0:80ee8f3b695e | 897 | } |
EricLew | 0:80ee8f3b695e | 898 | |
EricLew | 0:80ee8f3b695e | 899 | /** |
EricLew | 0:80ee8f3b695e | 900 | * @brief Enable the write protection for RTC registers. |
EricLew | 0:80ee8f3b695e | 901 | * @rmtoll WPR KEY LL_RTC_EnableWriteProtection |
EricLew | 0:80ee8f3b695e | 902 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 903 | * @retval None |
EricLew | 0:80ee8f3b695e | 904 | */ |
EricLew | 0:80ee8f3b695e | 905 | __STATIC_INLINE void LL_RTC_EnableWriteProtection(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 906 | { |
EricLew | 0:80ee8f3b695e | 907 | WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_DISABLE); |
EricLew | 0:80ee8f3b695e | 908 | } |
EricLew | 0:80ee8f3b695e | 909 | |
EricLew | 0:80ee8f3b695e | 910 | /** |
EricLew | 0:80ee8f3b695e | 911 | * @brief Disable the write protection for RTC registers. |
EricLew | 0:80ee8f3b695e | 912 | * @rmtoll WPR KEY LL_RTC_DisableWriteProtection |
EricLew | 0:80ee8f3b695e | 913 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 914 | * @retval None |
EricLew | 0:80ee8f3b695e | 915 | */ |
EricLew | 0:80ee8f3b695e | 916 | __STATIC_INLINE void LL_RTC_DisableWriteProtection(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 917 | { |
EricLew | 0:80ee8f3b695e | 918 | WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_1); |
EricLew | 0:80ee8f3b695e | 919 | WRITE_REG(RTCx->WPR, RTC_WRITE_PROTECTION_ENABLE_2); |
EricLew | 0:80ee8f3b695e | 920 | } |
EricLew | 0:80ee8f3b695e | 921 | |
EricLew | 0:80ee8f3b695e | 922 | /** |
EricLew | 0:80ee8f3b695e | 923 | * @brief Enable RTC_OUT remap |
EricLew | 0:80ee8f3b695e | 924 | * @rmtoll OR OUT_RMP LL_RTC_EnableOutRemap |
EricLew | 0:80ee8f3b695e | 925 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 926 | * @retval None |
EricLew | 0:80ee8f3b695e | 927 | */ |
EricLew | 0:80ee8f3b695e | 928 | __STATIC_INLINE void LL_RTC_EnableOutRemap(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 929 | { |
EricLew | 0:80ee8f3b695e | 930 | SET_BIT(RTCx->OR, RTC_OR_OUT_RMP); |
EricLew | 0:80ee8f3b695e | 931 | } |
EricLew | 0:80ee8f3b695e | 932 | |
EricLew | 0:80ee8f3b695e | 933 | /** |
EricLew | 0:80ee8f3b695e | 934 | * @brief Disable RTC_OUT remap |
EricLew | 0:80ee8f3b695e | 935 | * @rmtoll OR OUT_RMP LL_RTC_DisableOutRemap |
EricLew | 0:80ee8f3b695e | 936 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 937 | * @retval None |
EricLew | 0:80ee8f3b695e | 938 | */ |
EricLew | 0:80ee8f3b695e | 939 | __STATIC_INLINE void LL_RTC_DisableOutRemap(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 940 | { |
EricLew | 0:80ee8f3b695e | 941 | CLEAR_BIT(RTCx->OR, RTC_OR_OUT_RMP); |
EricLew | 0:80ee8f3b695e | 942 | } |
EricLew | 0:80ee8f3b695e | 943 | |
EricLew | 0:80ee8f3b695e | 944 | /** |
EricLew | 0:80ee8f3b695e | 945 | * @} |
EricLew | 0:80ee8f3b695e | 946 | */ |
EricLew | 0:80ee8f3b695e | 947 | |
EricLew | 0:80ee8f3b695e | 948 | /** @defgroup RTC_LL_EF_Time Time |
EricLew | 0:80ee8f3b695e | 949 | * @{ |
EricLew | 0:80ee8f3b695e | 950 | */ |
EricLew | 0:80ee8f3b695e | 951 | |
EricLew | 0:80ee8f3b695e | 952 | /** |
EricLew | 0:80ee8f3b695e | 953 | * @brief Set time format (AM/24-hour or PM notation) |
EricLew | 0:80ee8f3b695e | 954 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 955 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 956 | * @rmtoll TR PM LL_RTC_TIME_SetFormat |
EricLew | 0:80ee8f3b695e | 957 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 958 | * @param Format This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 959 | * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 |
EricLew | 0:80ee8f3b695e | 960 | * @arg @ref LL_RTC_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 961 | * @retval None |
EricLew | 0:80ee8f3b695e | 962 | */ |
EricLew | 0:80ee8f3b695e | 963 | __STATIC_INLINE void LL_RTC_TIME_SetFormat(RTC_TypeDef *RTCx, uint32_t Format) |
EricLew | 0:80ee8f3b695e | 964 | { |
EricLew | 0:80ee8f3b695e | 965 | MODIFY_REG(RTCx->TR, RTC_TR_PM, Format); |
EricLew | 0:80ee8f3b695e | 966 | } |
EricLew | 0:80ee8f3b695e | 967 | |
EricLew | 0:80ee8f3b695e | 968 | /** |
EricLew | 0:80ee8f3b695e | 969 | * @brief Get time format (AM or PM notation) |
EricLew | 0:80ee8f3b695e | 970 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 971 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 972 | * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar |
EricLew | 0:80ee8f3b695e | 973 | * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). |
EricLew | 0:80ee8f3b695e | 974 | * @rmtoll TR PM LL_RTC_TIME_GetFormat |
EricLew | 0:80ee8f3b695e | 975 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 976 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 977 | * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 |
EricLew | 0:80ee8f3b695e | 978 | * @arg @ref LL_RTC_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 979 | */ |
EricLew | 0:80ee8f3b695e | 980 | __STATIC_INLINE uint32_t LL_RTC_TIME_GetFormat(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 981 | { |
EricLew | 0:80ee8f3b695e | 982 | return (uint32_t)(READ_BIT(RTCx->TR, RTC_TR_PM)); |
EricLew | 0:80ee8f3b695e | 983 | } |
EricLew | 0:80ee8f3b695e | 984 | |
EricLew | 0:80ee8f3b695e | 985 | /** |
EricLew | 0:80ee8f3b695e | 986 | * @brief Set Hour in BCD format |
EricLew | 0:80ee8f3b695e | 987 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 988 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 989 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert hour from binary to BCD format |
EricLew | 0:80ee8f3b695e | 990 | * @rmtoll TR HT LL_RTC_TIME_SetHour\n |
EricLew | 0:80ee8f3b695e | 991 | * TR HU LL_RTC_TIME_SetHour |
EricLew | 0:80ee8f3b695e | 992 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 993 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 994 | * @retval None |
EricLew | 0:80ee8f3b695e | 995 | */ |
EricLew | 0:80ee8f3b695e | 996 | __STATIC_INLINE void LL_RTC_TIME_SetHour(RTC_TypeDef *RTCx, uint32_t Hour) |
EricLew | 0:80ee8f3b695e | 997 | { |
EricLew | 0:80ee8f3b695e | 998 | MODIFY_REG(RTCx->TR, (RTC_TR_HT | RTC_TR_HU), |
EricLew | 0:80ee8f3b695e | 999 | (((Hour & 0xF0) << (RTC_POSITION_TR_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_TR_HU))); |
EricLew | 0:80ee8f3b695e | 1000 | } |
EricLew | 0:80ee8f3b695e | 1001 | |
EricLew | 0:80ee8f3b695e | 1002 | /** |
EricLew | 0:80ee8f3b695e | 1003 | * @brief Get Hour in BCD format |
EricLew | 0:80ee8f3b695e | 1004 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1005 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1006 | * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar |
EricLew | 0:80ee8f3b695e | 1007 | * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). |
EricLew | 0:80ee8f3b695e | 1008 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert hour from BCD to |
EricLew | 0:80ee8f3b695e | 1009 | * Binary format |
EricLew | 0:80ee8f3b695e | 1010 | * @rmtoll TR HT LL_RTC_TIME_GetHour\n |
EricLew | 0:80ee8f3b695e | 1011 | * TR HU LL_RTC_TIME_GetHour |
EricLew | 0:80ee8f3b695e | 1012 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1013 | * @retval 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 1014 | */ |
EricLew | 0:80ee8f3b695e | 1015 | __STATIC_INLINE uint32_t LL_RTC_TIME_GetHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1016 | { |
EricLew | 0:80ee8f3b695e | 1017 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1018 | |
EricLew | 0:80ee8f3b695e | 1019 | temp = READ_BIT(RTCx->TR, (RTC_TR_HT | RTC_TR_HU)); |
EricLew | 0:80ee8f3b695e | 1020 | return (uint32_t)((((temp & RTC_TR_HT) >> RTC_POSITION_TR_HT) << 4) | ((temp & RTC_TR_HU) >> RTC_POSITION_TR_HU)); |
EricLew | 0:80ee8f3b695e | 1021 | } |
EricLew | 0:80ee8f3b695e | 1022 | |
EricLew | 0:80ee8f3b695e | 1023 | /** |
EricLew | 0:80ee8f3b695e | 1024 | * @brief Set Minute in BCD format |
EricLew | 0:80ee8f3b695e | 1025 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1026 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 1027 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minute from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1028 | * @rmtoll TR MNT LL_RTC_TIME_SetMinute\n |
EricLew | 0:80ee8f3b695e | 1029 | * TR MNU LL_RTC_TIME_SetMinute |
EricLew | 0:80ee8f3b695e | 1030 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1031 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1032 | * @retval None |
EricLew | 0:80ee8f3b695e | 1033 | */ |
EricLew | 0:80ee8f3b695e | 1034 | __STATIC_INLINE void LL_RTC_TIME_SetMinute(RTC_TypeDef *RTCx, uint32_t Minute) |
EricLew | 0:80ee8f3b695e | 1035 | { |
EricLew | 0:80ee8f3b695e | 1036 | MODIFY_REG(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU), |
EricLew | 0:80ee8f3b695e | 1037 | (((Minute & 0xF0) << (RTC_POSITION_TR_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_TR_MU))); |
EricLew | 0:80ee8f3b695e | 1038 | } |
EricLew | 0:80ee8f3b695e | 1039 | |
EricLew | 0:80ee8f3b695e | 1040 | /** |
EricLew | 0:80ee8f3b695e | 1041 | * @brief Get Minute in BCD format |
EricLew | 0:80ee8f3b695e | 1042 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1043 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1044 | * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar |
EricLew | 0:80ee8f3b695e | 1045 | * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). |
EricLew | 0:80ee8f3b695e | 1046 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert minute from BCD |
EricLew | 0:80ee8f3b695e | 1047 | * to Binary format |
EricLew | 0:80ee8f3b695e | 1048 | * @rmtoll TR MNT LL_RTC_TIME_GetMinute\n |
EricLew | 0:80ee8f3b695e | 1049 | * TR MNU LL_RTC_TIME_GetMinute |
EricLew | 0:80ee8f3b695e | 1050 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1051 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1052 | */ |
EricLew | 0:80ee8f3b695e | 1053 | __STATIC_INLINE uint32_t LL_RTC_TIME_GetMinute(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1054 | { |
EricLew | 0:80ee8f3b695e | 1055 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1056 | |
EricLew | 0:80ee8f3b695e | 1057 | temp = READ_BIT(RTCx->TR, (RTC_TR_MNT | RTC_TR_MNU)); |
EricLew | 0:80ee8f3b695e | 1058 | return (uint32_t)((((temp & RTC_TR_MNT) >> RTC_POSITION_TR_MT) << 4) | ((temp & RTC_TR_MNU) >> RTC_POSITION_TR_MU)); |
EricLew | 0:80ee8f3b695e | 1059 | } |
EricLew | 0:80ee8f3b695e | 1060 | |
EricLew | 0:80ee8f3b695e | 1061 | /** |
EricLew | 0:80ee8f3b695e | 1062 | * @brief Set Second in BCD format |
EricLew | 0:80ee8f3b695e | 1063 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1064 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 1065 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Second from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1066 | * @rmtoll TR ST LL_RTC_TIME_SetSecond\n |
EricLew | 0:80ee8f3b695e | 1067 | * TR SU LL_RTC_TIME_SetSecond |
EricLew | 0:80ee8f3b695e | 1068 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1069 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1070 | * @retval None |
EricLew | 0:80ee8f3b695e | 1071 | */ |
EricLew | 0:80ee8f3b695e | 1072 | __STATIC_INLINE void LL_RTC_TIME_SetSecond(RTC_TypeDef *RTCx, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 1073 | { |
EricLew | 0:80ee8f3b695e | 1074 | MODIFY_REG(RTCx->TR, (RTC_TR_ST | RTC_TR_SU), |
EricLew | 0:80ee8f3b695e | 1075 | (((Second & 0xF0) << (RTC_POSITION_TR_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_TR_SU))); |
EricLew | 0:80ee8f3b695e | 1076 | } |
EricLew | 0:80ee8f3b695e | 1077 | |
EricLew | 0:80ee8f3b695e | 1078 | /** |
EricLew | 0:80ee8f3b695e | 1079 | * @brief Get Second in BCD format |
EricLew | 0:80ee8f3b695e | 1080 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1081 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1082 | * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar |
EricLew | 0:80ee8f3b695e | 1083 | * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). |
EricLew | 0:80ee8f3b695e | 1084 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Second from BCD |
EricLew | 0:80ee8f3b695e | 1085 | * to Binary format |
EricLew | 0:80ee8f3b695e | 1086 | * @rmtoll TR ST LL_RTC_TIME_GetSecond\n |
EricLew | 0:80ee8f3b695e | 1087 | * TR SU LL_RTC_TIME_GetSecond |
EricLew | 0:80ee8f3b695e | 1088 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1089 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1090 | */ |
EricLew | 0:80ee8f3b695e | 1091 | __STATIC_INLINE uint32_t LL_RTC_TIME_GetSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1092 | { |
EricLew | 0:80ee8f3b695e | 1093 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1094 | |
EricLew | 0:80ee8f3b695e | 1095 | temp = READ_BIT(RTCx->TR, (RTC_TR_ST | RTC_TR_SU)); |
EricLew | 0:80ee8f3b695e | 1096 | return (uint32_t)((((temp & RTC_TR_ST) >> RTC_POSITION_TR_ST) << 4) | ((temp & RTC_TR_SU) >> RTC_POSITION_TR_SU)); |
EricLew | 0:80ee8f3b695e | 1097 | } |
EricLew | 0:80ee8f3b695e | 1098 | |
EricLew | 0:80ee8f3b695e | 1099 | /** |
EricLew | 0:80ee8f3b695e | 1100 | * @brief Set time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 1101 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1102 | * @note It can be written in initialization mode only (@ref LL_RTC_EnableInitMode function) |
EricLew | 0:80ee8f3b695e | 1103 | * @note Format and Hour should follow the same format |
EricLew | 0:80ee8f3b695e | 1104 | * @rmtoll TR PM LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1105 | * TR HT LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1106 | * TR HU LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1107 | * TR MNT LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1108 | * TR MNU LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1109 | * TR ST LL_RTC_TIME_Config\n |
EricLew | 0:80ee8f3b695e | 1110 | * TR SU LL_RTC_TIME_Config |
EricLew | 0:80ee8f3b695e | 1111 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1112 | * @param Format12_24 This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1113 | * @arg @ref LL_RTC_TIME_FORMAT_AM_OR_24 |
EricLew | 0:80ee8f3b695e | 1114 | * @arg @ref LL_RTC_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 1115 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 1116 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1117 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1118 | * @retval None |
EricLew | 0:80ee8f3b695e | 1119 | */ |
EricLew | 0:80ee8f3b695e | 1120 | __STATIC_INLINE void LL_RTC_TIME_Config(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hour, uint32_t Minute, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 1121 | { |
EricLew | 0:80ee8f3b695e | 1122 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1123 | |
EricLew | 0:80ee8f3b695e | 1124 | temp = Format12_24 | \ |
EricLew | 0:80ee8f3b695e | 1125 | (((Hour & 0xF0) << (RTC_POSITION_TR_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_TR_HU)) | \ |
EricLew | 0:80ee8f3b695e | 1126 | (((Minute & 0xF0) << (RTC_POSITION_TR_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_TR_MU)) | \ |
EricLew | 0:80ee8f3b695e | 1127 | (((Second & 0xF0) << (RTC_POSITION_TR_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_TR_SU)); |
EricLew | 0:80ee8f3b695e | 1128 | MODIFY_REG(RTCx->TR, (RTC_TR_PM | RTC_TR_HT | RTC_TR_HU | RTC_TR_MNT | RTC_TR_MNU | RTC_TR_ST | RTC_TR_SU), temp); |
EricLew | 0:80ee8f3b695e | 1129 | } |
EricLew | 0:80ee8f3b695e | 1130 | |
EricLew | 0:80ee8f3b695e | 1131 | /** |
EricLew | 0:80ee8f3b695e | 1132 | * @brief Get time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 1133 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1134 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1135 | * @note Read either RTC_SSR or RTC_TR locks the values in the higher-order calendar |
EricLew | 0:80ee8f3b695e | 1136 | * shadow registers until RTC_DR is read (LL_RTC_ReadReg(RTC, DR)). |
EricLew | 0:80ee8f3b695e | 1137 | * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND |
EricLew | 0:80ee8f3b695e | 1138 | * are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 1139 | * @rmtoll TR HT LL_RTC_TIME_Get\n |
EricLew | 0:80ee8f3b695e | 1140 | * TR HU LL_RTC_TIME_Get\n |
EricLew | 0:80ee8f3b695e | 1141 | * TR MNT LL_RTC_TIME_Get\n |
EricLew | 0:80ee8f3b695e | 1142 | * TR MNU LL_RTC_TIME_Get\n |
EricLew | 0:80ee8f3b695e | 1143 | * TR ST LL_RTC_TIME_Get\n |
EricLew | 0:80ee8f3b695e | 1144 | * TR SU LL_RTC_TIME_Get |
EricLew | 0:80ee8f3b695e | 1145 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1146 | * @retval Combination of hours, minutes and seconds (Format: 0x00HHMMSS). |
EricLew | 0:80ee8f3b695e | 1147 | */ |
EricLew | 0:80ee8f3b695e | 1148 | __STATIC_INLINE uint32_t LL_RTC_TIME_Get(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1149 | { |
EricLew | 0:80ee8f3b695e | 1150 | return (uint32_t)((LL_RTC_TIME_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_TIME_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_TIME_GetSecond(RTCx)); |
EricLew | 0:80ee8f3b695e | 1151 | } |
EricLew | 0:80ee8f3b695e | 1152 | |
EricLew | 0:80ee8f3b695e | 1153 | /** |
EricLew | 0:80ee8f3b695e | 1154 | * @brief Memorize whether the daylight saving time change has been performed |
EricLew | 0:80ee8f3b695e | 1155 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1156 | * @rmtoll CR BCK LL_RTC_TIME_EnableDayLightStore |
EricLew | 0:80ee8f3b695e | 1157 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1158 | * @retval None |
EricLew | 0:80ee8f3b695e | 1159 | */ |
EricLew | 0:80ee8f3b695e | 1160 | __STATIC_INLINE void LL_RTC_TIME_EnableDayLightStore(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1161 | { |
EricLew | 0:80ee8f3b695e | 1162 | SET_BIT(RTCx->CR, RTC_CR_BCK); |
EricLew | 0:80ee8f3b695e | 1163 | } |
EricLew | 0:80ee8f3b695e | 1164 | |
EricLew | 0:80ee8f3b695e | 1165 | /** |
EricLew | 0:80ee8f3b695e | 1166 | * @brief Disable memorization whether the daylight saving time change has been performed. |
EricLew | 0:80ee8f3b695e | 1167 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1168 | * @rmtoll CR BCK LL_RTC_TIME_DisableDayLightStore |
EricLew | 0:80ee8f3b695e | 1169 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1170 | * @retval None |
EricLew | 0:80ee8f3b695e | 1171 | */ |
EricLew | 0:80ee8f3b695e | 1172 | __STATIC_INLINE void LL_RTC_TIME_DisableDayLightStore(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1173 | { |
EricLew | 0:80ee8f3b695e | 1174 | CLEAR_BIT(RTCx->CR, RTC_CR_BCK); |
EricLew | 0:80ee8f3b695e | 1175 | } |
EricLew | 0:80ee8f3b695e | 1176 | |
EricLew | 0:80ee8f3b695e | 1177 | /** |
EricLew | 0:80ee8f3b695e | 1178 | * @brief Check if RTC Day Light Saving stored operation has been enabled or not |
EricLew | 0:80ee8f3b695e | 1179 | * @rmtoll CR BCK LL_RTC_TIME_IsDayLightStoreEnabled |
EricLew | 0:80ee8f3b695e | 1180 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1181 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 1182 | */ |
EricLew | 0:80ee8f3b695e | 1183 | __STATIC_INLINE uint32_t LL_RTC_TIME_IsDayLightStoreEnabled(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1184 | { |
EricLew | 0:80ee8f3b695e | 1185 | return (READ_BIT(RTCx->CR, RTC_CR_BCK) == (RTC_CR_BCK)); |
EricLew | 0:80ee8f3b695e | 1186 | } |
EricLew | 0:80ee8f3b695e | 1187 | |
EricLew | 0:80ee8f3b695e | 1188 | /** |
EricLew | 0:80ee8f3b695e | 1189 | * @brief Subtract 1 hour (winter time change) |
EricLew | 0:80ee8f3b695e | 1190 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1191 | * @rmtoll CR SUB1H LL_RTC_TIME_DecHour |
EricLew | 0:80ee8f3b695e | 1192 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1193 | * @retval None |
EricLew | 0:80ee8f3b695e | 1194 | */ |
EricLew | 0:80ee8f3b695e | 1195 | __STATIC_INLINE void LL_RTC_TIME_DecHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1196 | { |
EricLew | 0:80ee8f3b695e | 1197 | SET_BIT(RTCx->CR, RTC_CR_SUB1H); |
EricLew | 0:80ee8f3b695e | 1198 | } |
EricLew | 0:80ee8f3b695e | 1199 | |
EricLew | 0:80ee8f3b695e | 1200 | /** |
EricLew | 0:80ee8f3b695e | 1201 | * @brief Add 1 hour (summer time change) |
EricLew | 0:80ee8f3b695e | 1202 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1203 | * @rmtoll CR ADD1H LL_RTC_TIME_IncHour |
EricLew | 0:80ee8f3b695e | 1204 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1205 | * @retval None |
EricLew | 0:80ee8f3b695e | 1206 | */ |
EricLew | 0:80ee8f3b695e | 1207 | __STATIC_INLINE void LL_RTC_TIME_IncHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1208 | { |
EricLew | 0:80ee8f3b695e | 1209 | SET_BIT(RTCx->CR, RTC_CR_ADD1H); |
EricLew | 0:80ee8f3b695e | 1210 | } |
EricLew | 0:80ee8f3b695e | 1211 | |
EricLew | 0:80ee8f3b695e | 1212 | /** |
EricLew | 0:80ee8f3b695e | 1213 | * @brief Get Sub second value in the synchronous prescaler counter. |
EricLew | 0:80ee8f3b695e | 1214 | * @note You can use both SubSeconds value and SecondFraction (PREDIV_S through |
EricLew | 0:80ee8f3b695e | 1215 | * LL_RTC_GetSynchPrescaler function) terms returned to convert Calendar |
EricLew | 0:80ee8f3b695e | 1216 | * SubSeconds value in second fraction ratio with time unit following |
EricLew | 0:80ee8f3b695e | 1217 | * generic formula: |
EricLew | 0:80ee8f3b695e | 1218 | * ==> Second fraction ratio * time_unit= [(SecondFraction-SubSeconds)/(SecondFraction+1)] * time_unit |
EricLew | 0:80ee8f3b695e | 1219 | * This conversion can be performed only if no shift operation is pending |
EricLew | 0:80ee8f3b695e | 1220 | * (ie. SHFP=0) when PREDIV_S >= SS. |
EricLew | 0:80ee8f3b695e | 1221 | * @rmtoll SSR SS LL_RTC_TIME_GetSubSecond |
EricLew | 0:80ee8f3b695e | 1222 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1223 | * @retval Sub second value (number between 0 and 65535) |
EricLew | 0:80ee8f3b695e | 1224 | */ |
EricLew | 0:80ee8f3b695e | 1225 | __STATIC_INLINE uint32_t LL_RTC_TIME_GetSubSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1226 | { |
EricLew | 0:80ee8f3b695e | 1227 | return (uint32_t)(READ_BIT(RTCx->SSR, RTC_SSR_SS)); |
EricLew | 0:80ee8f3b695e | 1228 | } |
EricLew | 0:80ee8f3b695e | 1229 | |
EricLew | 0:80ee8f3b695e | 1230 | /** |
EricLew | 0:80ee8f3b695e | 1231 | * @brief Synchronize to a remote clock with a high degree of precision. |
EricLew | 0:80ee8f3b695e | 1232 | * This operation effectively subtracts from (delays) or advance the clock of a fraction of a second. |
EricLew | 0:80ee8f3b695e | 1233 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1234 | * @note When REFCKON is set, firmware must not write to Shift control register. |
EricLew | 0:80ee8f3b695e | 1235 | * @rmtoll SHIFTR ADD1S LL_RTC_TIME_Synchronize\n |
EricLew | 0:80ee8f3b695e | 1236 | * SHIFTR SUBFS LL_RTC_TIME_Synchronize |
EricLew | 0:80ee8f3b695e | 1237 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1238 | * @param ShiftSecond This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1239 | * @arg @ref LL_RTC_SHIFT_SECOND_DELAY |
EricLew | 0:80ee8f3b695e | 1240 | * @arg @ref LL_RTC_SHIFT_SECOND_ADVANCE |
EricLew | 0:80ee8f3b695e | 1241 | * @param Fraction Number of Second Fractions (any value from 0 to 0x7FFF) |
EricLew | 0:80ee8f3b695e | 1242 | * @retval None |
EricLew | 0:80ee8f3b695e | 1243 | */ |
EricLew | 0:80ee8f3b695e | 1244 | __STATIC_INLINE void LL_RTC_TIME_Synchronize(RTC_TypeDef *RTCx, uint32_t ShiftSecond, uint32_t Fraction) |
EricLew | 0:80ee8f3b695e | 1245 | { |
EricLew | 0:80ee8f3b695e | 1246 | WRITE_REG(RTCx->SHIFTR, ShiftSecond | Fraction); |
EricLew | 0:80ee8f3b695e | 1247 | } |
EricLew | 0:80ee8f3b695e | 1248 | |
EricLew | 0:80ee8f3b695e | 1249 | /** |
EricLew | 0:80ee8f3b695e | 1250 | * @} |
EricLew | 0:80ee8f3b695e | 1251 | */ |
EricLew | 0:80ee8f3b695e | 1252 | |
EricLew | 0:80ee8f3b695e | 1253 | /** @defgroup RTC_LL_EF_Date Date |
EricLew | 0:80ee8f3b695e | 1254 | * @{ |
EricLew | 0:80ee8f3b695e | 1255 | */ |
EricLew | 0:80ee8f3b695e | 1256 | |
EricLew | 0:80ee8f3b695e | 1257 | /** |
EricLew | 0:80ee8f3b695e | 1258 | * @brief Set Year in BCD format |
EricLew | 0:80ee8f3b695e | 1259 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Year from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1260 | * @rmtoll DR YT LL_RTC_DATE_SetYear\n |
EricLew | 0:80ee8f3b695e | 1261 | * DR YU LL_RTC_DATE_SetYear |
EricLew | 0:80ee8f3b695e | 1262 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1263 | * @param Year 0x00. . .0x99 |
EricLew | 0:80ee8f3b695e | 1264 | * @retval None |
EricLew | 0:80ee8f3b695e | 1265 | */ |
EricLew | 0:80ee8f3b695e | 1266 | __STATIC_INLINE void LL_RTC_DATE_SetYear(RTC_TypeDef *RTCx, uint32_t Year) |
EricLew | 0:80ee8f3b695e | 1267 | { |
EricLew | 0:80ee8f3b695e | 1268 | MODIFY_REG(RTCx->DR, (RTC_DR_YT | RTC_DR_YU), |
EricLew | 0:80ee8f3b695e | 1269 | (((Year & 0xF0) << (RTC_POSITION_DR_YT - 4)) | ((Year & 0x0F) << RTC_POSITION_DR_YU))); |
EricLew | 0:80ee8f3b695e | 1270 | } |
EricLew | 0:80ee8f3b695e | 1271 | |
EricLew | 0:80ee8f3b695e | 1272 | /** |
EricLew | 0:80ee8f3b695e | 1273 | * @brief Get Year in BCD format |
EricLew | 0:80ee8f3b695e | 1274 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1275 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1276 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Year from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1277 | * @rmtoll DR YT LL_RTC_DATE_GetYear\n |
EricLew | 0:80ee8f3b695e | 1278 | * DR YU LL_RTC_DATE_GetYear |
EricLew | 0:80ee8f3b695e | 1279 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1280 | * @retval 0x00. . .0x99 |
EricLew | 0:80ee8f3b695e | 1281 | */ |
EricLew | 0:80ee8f3b695e | 1282 | __STATIC_INLINE uint32_t LL_RTC_DATE_GetYear(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1283 | { |
EricLew | 0:80ee8f3b695e | 1284 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1285 | |
EricLew | 0:80ee8f3b695e | 1286 | temp = READ_BIT(RTCx->DR, (RTC_DR_YT | RTC_DR_YU)); |
EricLew | 0:80ee8f3b695e | 1287 | return (uint32_t)((((temp & RTC_DR_YT) >> RTC_POSITION_DR_YT) << 4) | ((temp & RTC_DR_YU) >> RTC_POSITION_DR_YU)); |
EricLew | 0:80ee8f3b695e | 1288 | } |
EricLew | 0:80ee8f3b695e | 1289 | |
EricLew | 0:80ee8f3b695e | 1290 | /** |
EricLew | 0:80ee8f3b695e | 1291 | * @brief Set Week day |
EricLew | 0:80ee8f3b695e | 1292 | * @rmtoll DR WDU LL_RTC_DATE_SetWeekDay |
EricLew | 0:80ee8f3b695e | 1293 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1294 | * @param WeekDay This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1295 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1296 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1297 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1298 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 1299 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 1300 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 1301 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 1302 | * @retval None |
EricLew | 0:80ee8f3b695e | 1303 | */ |
EricLew | 0:80ee8f3b695e | 1304 | __STATIC_INLINE void LL_RTC_DATE_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) |
EricLew | 0:80ee8f3b695e | 1305 | { |
EricLew | 0:80ee8f3b695e | 1306 | MODIFY_REG(RTCx->DR, RTC_DR_WDU, WeekDay << RTC_POSITION_DR_WDU); |
EricLew | 0:80ee8f3b695e | 1307 | } |
EricLew | 0:80ee8f3b695e | 1308 | |
EricLew | 0:80ee8f3b695e | 1309 | /** |
EricLew | 0:80ee8f3b695e | 1310 | * @brief Get Week day |
EricLew | 0:80ee8f3b695e | 1311 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1312 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1313 | * @rmtoll DR WDU LL_RTC_DATE_GetWeekDay |
EricLew | 0:80ee8f3b695e | 1314 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1315 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1316 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1317 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1318 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1319 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 1320 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 1321 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 1322 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 1323 | */ |
EricLew | 0:80ee8f3b695e | 1324 | __STATIC_INLINE uint32_t LL_RTC_DATE_GetWeekDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1325 | { |
EricLew | 0:80ee8f3b695e | 1326 | return (uint32_t)(READ_BIT(RTCx->DR, RTC_DR_WDU) >> RTC_POSITION_DR_WDU); |
EricLew | 0:80ee8f3b695e | 1327 | } |
EricLew | 0:80ee8f3b695e | 1328 | |
EricLew | 0:80ee8f3b695e | 1329 | /** |
EricLew | 0:80ee8f3b695e | 1330 | * @brief Set Month in BCD format |
EricLew | 0:80ee8f3b695e | 1331 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Month from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1332 | * @rmtoll DR MT LL_RTC_DATE_SetMonth\n |
EricLew | 0:80ee8f3b695e | 1333 | * DR MU LL_RTC_DATE_SetMonth |
EricLew | 0:80ee8f3b695e | 1334 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1335 | * @param Month This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1336 | * @arg @ref LL_RTC_MONTH_JANUARY |
EricLew | 0:80ee8f3b695e | 1337 | * @arg @ref LL_RTC_MONTH_FEBRUARY |
EricLew | 0:80ee8f3b695e | 1338 | * @arg @ref LL_RTC_MONTH_MARCH |
EricLew | 0:80ee8f3b695e | 1339 | * @arg @ref LL_RTC_MONTH_APRIL |
EricLew | 0:80ee8f3b695e | 1340 | * @arg @ref LL_RTC_MONTH_MAY |
EricLew | 0:80ee8f3b695e | 1341 | * @arg @ref LL_RTC_MONTH_JUNE |
EricLew | 0:80ee8f3b695e | 1342 | * @arg @ref LL_RTC_MONTH_JULY |
EricLew | 0:80ee8f3b695e | 1343 | * @arg @ref LL_RTC_MONTH_AUGUST |
EricLew | 0:80ee8f3b695e | 1344 | * @arg @ref LL_RTC_MONTH_SEPTEMBER |
EricLew | 0:80ee8f3b695e | 1345 | * @arg @ref LL_RTC_MONTH_OCTOBER |
EricLew | 0:80ee8f3b695e | 1346 | * @arg @ref LL_RTC_MONTH_NOVEMBER |
EricLew | 0:80ee8f3b695e | 1347 | * @arg @ref LL_RTC_MONTH_DECEMBER |
EricLew | 0:80ee8f3b695e | 1348 | * @retval None |
EricLew | 0:80ee8f3b695e | 1349 | */ |
EricLew | 0:80ee8f3b695e | 1350 | __STATIC_INLINE void LL_RTC_DATE_SetMonth(RTC_TypeDef *RTCx, uint32_t Month) |
EricLew | 0:80ee8f3b695e | 1351 | { |
EricLew | 0:80ee8f3b695e | 1352 | MODIFY_REG(RTCx->DR, (RTC_DR_MT | RTC_DR_MU), |
EricLew | 0:80ee8f3b695e | 1353 | (((Month & 0xF0) << (RTC_POSITION_DR_MT - 4)) | ((Month & 0x0F) << RTC_POSITION_DR_MU))); |
EricLew | 0:80ee8f3b695e | 1354 | } |
EricLew | 0:80ee8f3b695e | 1355 | |
EricLew | 0:80ee8f3b695e | 1356 | /** |
EricLew | 0:80ee8f3b695e | 1357 | * @brief Get Month in BCD format |
EricLew | 0:80ee8f3b695e | 1358 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1359 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1360 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1361 | * @rmtoll DR MT LL_RTC_DATE_GetMonth\n |
EricLew | 0:80ee8f3b695e | 1362 | * DR MU LL_RTC_DATE_GetMonth |
EricLew | 0:80ee8f3b695e | 1363 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1364 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1365 | * @arg @ref LL_RTC_MONTH_JANUARY |
EricLew | 0:80ee8f3b695e | 1366 | * @arg @ref LL_RTC_MONTH_FEBRUARY |
EricLew | 0:80ee8f3b695e | 1367 | * @arg @ref LL_RTC_MONTH_MARCH |
EricLew | 0:80ee8f3b695e | 1368 | * @arg @ref LL_RTC_MONTH_APRIL |
EricLew | 0:80ee8f3b695e | 1369 | * @arg @ref LL_RTC_MONTH_MAY |
EricLew | 0:80ee8f3b695e | 1370 | * @arg @ref LL_RTC_MONTH_JUNE |
EricLew | 0:80ee8f3b695e | 1371 | * @arg @ref LL_RTC_MONTH_JULY |
EricLew | 0:80ee8f3b695e | 1372 | * @arg @ref LL_RTC_MONTH_AUGUST |
EricLew | 0:80ee8f3b695e | 1373 | * @arg @ref LL_RTC_MONTH_SEPTEMBER |
EricLew | 0:80ee8f3b695e | 1374 | * @arg @ref LL_RTC_MONTH_OCTOBER |
EricLew | 0:80ee8f3b695e | 1375 | * @arg @ref LL_RTC_MONTH_NOVEMBER |
EricLew | 0:80ee8f3b695e | 1376 | * @arg @ref LL_RTC_MONTH_DECEMBER |
EricLew | 0:80ee8f3b695e | 1377 | */ |
EricLew | 0:80ee8f3b695e | 1378 | __STATIC_INLINE uint32_t LL_RTC_DATE_GetMonth(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1379 | { |
EricLew | 0:80ee8f3b695e | 1380 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1381 | |
EricLew | 0:80ee8f3b695e | 1382 | temp = READ_BIT(RTCx->DR, (RTC_DR_MT | RTC_DR_MU)); |
EricLew | 0:80ee8f3b695e | 1383 | return (uint32_t)((((temp & RTC_DR_MT) >> RTC_POSITION_DR_MT) << 4) | ((temp & RTC_DR_MU) >> RTC_POSITION_DR_MU)); |
EricLew | 0:80ee8f3b695e | 1384 | } |
EricLew | 0:80ee8f3b695e | 1385 | |
EricLew | 0:80ee8f3b695e | 1386 | /** |
EricLew | 0:80ee8f3b695e | 1387 | * @brief Set Day in BCD format |
EricLew | 0:80ee8f3b695e | 1388 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1389 | * @rmtoll DR DT LL_RTC_DATE_SetDay\n |
EricLew | 0:80ee8f3b695e | 1390 | * DR DU LL_RTC_DATE_SetDay |
EricLew | 0:80ee8f3b695e | 1391 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1392 | * @param Day 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1393 | * @retval None |
EricLew | 0:80ee8f3b695e | 1394 | */ |
EricLew | 0:80ee8f3b695e | 1395 | __STATIC_INLINE void LL_RTC_DATE_SetDay(RTC_TypeDef *RTCx, uint32_t Day) |
EricLew | 0:80ee8f3b695e | 1396 | { |
EricLew | 0:80ee8f3b695e | 1397 | MODIFY_REG(RTCx->DR, (RTC_DR_DT | RTC_DR_DU), |
EricLew | 0:80ee8f3b695e | 1398 | (((Day & 0xF0) << (RTC_POSITION_DR_DT - 4)) | ((Day & 0x0F) << RTC_POSITION_DR_DU))); |
EricLew | 0:80ee8f3b695e | 1399 | } |
EricLew | 0:80ee8f3b695e | 1400 | |
EricLew | 0:80ee8f3b695e | 1401 | /** |
EricLew | 0:80ee8f3b695e | 1402 | * @brief Get Day in BCD format |
EricLew | 0:80ee8f3b695e | 1403 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1404 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1405 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1406 | * @rmtoll DR DT LL_RTC_DATE_GetDay\n |
EricLew | 0:80ee8f3b695e | 1407 | * DR DU LL_RTC_DATE_GetDay |
EricLew | 0:80ee8f3b695e | 1408 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1409 | * @retval 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1410 | */ |
EricLew | 0:80ee8f3b695e | 1411 | __STATIC_INLINE uint32_t LL_RTC_DATE_GetDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1412 | { |
EricLew | 0:80ee8f3b695e | 1413 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1414 | |
EricLew | 0:80ee8f3b695e | 1415 | temp = READ_BIT(RTCx->DR, (RTC_DR_DT | RTC_DR_DU)); |
EricLew | 0:80ee8f3b695e | 1416 | return (uint32_t)((((temp & RTC_DR_DT) >> RTC_POSITION_DR_DT) << 4) | ((temp & RTC_DR_DU) >> RTC_POSITION_DR_DU)); |
EricLew | 0:80ee8f3b695e | 1417 | } |
EricLew | 0:80ee8f3b695e | 1418 | |
EricLew | 0:80ee8f3b695e | 1419 | /** |
EricLew | 0:80ee8f3b695e | 1420 | * @brief Set date (WeekDay, Day, Month and Year) in BCD format |
EricLew | 0:80ee8f3b695e | 1421 | * @rmtoll DR WDU LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1422 | * DR MT LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1423 | * DR MU LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1424 | * DR DT LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1425 | * DR DU LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1426 | * DR YT LL_RTC_DATE_Config\n |
EricLew | 0:80ee8f3b695e | 1427 | * DR YU LL_RTC_DATE_Config |
EricLew | 0:80ee8f3b695e | 1428 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1429 | * @param WeekDay This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1430 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1431 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1432 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1433 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 1434 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 1435 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 1436 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 1437 | * @param Day 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1438 | * @param Month This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1439 | * @arg @ref LL_RTC_MONTH_JANUARY |
EricLew | 0:80ee8f3b695e | 1440 | * @arg @ref LL_RTC_MONTH_FEBRUARY |
EricLew | 0:80ee8f3b695e | 1441 | * @arg @ref LL_RTC_MONTH_MARCH |
EricLew | 0:80ee8f3b695e | 1442 | * @arg @ref LL_RTC_MONTH_APRIL |
EricLew | 0:80ee8f3b695e | 1443 | * @arg @ref LL_RTC_MONTH_MAY |
EricLew | 0:80ee8f3b695e | 1444 | * @arg @ref LL_RTC_MONTH_JUNE |
EricLew | 0:80ee8f3b695e | 1445 | * @arg @ref LL_RTC_MONTH_JULY |
EricLew | 0:80ee8f3b695e | 1446 | * @arg @ref LL_RTC_MONTH_AUGUST |
EricLew | 0:80ee8f3b695e | 1447 | * @arg @ref LL_RTC_MONTH_SEPTEMBER |
EricLew | 0:80ee8f3b695e | 1448 | * @arg @ref LL_RTC_MONTH_OCTOBER |
EricLew | 0:80ee8f3b695e | 1449 | * @arg @ref LL_RTC_MONTH_NOVEMBER |
EricLew | 0:80ee8f3b695e | 1450 | * @arg @ref LL_RTC_MONTH_DECEMBER |
EricLew | 0:80ee8f3b695e | 1451 | * @param Year 0x00. . .0x99 |
EricLew | 0:80ee8f3b695e | 1452 | * @retval None |
EricLew | 0:80ee8f3b695e | 1453 | */ |
EricLew | 0:80ee8f3b695e | 1454 | __STATIC_INLINE void LL_RTC_DATE_Config(RTC_TypeDef *RTCx, uint32_t WeekDay, uint32_t Day, uint32_t Month, uint32_t Year) |
EricLew | 0:80ee8f3b695e | 1455 | { |
EricLew | 0:80ee8f3b695e | 1456 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1457 | |
EricLew | 0:80ee8f3b695e | 1458 | temp = (WeekDay << RTC_POSITION_DR_WDU) | \ |
EricLew | 0:80ee8f3b695e | 1459 | (((Year & 0xF0) << (RTC_POSITION_DR_YT - 4)) | ((Year & 0x0F) << RTC_POSITION_DR_YU)) | \ |
EricLew | 0:80ee8f3b695e | 1460 | (((Month & 0xF0) << (RTC_POSITION_DR_MT - 4)) | ((Month & 0x0F) << RTC_POSITION_DR_MU)) | \ |
EricLew | 0:80ee8f3b695e | 1461 | (((Day & 0xF0) << (RTC_POSITION_DR_DT - 4)) | ((Day & 0x0F) << RTC_POSITION_DR_DU)); |
EricLew | 0:80ee8f3b695e | 1462 | |
EricLew | 0:80ee8f3b695e | 1463 | MODIFY_REG(RTCx->DR, (RTC_DR_WDU | RTC_DR_MT | RTC_DR_MU | RTC_DR_DT | RTC_DR_DU | RTC_DR_YT | RTC_DR_YU), temp); |
EricLew | 0:80ee8f3b695e | 1464 | } |
EricLew | 0:80ee8f3b695e | 1465 | |
EricLew | 0:80ee8f3b695e | 1466 | /** |
EricLew | 0:80ee8f3b695e | 1467 | * @brief Get date (WeekDay, Day, Month and Year) in BCD format |
EricLew | 0:80ee8f3b695e | 1468 | * @note if shadow mode is disabled (BYPSHAD=0), need to check if RSF flag is set |
EricLew | 0:80ee8f3b695e | 1469 | * before reading this bit |
EricLew | 0:80ee8f3b695e | 1470 | * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_YEAR, __LL_RTC_GET_MONTH, |
EricLew | 0:80ee8f3b695e | 1471 | * and __LL_RTC_GET_DAY are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 1472 | * @rmtoll DR WDU LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1473 | * DR MT LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1474 | * DR MU LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1475 | * DR DT LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1476 | * DR DU LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1477 | * DR YT LL_RTC_DATE_Get\n |
EricLew | 0:80ee8f3b695e | 1478 | * DR YU LL_RTC_DATE_Get |
EricLew | 0:80ee8f3b695e | 1479 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1480 | * @retval Combination of WeekDay, Day, Month and Year (Format: 0xWWDDMMYY). |
EricLew | 0:80ee8f3b695e | 1481 | */ |
EricLew | 0:80ee8f3b695e | 1482 | __STATIC_INLINE uint32_t LL_RTC_DATE_Get(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1483 | { |
EricLew | 0:80ee8f3b695e | 1484 | return (uint32_t)((LL_RTC_DATE_GetWeekDay(RTCx) << RTC_OFFSET_WEEKDAY) | (LL_RTC_DATE_GetDay(RTCx) << RTC_OFFSET_DAY) | (LL_RTC_DATE_GetMonth(RTCx) << RTC_OFFSET_MONTH) | LL_RTC_DATE_GetYear(RTCx)); |
EricLew | 0:80ee8f3b695e | 1485 | } |
EricLew | 0:80ee8f3b695e | 1486 | |
EricLew | 0:80ee8f3b695e | 1487 | /** |
EricLew | 0:80ee8f3b695e | 1488 | * @} |
EricLew | 0:80ee8f3b695e | 1489 | */ |
EricLew | 0:80ee8f3b695e | 1490 | |
EricLew | 0:80ee8f3b695e | 1491 | /** @defgroup RTC_LL_EF_ALARMA ALARMA |
EricLew | 0:80ee8f3b695e | 1492 | * @{ |
EricLew | 0:80ee8f3b695e | 1493 | */ |
EricLew | 0:80ee8f3b695e | 1494 | |
EricLew | 0:80ee8f3b695e | 1495 | /** |
EricLew | 0:80ee8f3b695e | 1496 | * @brief Enable Alarm A |
EricLew | 0:80ee8f3b695e | 1497 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1498 | * @rmtoll CR ALRAE LL_RTC_ALMA_Enable |
EricLew | 0:80ee8f3b695e | 1499 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1500 | * @retval None |
EricLew | 0:80ee8f3b695e | 1501 | */ |
EricLew | 0:80ee8f3b695e | 1502 | __STATIC_INLINE void LL_RTC_ALMA_Enable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1503 | { |
EricLew | 0:80ee8f3b695e | 1504 | SET_BIT(RTCx->CR, RTC_CR_ALRAE); |
EricLew | 0:80ee8f3b695e | 1505 | } |
EricLew | 0:80ee8f3b695e | 1506 | |
EricLew | 0:80ee8f3b695e | 1507 | /** |
EricLew | 0:80ee8f3b695e | 1508 | * @brief Disable Alarm A |
EricLew | 0:80ee8f3b695e | 1509 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1510 | * @rmtoll CR ALRAE LL_RTC_ALMA_Disable |
EricLew | 0:80ee8f3b695e | 1511 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1512 | * @retval None |
EricLew | 0:80ee8f3b695e | 1513 | */ |
EricLew | 0:80ee8f3b695e | 1514 | __STATIC_INLINE void LL_RTC_ALMA_Disable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1515 | { |
EricLew | 0:80ee8f3b695e | 1516 | CLEAR_BIT(RTCx->CR, RTC_CR_ALRAE); |
EricLew | 0:80ee8f3b695e | 1517 | } |
EricLew | 0:80ee8f3b695e | 1518 | |
EricLew | 0:80ee8f3b695e | 1519 | /** |
EricLew | 0:80ee8f3b695e | 1520 | * @brief Specify the Alarm A masks. |
EricLew | 0:80ee8f3b695e | 1521 | * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_SetMask\n |
EricLew | 0:80ee8f3b695e | 1522 | * ALRMAR MSK3 LL_RTC_ALMA_SetMask\n |
EricLew | 0:80ee8f3b695e | 1523 | * ALRMAR MSK2 LL_RTC_ALMA_SetMask\n |
EricLew | 0:80ee8f3b695e | 1524 | * ALRMAR MSK1 LL_RTC_ALMA_SetMask |
EricLew | 0:80ee8f3b695e | 1525 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1526 | * @param Mask This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 1527 | * @arg @ref LL_RTC_ALMA_MASK_NONE |
EricLew | 0:80ee8f3b695e | 1528 | * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY |
EricLew | 0:80ee8f3b695e | 1529 | * @arg @ref LL_RTC_ALMA_MASK_HOURS |
EricLew | 0:80ee8f3b695e | 1530 | * @arg @ref LL_RTC_ALMA_MASK_MINUTES |
EricLew | 0:80ee8f3b695e | 1531 | * @arg @ref LL_RTC_ALMA_MASK_SECONDS |
EricLew | 0:80ee8f3b695e | 1532 | * @arg @ref LL_RTC_ALMA_MASK_ALL |
EricLew | 0:80ee8f3b695e | 1533 | * @retval None |
EricLew | 0:80ee8f3b695e | 1534 | */ |
EricLew | 0:80ee8f3b695e | 1535 | __STATIC_INLINE void LL_RTC_ALMA_SetMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 1536 | { |
EricLew | 0:80ee8f3b695e | 1537 | MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1, Mask); |
EricLew | 0:80ee8f3b695e | 1538 | } |
EricLew | 0:80ee8f3b695e | 1539 | |
EricLew | 0:80ee8f3b695e | 1540 | /** |
EricLew | 0:80ee8f3b695e | 1541 | * @brief Get the Alarm A masks. |
EricLew | 0:80ee8f3b695e | 1542 | * @rmtoll ALRMAR MSK4 LL_RTC_ALMA_GetMask\n |
EricLew | 0:80ee8f3b695e | 1543 | * ALRMAR MSK3 LL_RTC_ALMA_GetMask\n |
EricLew | 0:80ee8f3b695e | 1544 | * ALRMAR MSK2 LL_RTC_ALMA_GetMask\n |
EricLew | 0:80ee8f3b695e | 1545 | * ALRMAR MSK1 LL_RTC_ALMA_GetMask |
EricLew | 0:80ee8f3b695e | 1546 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1547 | * @retval Returned value can be can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 1548 | * @arg @ref LL_RTC_ALMA_MASK_NONE |
EricLew | 0:80ee8f3b695e | 1549 | * @arg @ref LL_RTC_ALMA_MASK_DATEWEEKDAY |
EricLew | 0:80ee8f3b695e | 1550 | * @arg @ref LL_RTC_ALMA_MASK_HOURS |
EricLew | 0:80ee8f3b695e | 1551 | * @arg @ref LL_RTC_ALMA_MASK_MINUTES |
EricLew | 0:80ee8f3b695e | 1552 | * @arg @ref LL_RTC_ALMA_MASK_SECONDS |
EricLew | 0:80ee8f3b695e | 1553 | * @arg @ref LL_RTC_ALMA_MASK_ALL |
EricLew | 0:80ee8f3b695e | 1554 | */ |
EricLew | 0:80ee8f3b695e | 1555 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMask(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1556 | { |
EricLew | 0:80ee8f3b695e | 1557 | return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_MSK4 | RTC_ALRMAR_MSK3 | RTC_ALRMAR_MSK2 | RTC_ALRMAR_MSK1)); |
EricLew | 0:80ee8f3b695e | 1558 | } |
EricLew | 0:80ee8f3b695e | 1559 | |
EricLew | 0:80ee8f3b695e | 1560 | /** |
EricLew | 0:80ee8f3b695e | 1561 | * @brief Enable AlarmA Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) |
EricLew | 0:80ee8f3b695e | 1562 | * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_EnableWeekday |
EricLew | 0:80ee8f3b695e | 1563 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1564 | * @retval None |
EricLew | 0:80ee8f3b695e | 1565 | */ |
EricLew | 0:80ee8f3b695e | 1566 | __STATIC_INLINE void LL_RTC_ALMA_EnableWeekday(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1567 | { |
EricLew | 0:80ee8f3b695e | 1568 | SET_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL); |
EricLew | 0:80ee8f3b695e | 1569 | } |
EricLew | 0:80ee8f3b695e | 1570 | |
EricLew | 0:80ee8f3b695e | 1571 | /** |
EricLew | 0:80ee8f3b695e | 1572 | * @brief Disable AlarmA Week day selection (DU[3:0] represents the date ) |
EricLew | 0:80ee8f3b695e | 1573 | * @rmtoll ALRMAR WDSEL LL_RTC_ALMA_DisableWeekday |
EricLew | 0:80ee8f3b695e | 1574 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1575 | * @retval None |
EricLew | 0:80ee8f3b695e | 1576 | */ |
EricLew | 0:80ee8f3b695e | 1577 | __STATIC_INLINE void LL_RTC_ALMA_DisableWeekday(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1578 | { |
EricLew | 0:80ee8f3b695e | 1579 | CLEAR_BIT(RTCx->ALRMAR, RTC_ALRMAR_WDSEL); |
EricLew | 0:80ee8f3b695e | 1580 | } |
EricLew | 0:80ee8f3b695e | 1581 | |
EricLew | 0:80ee8f3b695e | 1582 | /** |
EricLew | 0:80ee8f3b695e | 1583 | * @brief Set ALARM A Day in BCD format |
EricLew | 0:80ee8f3b695e | 1584 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1585 | * @rmtoll ALRMAR DT LL_RTC_ALMA_SetDay\n |
EricLew | 0:80ee8f3b695e | 1586 | * ALRMAR DU LL_RTC_ALMA_SetDay |
EricLew | 0:80ee8f3b695e | 1587 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1588 | * @param Day 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1589 | * @retval None |
EricLew | 0:80ee8f3b695e | 1590 | */ |
EricLew | 0:80ee8f3b695e | 1591 | __STATIC_INLINE void LL_RTC_ALMA_SetDay(RTC_TypeDef *RTCx, uint32_t Day) |
EricLew | 0:80ee8f3b695e | 1592 | { |
EricLew | 0:80ee8f3b695e | 1593 | MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU), |
EricLew | 0:80ee8f3b695e | 1594 | (((Day & 0xF0) << (RTC_POSITION_ALMA_DT - 4)) | ((Day & 0x0F) << RTC_POSITION_ALMA_DU))); |
EricLew | 0:80ee8f3b695e | 1595 | } |
EricLew | 0:80ee8f3b695e | 1596 | |
EricLew | 0:80ee8f3b695e | 1597 | /** |
EricLew | 0:80ee8f3b695e | 1598 | * @brief Get ALARM A Day in BCD format |
EricLew | 0:80ee8f3b695e | 1599 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1600 | * @rmtoll ALRMAR DT LL_RTC_ALMA_GetDay\n |
EricLew | 0:80ee8f3b695e | 1601 | * ALRMAR DU LL_RTC_ALMA_GetDay |
EricLew | 0:80ee8f3b695e | 1602 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1603 | * @retval 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1604 | */ |
EricLew | 0:80ee8f3b695e | 1605 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1606 | { |
EricLew | 0:80ee8f3b695e | 1607 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1608 | |
EricLew | 0:80ee8f3b695e | 1609 | temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_DT | RTC_ALRMAR_DU)); |
EricLew | 0:80ee8f3b695e | 1610 | return (uint32_t)((((temp & RTC_ALRMAR_DT) >> RTC_POSITION_ALMA_DT) << 4) | ((temp & RTC_ALRMAR_DU) >> RTC_POSITION_ALMA_DU)); |
EricLew | 0:80ee8f3b695e | 1611 | } |
EricLew | 0:80ee8f3b695e | 1612 | |
EricLew | 0:80ee8f3b695e | 1613 | /** |
EricLew | 0:80ee8f3b695e | 1614 | * @brief Set ALARM A Weekday |
EricLew | 0:80ee8f3b695e | 1615 | * @rmtoll ALRMAR DU LL_RTC_ALMA_SetWeekDay |
EricLew | 0:80ee8f3b695e | 1616 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1617 | * @param WeekDay This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1618 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1619 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1620 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1621 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 1622 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 1623 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 1624 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 1625 | * @retval None |
EricLew | 0:80ee8f3b695e | 1626 | */ |
EricLew | 0:80ee8f3b695e | 1627 | __STATIC_INLINE void LL_RTC_ALMA_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) |
EricLew | 0:80ee8f3b695e | 1628 | { |
EricLew | 0:80ee8f3b695e | 1629 | MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_DU, WeekDay << RTC_POSITION_ALMA_DU); |
EricLew | 0:80ee8f3b695e | 1630 | } |
EricLew | 0:80ee8f3b695e | 1631 | |
EricLew | 0:80ee8f3b695e | 1632 | /** |
EricLew | 0:80ee8f3b695e | 1633 | * @brief Get ALARM A Weekday |
EricLew | 0:80ee8f3b695e | 1634 | * @rmtoll ALRMAR DU LL_RTC_ALMA_GetWeekDay |
EricLew | 0:80ee8f3b695e | 1635 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1636 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1637 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1638 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1639 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1640 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 1641 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 1642 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 1643 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 1644 | */ |
EricLew | 0:80ee8f3b695e | 1645 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetWeekDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1646 | { |
EricLew | 0:80ee8f3b695e | 1647 | return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_DU) >> RTC_POSITION_ALMA_DU); |
EricLew | 0:80ee8f3b695e | 1648 | } |
EricLew | 0:80ee8f3b695e | 1649 | |
EricLew | 0:80ee8f3b695e | 1650 | /** |
EricLew | 0:80ee8f3b695e | 1651 | * @brief Set Alarm A time format (AM/24-hour or PM notation) |
EricLew | 0:80ee8f3b695e | 1652 | * @rmtoll ALRMAR PM LL_RTC_ALMA_SetTimeFormat |
EricLew | 0:80ee8f3b695e | 1653 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1654 | * @param Format This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1655 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 1656 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 1657 | * @retval None |
EricLew | 0:80ee8f3b695e | 1658 | */ |
EricLew | 0:80ee8f3b695e | 1659 | __STATIC_INLINE void LL_RTC_ALMA_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t Format) |
EricLew | 0:80ee8f3b695e | 1660 | { |
EricLew | 0:80ee8f3b695e | 1661 | MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM, Format); |
EricLew | 0:80ee8f3b695e | 1662 | } |
EricLew | 0:80ee8f3b695e | 1663 | |
EricLew | 0:80ee8f3b695e | 1664 | /** |
EricLew | 0:80ee8f3b695e | 1665 | * @brief Get Alarm A time format (AM or PM notation) |
EricLew | 0:80ee8f3b695e | 1666 | * @rmtoll ALRMAR PM LL_RTC_ALMA_GetTimeFormat |
EricLew | 0:80ee8f3b695e | 1667 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1668 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1669 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 1670 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 1671 | */ |
EricLew | 0:80ee8f3b695e | 1672 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTimeFormat(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1673 | { |
EricLew | 0:80ee8f3b695e | 1674 | return (uint32_t)(READ_BIT(RTCx->ALRMAR, RTC_ALRMAR_PM)); |
EricLew | 0:80ee8f3b695e | 1675 | } |
EricLew | 0:80ee8f3b695e | 1676 | |
EricLew | 0:80ee8f3b695e | 1677 | /** |
EricLew | 0:80ee8f3b695e | 1678 | * @brief Set ALARM A Hour in BCD format |
EricLew | 0:80ee8f3b695e | 1679 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hour from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1680 | * @rmtoll ALRMAR HT LL_RTC_ALMA_SetHour\n |
EricLew | 0:80ee8f3b695e | 1681 | * ALRMAR HU LL_RTC_ALMA_SetHour |
EricLew | 0:80ee8f3b695e | 1682 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1683 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 1684 | * @retval None |
EricLew | 0:80ee8f3b695e | 1685 | */ |
EricLew | 0:80ee8f3b695e | 1686 | __STATIC_INLINE void LL_RTC_ALMA_SetHour(RTC_TypeDef *RTCx, uint32_t Hour) |
EricLew | 0:80ee8f3b695e | 1687 | { |
EricLew | 0:80ee8f3b695e | 1688 | MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU), |
EricLew | 0:80ee8f3b695e | 1689 | (((Hour & 0xF0) << (RTC_POSITION_ALMA_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_ALMA_HU))); |
EricLew | 0:80ee8f3b695e | 1690 | } |
EricLew | 0:80ee8f3b695e | 1691 | |
EricLew | 0:80ee8f3b695e | 1692 | /** |
EricLew | 0:80ee8f3b695e | 1693 | * @brief Get ALARM A Hour in BCD format |
EricLew | 0:80ee8f3b695e | 1694 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hour from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1695 | * @rmtoll ALRMAR HT LL_RTC_ALMA_GetHour\n |
EricLew | 0:80ee8f3b695e | 1696 | * ALRMAR HU LL_RTC_ALMA_GetHour |
EricLew | 0:80ee8f3b695e | 1697 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1698 | * @retval 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 1699 | */ |
EricLew | 0:80ee8f3b695e | 1700 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1701 | { |
EricLew | 0:80ee8f3b695e | 1702 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1703 | |
EricLew | 0:80ee8f3b695e | 1704 | temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_HT | RTC_ALRMAR_HU)); |
EricLew | 0:80ee8f3b695e | 1705 | return (uint32_t)((((temp & RTC_ALRMAR_HT) >> RTC_POSITION_ALMA_HT) << 4) | ((temp & RTC_ALRMAR_HU) >> RTC_POSITION_ALMA_HU)); |
EricLew | 0:80ee8f3b695e | 1706 | } |
EricLew | 0:80ee8f3b695e | 1707 | |
EricLew | 0:80ee8f3b695e | 1708 | /** |
EricLew | 0:80ee8f3b695e | 1709 | * @brief Set ALARM A Minute in BCD format |
EricLew | 0:80ee8f3b695e | 1710 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minute from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1711 | * @rmtoll ALRMAR MNT LL_RTC_ALMA_SetMinute\n |
EricLew | 0:80ee8f3b695e | 1712 | * ALRMAR MNU LL_RTC_ALMA_SetMinute |
EricLew | 0:80ee8f3b695e | 1713 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1714 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1715 | * @retval None |
EricLew | 0:80ee8f3b695e | 1716 | */ |
EricLew | 0:80ee8f3b695e | 1717 | __STATIC_INLINE void LL_RTC_ALMA_SetMinute(RTC_TypeDef *RTCx, uint32_t Minute) |
EricLew | 0:80ee8f3b695e | 1718 | { |
EricLew | 0:80ee8f3b695e | 1719 | MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU), |
EricLew | 0:80ee8f3b695e | 1720 | (((Minute & 0xF0) << (RTC_POSITION_ALMA_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_ALMA_MU))); |
EricLew | 0:80ee8f3b695e | 1721 | } |
EricLew | 0:80ee8f3b695e | 1722 | |
EricLew | 0:80ee8f3b695e | 1723 | /** |
EricLew | 0:80ee8f3b695e | 1724 | * @brief Get ALARM A Minute in BCD format |
EricLew | 0:80ee8f3b695e | 1725 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minute from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1726 | * @rmtoll ALRMAR MNT LL_RTC_ALMA_GetMinute\n |
EricLew | 0:80ee8f3b695e | 1727 | * ALRMAR MNU LL_RTC_ALMA_GetMinute |
EricLew | 0:80ee8f3b695e | 1728 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1729 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1730 | */ |
EricLew | 0:80ee8f3b695e | 1731 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetMinute(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1732 | { |
EricLew | 0:80ee8f3b695e | 1733 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1734 | |
EricLew | 0:80ee8f3b695e | 1735 | temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_MNT | RTC_ALRMAR_MNU)); |
EricLew | 0:80ee8f3b695e | 1736 | return (uint32_t)((((temp & RTC_ALRMAR_MNT) >> RTC_POSITION_ALMA_MT) << 4) | ((temp & RTC_ALRMAR_MNU) >> RTC_POSITION_ALMA_MU)); |
EricLew | 0:80ee8f3b695e | 1737 | } |
EricLew | 0:80ee8f3b695e | 1738 | |
EricLew | 0:80ee8f3b695e | 1739 | /** |
EricLew | 0:80ee8f3b695e | 1740 | * @brief Set ALARM A Second in BCD format |
EricLew | 0:80ee8f3b695e | 1741 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Second from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1742 | * @rmtoll ALRMAR ST LL_RTC_ALMA_SetSecond\n |
EricLew | 0:80ee8f3b695e | 1743 | * ALRMAR SU LL_RTC_ALMA_SetSecond |
EricLew | 0:80ee8f3b695e | 1744 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1745 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1746 | * @retval None |
EricLew | 0:80ee8f3b695e | 1747 | */ |
EricLew | 0:80ee8f3b695e | 1748 | __STATIC_INLINE void LL_RTC_ALMA_SetSecond(RTC_TypeDef *RTCx, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 1749 | { |
EricLew | 0:80ee8f3b695e | 1750 | MODIFY_REG(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU), |
EricLew | 0:80ee8f3b695e | 1751 | (((Second & 0xF0) << (RTC_POSITION_ALMA_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_ALMA_SU))); |
EricLew | 0:80ee8f3b695e | 1752 | } |
EricLew | 0:80ee8f3b695e | 1753 | |
EricLew | 0:80ee8f3b695e | 1754 | /** |
EricLew | 0:80ee8f3b695e | 1755 | * @brief Get ALARM A Second in BCD format |
EricLew | 0:80ee8f3b695e | 1756 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Second from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1757 | * @rmtoll ALRMAR ST LL_RTC_ALMA_GetSecond\n |
EricLew | 0:80ee8f3b695e | 1758 | * ALRMAR SU LL_RTC_ALMA_GetSecond |
EricLew | 0:80ee8f3b695e | 1759 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1760 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1761 | */ |
EricLew | 0:80ee8f3b695e | 1762 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1763 | { |
EricLew | 0:80ee8f3b695e | 1764 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1765 | |
EricLew | 0:80ee8f3b695e | 1766 | temp = READ_BIT(RTCx->ALRMAR, (RTC_ALRMAR_ST | RTC_ALRMAR_SU)); |
EricLew | 0:80ee8f3b695e | 1767 | return (uint32_t)((((temp & RTC_ALRMAR_ST) >> RTC_POSITION_ALMA_ST) << 4) | ((temp & RTC_ALRMAR_SU) >> RTC_POSITION_ALMA_SU)); |
EricLew | 0:80ee8f3b695e | 1768 | } |
EricLew | 0:80ee8f3b695e | 1769 | |
EricLew | 0:80ee8f3b695e | 1770 | /** |
EricLew | 0:80ee8f3b695e | 1771 | * @brief Set Alarm A Time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 1772 | * @rmtoll ALRMAR PM LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1773 | * ALRMAR HT LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1774 | * ALRMAR HU LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1775 | * ALRMAR MNT LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1776 | * ALRMAR MNU LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1777 | * ALRMAR ST LL_RTC_ALMA_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 1778 | * ALRMAR SU LL_RTC_ALMA_ConfigTime |
EricLew | 0:80ee8f3b695e | 1779 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1780 | * @param Format12_24 This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1781 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 1782 | * @arg @ref LL_RTC_ALMA_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 1783 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 1784 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1785 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 1786 | * @retval None |
EricLew | 0:80ee8f3b695e | 1787 | */ |
EricLew | 0:80ee8f3b695e | 1788 | __STATIC_INLINE void LL_RTC_ALMA_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hour, uint32_t Minute, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 1789 | { |
EricLew | 0:80ee8f3b695e | 1790 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1791 | |
EricLew | 0:80ee8f3b695e | 1792 | temp = Format12_24 | (((Hour & 0xF0) << (RTC_POSITION_ALMA_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_ALMA_HU)) | \ |
EricLew | 0:80ee8f3b695e | 1793 | (((Minute & 0xF0) << (RTC_POSITION_ALMA_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_ALMA_MU)) | \ |
EricLew | 0:80ee8f3b695e | 1794 | (((Second & 0xF0) << (RTC_POSITION_ALMA_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_ALMA_SU)); |
EricLew | 0:80ee8f3b695e | 1795 | |
EricLew | 0:80ee8f3b695e | 1796 | MODIFY_REG(RTCx->ALRMAR, RTC_ALRMAR_PM | RTC_ALRMAR_HT | RTC_ALRMAR_HU | RTC_ALRMAR_MNT | RTC_ALRMAR_MNU | RTC_ALRMAR_ST | RTC_ALRMAR_SU, temp); |
EricLew | 0:80ee8f3b695e | 1797 | } |
EricLew | 0:80ee8f3b695e | 1798 | |
EricLew | 0:80ee8f3b695e | 1799 | /** |
EricLew | 0:80ee8f3b695e | 1800 | * @brief Get Alarm B Time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 1801 | * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND |
EricLew | 0:80ee8f3b695e | 1802 | * are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 1803 | * @rmtoll ALRMAR HT LL_RTC_ALMA_GetTime\n |
EricLew | 0:80ee8f3b695e | 1804 | * ALRMAR HU LL_RTC_ALMA_GetTime\n |
EricLew | 0:80ee8f3b695e | 1805 | * ALRMAR MNT LL_RTC_ALMA_GetTime\n |
EricLew | 0:80ee8f3b695e | 1806 | * ALRMAR MNU LL_RTC_ALMA_GetTime\n |
EricLew | 0:80ee8f3b695e | 1807 | * ALRMAR ST LL_RTC_ALMA_GetTime\n |
EricLew | 0:80ee8f3b695e | 1808 | * ALRMAR SU LL_RTC_ALMA_GetTime |
EricLew | 0:80ee8f3b695e | 1809 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1810 | * @retval Combination of hours, minutes and seconds. |
EricLew | 0:80ee8f3b695e | 1811 | */ |
EricLew | 0:80ee8f3b695e | 1812 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetTime(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1813 | { |
EricLew | 0:80ee8f3b695e | 1814 | return (uint32_t)((LL_RTC_ALMA_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMA_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMA_GetSecond(RTCx)); |
EricLew | 0:80ee8f3b695e | 1815 | } |
EricLew | 0:80ee8f3b695e | 1816 | |
EricLew | 0:80ee8f3b695e | 1817 | /** |
EricLew | 0:80ee8f3b695e | 1818 | * @brief Set Alarm A Mask the most-significant bits starting at this bit |
EricLew | 0:80ee8f3b695e | 1819 | * @note This register can be written only when ALRAE is reset in RTC_CR register, |
EricLew | 0:80ee8f3b695e | 1820 | * or in initialization mode. |
EricLew | 0:80ee8f3b695e | 1821 | * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_SetSubSecondMask |
EricLew | 0:80ee8f3b695e | 1822 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1823 | * @param Mask 0. . .0xF |
EricLew | 0:80ee8f3b695e | 1824 | * @retval None |
EricLew | 0:80ee8f3b695e | 1825 | */ |
EricLew | 0:80ee8f3b695e | 1826 | __STATIC_INLINE void LL_RTC_ALMA_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 1827 | { |
EricLew | 0:80ee8f3b695e | 1828 | MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS, Mask << RTC_POSITION_ALMA_MASKSS); |
EricLew | 0:80ee8f3b695e | 1829 | } |
EricLew | 0:80ee8f3b695e | 1830 | |
EricLew | 0:80ee8f3b695e | 1831 | /** |
EricLew | 0:80ee8f3b695e | 1832 | * @brief Get Alarm A Mask the most-significant bits starting at this bit |
EricLew | 0:80ee8f3b695e | 1833 | * @rmtoll ALRMASSR MASKSS LL_RTC_ALMA_GetSubSecondMask |
EricLew | 0:80ee8f3b695e | 1834 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1835 | * @retval 0. . .0xF |
EricLew | 0:80ee8f3b695e | 1836 | */ |
EricLew | 0:80ee8f3b695e | 1837 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecondMask(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1838 | { |
EricLew | 0:80ee8f3b695e | 1839 | return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_MASKSS) >> RTC_POSITION_ALMA_MASKSS); |
EricLew | 0:80ee8f3b695e | 1840 | } |
EricLew | 0:80ee8f3b695e | 1841 | |
EricLew | 0:80ee8f3b695e | 1842 | /** |
EricLew | 0:80ee8f3b695e | 1843 | * @brief Set Alarm A Sub seconds value |
EricLew | 0:80ee8f3b695e | 1844 | * @rmtoll ALRMASSR SS LL_RTC_ALMA_SetSubSecond |
EricLew | 0:80ee8f3b695e | 1845 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1846 | * @param Subsecond 0. . .0x7FFF |
EricLew | 0:80ee8f3b695e | 1847 | * @retval None |
EricLew | 0:80ee8f3b695e | 1848 | */ |
EricLew | 0:80ee8f3b695e | 1849 | __STATIC_INLINE void LL_RTC_ALMA_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond) |
EricLew | 0:80ee8f3b695e | 1850 | { |
EricLew | 0:80ee8f3b695e | 1851 | MODIFY_REG(RTCx->ALRMASSR, RTC_ALRMASSR_SS, Subsecond); |
EricLew | 0:80ee8f3b695e | 1852 | } |
EricLew | 0:80ee8f3b695e | 1853 | |
EricLew | 0:80ee8f3b695e | 1854 | /** |
EricLew | 0:80ee8f3b695e | 1855 | * @brief Get Alarm A Sub seconds value |
EricLew | 0:80ee8f3b695e | 1856 | * @rmtoll ALRMASSR SS LL_RTC_ALMA_GetSubSecond |
EricLew | 0:80ee8f3b695e | 1857 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1858 | * @retval 0. . .0x7FFF |
EricLew | 0:80ee8f3b695e | 1859 | */ |
EricLew | 0:80ee8f3b695e | 1860 | __STATIC_INLINE uint32_t LL_RTC_ALMA_GetSubSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1861 | { |
EricLew | 0:80ee8f3b695e | 1862 | return (uint32_t)(READ_BIT(RTCx->ALRMASSR, RTC_ALRMASSR_SS)); |
EricLew | 0:80ee8f3b695e | 1863 | } |
EricLew | 0:80ee8f3b695e | 1864 | |
EricLew | 0:80ee8f3b695e | 1865 | /** |
EricLew | 0:80ee8f3b695e | 1866 | * @} |
EricLew | 0:80ee8f3b695e | 1867 | */ |
EricLew | 0:80ee8f3b695e | 1868 | |
EricLew | 0:80ee8f3b695e | 1869 | /** @defgroup RTC_LL_EF_ALARMB ALARMB |
EricLew | 0:80ee8f3b695e | 1870 | * @{ |
EricLew | 0:80ee8f3b695e | 1871 | */ |
EricLew | 0:80ee8f3b695e | 1872 | |
EricLew | 0:80ee8f3b695e | 1873 | /** |
EricLew | 0:80ee8f3b695e | 1874 | * @brief Enable Alarm B |
EricLew | 0:80ee8f3b695e | 1875 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1876 | * @rmtoll CR ALRBE LL_RTC_ALMB_Enable |
EricLew | 0:80ee8f3b695e | 1877 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1878 | * @retval None |
EricLew | 0:80ee8f3b695e | 1879 | */ |
EricLew | 0:80ee8f3b695e | 1880 | __STATIC_INLINE void LL_RTC_ALMB_Enable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1881 | { |
EricLew | 0:80ee8f3b695e | 1882 | SET_BIT(RTCx->CR, RTC_CR_ALRBE); |
EricLew | 0:80ee8f3b695e | 1883 | } |
EricLew | 0:80ee8f3b695e | 1884 | |
EricLew | 0:80ee8f3b695e | 1885 | /** |
EricLew | 0:80ee8f3b695e | 1886 | * @brief Disable Alarm B |
EricLew | 0:80ee8f3b695e | 1887 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 1888 | * @rmtoll CR ALRBE LL_RTC_ALMB_Disable |
EricLew | 0:80ee8f3b695e | 1889 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1890 | * @retval None |
EricLew | 0:80ee8f3b695e | 1891 | */ |
EricLew | 0:80ee8f3b695e | 1892 | __STATIC_INLINE void LL_RTC_ALMB_Disable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1893 | { |
EricLew | 0:80ee8f3b695e | 1894 | CLEAR_BIT(RTCx->CR, RTC_CR_ALRBE); |
EricLew | 0:80ee8f3b695e | 1895 | } |
EricLew | 0:80ee8f3b695e | 1896 | |
EricLew | 0:80ee8f3b695e | 1897 | /** |
EricLew | 0:80ee8f3b695e | 1898 | * @brief Specify the Alarm B masks. |
EricLew | 0:80ee8f3b695e | 1899 | * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_SetMask\n |
EricLew | 0:80ee8f3b695e | 1900 | * ALRMBR MSK3 LL_RTC_ALMB_SetMask\n |
EricLew | 0:80ee8f3b695e | 1901 | * ALRMBR MSK2 LL_RTC_ALMB_SetMask\n |
EricLew | 0:80ee8f3b695e | 1902 | * ALRMBR MSK1 LL_RTC_ALMB_SetMask |
EricLew | 0:80ee8f3b695e | 1903 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1904 | * @param Mask This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 1905 | * @arg @ref LL_RTC_ALMB_MASK_NONE |
EricLew | 0:80ee8f3b695e | 1906 | * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY |
EricLew | 0:80ee8f3b695e | 1907 | * @arg @ref LL_RTC_ALMB_MASK_HOURS |
EricLew | 0:80ee8f3b695e | 1908 | * @arg @ref LL_RTC_ALMB_MASK_MINUTES |
EricLew | 0:80ee8f3b695e | 1909 | * @arg @ref LL_RTC_ALMB_MASK_SECONDS |
EricLew | 0:80ee8f3b695e | 1910 | * @arg @ref LL_RTC_ALMB_MASK_ALL |
EricLew | 0:80ee8f3b695e | 1911 | * @retval None |
EricLew | 0:80ee8f3b695e | 1912 | */ |
EricLew | 0:80ee8f3b695e | 1913 | __STATIC_INLINE void LL_RTC_ALMB_SetMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 1914 | { |
EricLew | 0:80ee8f3b695e | 1915 | MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1, Mask); |
EricLew | 0:80ee8f3b695e | 1916 | } |
EricLew | 0:80ee8f3b695e | 1917 | |
EricLew | 0:80ee8f3b695e | 1918 | /** |
EricLew | 0:80ee8f3b695e | 1919 | * @brief Get the Alarm B masks. |
EricLew | 0:80ee8f3b695e | 1920 | * @rmtoll ALRMBR MSK4 LL_RTC_ALMB_GetMask\n |
EricLew | 0:80ee8f3b695e | 1921 | * ALRMBR MSK3 LL_RTC_ALMB_GetMask\n |
EricLew | 0:80ee8f3b695e | 1922 | * ALRMBR MSK2 LL_RTC_ALMB_GetMask\n |
EricLew | 0:80ee8f3b695e | 1923 | * ALRMBR MSK1 LL_RTC_ALMB_GetMask |
EricLew | 0:80ee8f3b695e | 1924 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1925 | * @retval Returned value can be can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 1926 | * @arg @ref LL_RTC_ALMB_MASK_NONE |
EricLew | 0:80ee8f3b695e | 1927 | * @arg @ref LL_RTC_ALMB_MASK_DATEWEEKDAY |
EricLew | 0:80ee8f3b695e | 1928 | * @arg @ref LL_RTC_ALMB_MASK_HOURS |
EricLew | 0:80ee8f3b695e | 1929 | * @arg @ref LL_RTC_ALMB_MASK_MINUTES |
EricLew | 0:80ee8f3b695e | 1930 | * @arg @ref LL_RTC_ALMB_MASK_SECONDS |
EricLew | 0:80ee8f3b695e | 1931 | * @arg @ref LL_RTC_ALMB_MASK_ALL |
EricLew | 0:80ee8f3b695e | 1932 | */ |
EricLew | 0:80ee8f3b695e | 1933 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMask(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1934 | { |
EricLew | 0:80ee8f3b695e | 1935 | return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_MSK4 | RTC_ALRMBR_MSK3 | RTC_ALRMBR_MSK2 | RTC_ALRMBR_MSK1)); |
EricLew | 0:80ee8f3b695e | 1936 | } |
EricLew | 0:80ee8f3b695e | 1937 | |
EricLew | 0:80ee8f3b695e | 1938 | /** |
EricLew | 0:80ee8f3b695e | 1939 | * @brief Enable AlarmB Week day selection (DU[3:0] represents the week day. DT[1:0] is do not care) |
EricLew | 0:80ee8f3b695e | 1940 | * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_EnableWeekday |
EricLew | 0:80ee8f3b695e | 1941 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1942 | * @retval None |
EricLew | 0:80ee8f3b695e | 1943 | */ |
EricLew | 0:80ee8f3b695e | 1944 | __STATIC_INLINE void LL_RTC_ALMB_EnableWeekday(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1945 | { |
EricLew | 0:80ee8f3b695e | 1946 | SET_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL); |
EricLew | 0:80ee8f3b695e | 1947 | } |
EricLew | 0:80ee8f3b695e | 1948 | |
EricLew | 0:80ee8f3b695e | 1949 | /** |
EricLew | 0:80ee8f3b695e | 1950 | * @brief Disable AlarmB Week day selection (DU[3:0] represents the date ) |
EricLew | 0:80ee8f3b695e | 1951 | * @rmtoll ALRMBR WDSEL LL_RTC_ALMB_DisableWeekday |
EricLew | 0:80ee8f3b695e | 1952 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1953 | * @retval None |
EricLew | 0:80ee8f3b695e | 1954 | */ |
EricLew | 0:80ee8f3b695e | 1955 | __STATIC_INLINE void LL_RTC_ALMB_DisableWeekday(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1956 | { |
EricLew | 0:80ee8f3b695e | 1957 | CLEAR_BIT(RTCx->ALRMBR, RTC_ALRMBR_WDSEL); |
EricLew | 0:80ee8f3b695e | 1958 | } |
EricLew | 0:80ee8f3b695e | 1959 | |
EricLew | 0:80ee8f3b695e | 1960 | /** |
EricLew | 0:80ee8f3b695e | 1961 | * @brief Set ALARM B Day in BCD format |
EricLew | 0:80ee8f3b695e | 1962 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Day from binary to BCD format |
EricLew | 0:80ee8f3b695e | 1963 | * @rmtoll ALRMBR DT LL_RTC_ALMB_SetDay\n |
EricLew | 0:80ee8f3b695e | 1964 | * ALRMBR DU LL_RTC_ALMB_SetDay |
EricLew | 0:80ee8f3b695e | 1965 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1966 | * @param Day 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1967 | * @retval None |
EricLew | 0:80ee8f3b695e | 1968 | */ |
EricLew | 0:80ee8f3b695e | 1969 | __STATIC_INLINE void LL_RTC_ALMB_SetDay(RTC_TypeDef *RTCx, uint32_t Day) |
EricLew | 0:80ee8f3b695e | 1970 | { |
EricLew | 0:80ee8f3b695e | 1971 | MODIFY_REG(RTC->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU), |
EricLew | 0:80ee8f3b695e | 1972 | (((Day & 0xF0) << (RTC_POSITION_ALMB_DT - 4)) | ((Day & 0x0F) << RTC_POSITION_ALMB_DU))); |
EricLew | 0:80ee8f3b695e | 1973 | } |
EricLew | 0:80ee8f3b695e | 1974 | |
EricLew | 0:80ee8f3b695e | 1975 | /** |
EricLew | 0:80ee8f3b695e | 1976 | * @brief Get ALARM B Day in BCD format |
EricLew | 0:80ee8f3b695e | 1977 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 1978 | * @rmtoll ALRMBR DT LL_RTC_ALMB_GetDay\n |
EricLew | 0:80ee8f3b695e | 1979 | * ALRMBR DU LL_RTC_ALMB_GetDay |
EricLew | 0:80ee8f3b695e | 1980 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1981 | * @retval 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 1982 | */ |
EricLew | 0:80ee8f3b695e | 1983 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 1984 | { |
EricLew | 0:80ee8f3b695e | 1985 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 1986 | |
EricLew | 0:80ee8f3b695e | 1987 | temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_DT | RTC_ALRMBR_DU)); |
EricLew | 0:80ee8f3b695e | 1988 | return (uint32_t)((((temp & RTC_ALRMBR_DT) >> RTC_POSITION_ALMB_DT) << 4) | ((temp & RTC_ALRMBR_DU) >> RTC_POSITION_ALMB_DU)); |
EricLew | 0:80ee8f3b695e | 1989 | } |
EricLew | 0:80ee8f3b695e | 1990 | |
EricLew | 0:80ee8f3b695e | 1991 | /** |
EricLew | 0:80ee8f3b695e | 1992 | * @brief Set ALARM B Weekday |
EricLew | 0:80ee8f3b695e | 1993 | * @rmtoll ALRMBR DU LL_RTC_ALMB_SetWeekDay |
EricLew | 0:80ee8f3b695e | 1994 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 1995 | * @param WeekDay This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 1996 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 1997 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 1998 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 1999 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 2000 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 2001 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 2002 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 2003 | * @retval None |
EricLew | 0:80ee8f3b695e | 2004 | */ |
EricLew | 0:80ee8f3b695e | 2005 | __STATIC_INLINE void LL_RTC_ALMB_SetWeekDay(RTC_TypeDef *RTCx, uint32_t WeekDay) |
EricLew | 0:80ee8f3b695e | 2006 | { |
EricLew | 0:80ee8f3b695e | 2007 | MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_DU, WeekDay << RTC_POSITION_ALMB_DU); |
EricLew | 0:80ee8f3b695e | 2008 | } |
EricLew | 0:80ee8f3b695e | 2009 | |
EricLew | 0:80ee8f3b695e | 2010 | /** |
EricLew | 0:80ee8f3b695e | 2011 | * @brief Get ALARM B Weekday |
EricLew | 0:80ee8f3b695e | 2012 | * @rmtoll ALRMBR DU LL_RTC_ALMB_GetWeekDay |
EricLew | 0:80ee8f3b695e | 2013 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2014 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2015 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 2016 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 2017 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 2018 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 2019 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 2020 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 2021 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 2022 | */ |
EricLew | 0:80ee8f3b695e | 2023 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetWeekDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2024 | { |
EricLew | 0:80ee8f3b695e | 2025 | return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_DU) >> RTC_POSITION_ALMB_DU); |
EricLew | 0:80ee8f3b695e | 2026 | } |
EricLew | 0:80ee8f3b695e | 2027 | |
EricLew | 0:80ee8f3b695e | 2028 | /** |
EricLew | 0:80ee8f3b695e | 2029 | * @brief Set ALARM B time format (AM/24-hour or PM notation) |
EricLew | 0:80ee8f3b695e | 2030 | * @rmtoll ALRMBR PM LL_RTC_ALMB_SetTimeFormat |
EricLew | 0:80ee8f3b695e | 2031 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2032 | * @param Format This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2033 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 2034 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 2035 | * @retval None |
EricLew | 0:80ee8f3b695e | 2036 | */ |
EricLew | 0:80ee8f3b695e | 2037 | __STATIC_INLINE void LL_RTC_ALMB_SetTimeFormat(RTC_TypeDef *RTCx, uint32_t Format) |
EricLew | 0:80ee8f3b695e | 2038 | { |
EricLew | 0:80ee8f3b695e | 2039 | MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM, Format); |
EricLew | 0:80ee8f3b695e | 2040 | } |
EricLew | 0:80ee8f3b695e | 2041 | |
EricLew | 0:80ee8f3b695e | 2042 | /** |
EricLew | 0:80ee8f3b695e | 2043 | * @brief Get ALARM B time format (AM or PM notation) |
EricLew | 0:80ee8f3b695e | 2044 | * @rmtoll ALRMBR PM LL_RTC_ALMB_GetTimeFormat |
EricLew | 0:80ee8f3b695e | 2045 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2046 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2047 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 2048 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 2049 | */ |
EricLew | 0:80ee8f3b695e | 2050 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTimeFormat(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2051 | { |
EricLew | 0:80ee8f3b695e | 2052 | return (uint32_t)(READ_BIT(RTCx->ALRMBR, RTC_ALRMBR_PM)); |
EricLew | 0:80ee8f3b695e | 2053 | } |
EricLew | 0:80ee8f3b695e | 2054 | |
EricLew | 0:80ee8f3b695e | 2055 | /** |
EricLew | 0:80ee8f3b695e | 2056 | * @brief Set ALARM B Hour in BCD format |
EricLew | 0:80ee8f3b695e | 2057 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Hour from binary to BCD format |
EricLew | 0:80ee8f3b695e | 2058 | * @rmtoll ALRMBR HT LL_RTC_ALMB_SetHour\n |
EricLew | 0:80ee8f3b695e | 2059 | * ALRMBR HU LL_RTC_ALMB_SetHour |
EricLew | 0:80ee8f3b695e | 2060 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2061 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 2062 | * @retval None |
EricLew | 0:80ee8f3b695e | 2063 | */ |
EricLew | 0:80ee8f3b695e | 2064 | __STATIC_INLINE void LL_RTC_ALMB_SetHour(RTC_TypeDef *RTCx, uint32_t Hour) |
EricLew | 0:80ee8f3b695e | 2065 | { |
EricLew | 0:80ee8f3b695e | 2066 | MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU), |
EricLew | 0:80ee8f3b695e | 2067 | (((Hour & 0xF0) << (RTC_POSITION_ALMB_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_ALMB_HU))); |
EricLew | 0:80ee8f3b695e | 2068 | } |
EricLew | 0:80ee8f3b695e | 2069 | |
EricLew | 0:80ee8f3b695e | 2070 | /** |
EricLew | 0:80ee8f3b695e | 2071 | * @brief Get ALARM B Hour in BCD format |
EricLew | 0:80ee8f3b695e | 2072 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hour from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2073 | * @rmtoll ALRMBR HT LL_RTC_ALMB_GetHour\n |
EricLew | 0:80ee8f3b695e | 2074 | * ALRMBR HU LL_RTC_ALMB_GetHour |
EricLew | 0:80ee8f3b695e | 2075 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2076 | * @retval 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 2077 | */ |
EricLew | 0:80ee8f3b695e | 2078 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2079 | { |
EricLew | 0:80ee8f3b695e | 2080 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 2081 | |
EricLew | 0:80ee8f3b695e | 2082 | temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_HT | RTC_ALRMBR_HU)); |
EricLew | 0:80ee8f3b695e | 2083 | return (uint32_t)((((temp & RTC_ALRMBR_HT) >> RTC_POSITION_ALMB_HT) << 4) | ((temp & RTC_ALRMBR_HU) >> RTC_POSITION_ALMB_HU)); |
EricLew | 0:80ee8f3b695e | 2084 | } |
EricLew | 0:80ee8f3b695e | 2085 | |
EricLew | 0:80ee8f3b695e | 2086 | /** |
EricLew | 0:80ee8f3b695e | 2087 | * @brief Set ALARM B Minute in BCD format |
EricLew | 0:80ee8f3b695e | 2088 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Minute from binary to BCD format |
EricLew | 0:80ee8f3b695e | 2089 | * @rmtoll ALRMBR MNT LL_RTC_ALMB_SetMinute\n |
EricLew | 0:80ee8f3b695e | 2090 | * ALRMBR MNU LL_RTC_ALMB_SetMinute |
EricLew | 0:80ee8f3b695e | 2091 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2092 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2093 | * @retval None |
EricLew | 0:80ee8f3b695e | 2094 | */ |
EricLew | 0:80ee8f3b695e | 2095 | __STATIC_INLINE void LL_RTC_ALMB_SetMinute(RTC_TypeDef *RTCx, uint32_t Minute) |
EricLew | 0:80ee8f3b695e | 2096 | { |
EricLew | 0:80ee8f3b695e | 2097 | MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU), |
EricLew | 0:80ee8f3b695e | 2098 | (((Minute & 0xF0) << (RTC_POSITION_ALMB_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_ALMB_MU))); |
EricLew | 0:80ee8f3b695e | 2099 | } |
EricLew | 0:80ee8f3b695e | 2100 | |
EricLew | 0:80ee8f3b695e | 2101 | /** |
EricLew | 0:80ee8f3b695e | 2102 | * @brief Get ALARM B Minute in BCD format |
EricLew | 0:80ee8f3b695e | 2103 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minute from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2104 | * @rmtoll ALRMBR MNT LL_RTC_ALMB_GetMinute\n |
EricLew | 0:80ee8f3b695e | 2105 | * ALRMBR MNU LL_RTC_ALMB_GetMinute |
EricLew | 0:80ee8f3b695e | 2106 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2107 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2108 | */ |
EricLew | 0:80ee8f3b695e | 2109 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetMinute(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2110 | { |
EricLew | 0:80ee8f3b695e | 2111 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 2112 | |
EricLew | 0:80ee8f3b695e | 2113 | temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_MNT | RTC_ALRMBR_MNU)); |
EricLew | 0:80ee8f3b695e | 2114 | return (uint32_t)((((temp & RTC_ALRMBR_MNT) >> RTC_POSITION_ALMB_MT) << 4) | ((temp & RTC_ALRMBR_MNU) >> RTC_POSITION_ALMB_MU)); |
EricLew | 0:80ee8f3b695e | 2115 | } |
EricLew | 0:80ee8f3b695e | 2116 | |
EricLew | 0:80ee8f3b695e | 2117 | /** |
EricLew | 0:80ee8f3b695e | 2118 | * @brief Set ALARM B Second in BCD format |
EricLew | 0:80ee8f3b695e | 2119 | * @note helper macro __LL_RTC_CONVERT_BIN2BCD is available to convert Second from binary to BCD format |
EricLew | 0:80ee8f3b695e | 2120 | * @rmtoll ALRMBR ST LL_RTC_ALMB_SetSecond\n |
EricLew | 0:80ee8f3b695e | 2121 | * ALRMBR SU LL_RTC_ALMB_SetSecond |
EricLew | 0:80ee8f3b695e | 2122 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2123 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2124 | * @retval None |
EricLew | 0:80ee8f3b695e | 2125 | */ |
EricLew | 0:80ee8f3b695e | 2126 | __STATIC_INLINE void LL_RTC_ALMB_SetSecond(RTC_TypeDef *RTCx, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 2127 | { |
EricLew | 0:80ee8f3b695e | 2128 | MODIFY_REG(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU), |
EricLew | 0:80ee8f3b695e | 2129 | (((Second & 0xF0) << (RTC_POSITION_ALMB_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_ALMB_SU))); |
EricLew | 0:80ee8f3b695e | 2130 | } |
EricLew | 0:80ee8f3b695e | 2131 | |
EricLew | 0:80ee8f3b695e | 2132 | /** |
EricLew | 0:80ee8f3b695e | 2133 | * @brief Get ALARM B Second in BCD format |
EricLew | 0:80ee8f3b695e | 2134 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Second from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2135 | * @rmtoll ALRMBR ST LL_RTC_ALMB_GetSecond\n |
EricLew | 0:80ee8f3b695e | 2136 | * ALRMBR SU LL_RTC_ALMB_GetSecond |
EricLew | 0:80ee8f3b695e | 2137 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2138 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2139 | */ |
EricLew | 0:80ee8f3b695e | 2140 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2141 | { |
EricLew | 0:80ee8f3b695e | 2142 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 2143 | |
EricLew | 0:80ee8f3b695e | 2144 | temp = READ_BIT(RTCx->ALRMBR, (RTC_ALRMBR_ST | RTC_ALRMBR_SU)); |
EricLew | 0:80ee8f3b695e | 2145 | return (uint32_t)((((temp & RTC_ALRMBR_ST) >> RTC_POSITION_ALMB_ST) << 4) | ((temp & RTC_ALRMBR_SU) >> RTC_POSITION_ALMB_SU)); |
EricLew | 0:80ee8f3b695e | 2146 | } |
EricLew | 0:80ee8f3b695e | 2147 | |
EricLew | 0:80ee8f3b695e | 2148 | /** |
EricLew | 0:80ee8f3b695e | 2149 | * @brief Set Alarm B Time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 2150 | * @rmtoll ALRMBR PM LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2151 | * ALRMBR HT LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2152 | * ALRMBR HU LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2153 | * ALRMBR MNT LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2154 | * ALRMBR MNU LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2155 | * ALRMBR ST LL_RTC_ALMB_ConfigTime\n |
EricLew | 0:80ee8f3b695e | 2156 | * ALRMBR SU LL_RTC_ALMB_ConfigTime |
EricLew | 0:80ee8f3b695e | 2157 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2158 | * @param Format12_24 This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2159 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 2160 | * @arg @ref LL_RTC_ALMB_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 2161 | * @param Hour 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 2162 | * @param Minute 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2163 | * @param Second 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2164 | * @retval None |
EricLew | 0:80ee8f3b695e | 2165 | */ |
EricLew | 0:80ee8f3b695e | 2166 | __STATIC_INLINE void LL_RTC_ALMB_ConfigTime(RTC_TypeDef *RTCx, uint32_t Format12_24, uint32_t Hour, uint32_t Minute, uint32_t Second) |
EricLew | 0:80ee8f3b695e | 2167 | { |
EricLew | 0:80ee8f3b695e | 2168 | register uint32_t temp = 0; |
EricLew | 0:80ee8f3b695e | 2169 | |
EricLew | 0:80ee8f3b695e | 2170 | temp = Format12_24 | (((Hour & 0xF0) << (RTC_POSITION_ALMB_HT - 4)) | ((Hour & 0x0F) << RTC_POSITION_ALMB_HU)) | \ |
EricLew | 0:80ee8f3b695e | 2171 | (((Minute & 0xF0) << (RTC_POSITION_ALMB_MT - 4)) | ((Minute & 0x0F) << RTC_POSITION_ALMB_MU)) | \ |
EricLew | 0:80ee8f3b695e | 2172 | (((Second & 0xF0) << (RTC_POSITION_ALMB_ST - 4)) | ((Second & 0x0F) << RTC_POSITION_ALMB_SU)); |
EricLew | 0:80ee8f3b695e | 2173 | |
EricLew | 0:80ee8f3b695e | 2174 | MODIFY_REG(RTCx->ALRMBR, RTC_ALRMBR_PM| RTC_ALRMBR_HT | RTC_ALRMBR_HU | RTC_ALRMBR_MNT | RTC_ALRMBR_MNU | RTC_ALRMBR_ST | RTC_ALRMBR_SU, temp); |
EricLew | 0:80ee8f3b695e | 2175 | } |
EricLew | 0:80ee8f3b695e | 2176 | |
EricLew | 0:80ee8f3b695e | 2177 | /** |
EricLew | 0:80ee8f3b695e | 2178 | * @brief Get Alarm B Time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 2179 | * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND |
EricLew | 0:80ee8f3b695e | 2180 | * are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 2181 | * @rmtoll ALRMBR HT LL_RTC_ALMB_GetTime\n |
EricLew | 0:80ee8f3b695e | 2182 | * ALRMBR HU LL_RTC_ALMB_GetTime\n |
EricLew | 0:80ee8f3b695e | 2183 | * ALRMBR MNT LL_RTC_ALMB_GetTime\n |
EricLew | 0:80ee8f3b695e | 2184 | * ALRMBR MNU LL_RTC_ALMB_GetTime\n |
EricLew | 0:80ee8f3b695e | 2185 | * ALRMBR ST LL_RTC_ALMB_GetTime\n |
EricLew | 0:80ee8f3b695e | 2186 | * ALRMBR SU LL_RTC_ALMB_GetTime |
EricLew | 0:80ee8f3b695e | 2187 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2188 | * @retval Combination of hours, minutes and seconds. |
EricLew | 0:80ee8f3b695e | 2189 | */ |
EricLew | 0:80ee8f3b695e | 2190 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetTime(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2191 | { |
EricLew | 0:80ee8f3b695e | 2192 | return (uint32_t)((LL_RTC_ALMB_GetHour(RTCx) << RTC_OFFSET_HOUR) | (LL_RTC_ALMB_GetMinute(RTCx) << RTC_OFFSET_MINUTE) | LL_RTC_ALMB_GetSecond(RTCx)); |
EricLew | 0:80ee8f3b695e | 2193 | } |
EricLew | 0:80ee8f3b695e | 2194 | |
EricLew | 0:80ee8f3b695e | 2195 | /** |
EricLew | 0:80ee8f3b695e | 2196 | * @brief Set Alarm B Mask the most-significant bits starting at this bit |
EricLew | 0:80ee8f3b695e | 2197 | * @note This register can be written only when ALRBE is reset in RTC_CR register, |
EricLew | 0:80ee8f3b695e | 2198 | * or in initialization mode. |
EricLew | 0:80ee8f3b695e | 2199 | * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_SetSubSecondMask |
EricLew | 0:80ee8f3b695e | 2200 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2201 | * @param Mask 0. . .0xF |
EricLew | 0:80ee8f3b695e | 2202 | * @retval None |
EricLew | 0:80ee8f3b695e | 2203 | */ |
EricLew | 0:80ee8f3b695e | 2204 | __STATIC_INLINE void LL_RTC_ALMB_SetSubSecondMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 2205 | { |
EricLew | 0:80ee8f3b695e | 2206 | MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS, Mask << RTC_POSITION_ALMB_MASKSS); |
EricLew | 0:80ee8f3b695e | 2207 | } |
EricLew | 0:80ee8f3b695e | 2208 | |
EricLew | 0:80ee8f3b695e | 2209 | /** |
EricLew | 0:80ee8f3b695e | 2210 | * @brief Get Alarm B Mask the most-significant bits starting at this bit |
EricLew | 0:80ee8f3b695e | 2211 | * @rmtoll ALRMBSSR MASKSS LL_RTC_ALMB_GetSubSecondMask |
EricLew | 0:80ee8f3b695e | 2212 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2213 | * @retval 0. . .0xF |
EricLew | 0:80ee8f3b695e | 2214 | */ |
EricLew | 0:80ee8f3b695e | 2215 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecondMask(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2216 | { |
EricLew | 0:80ee8f3b695e | 2217 | return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_MASKSS) >> RTC_POSITION_ALMB_MASKSS); |
EricLew | 0:80ee8f3b695e | 2218 | } |
EricLew | 0:80ee8f3b695e | 2219 | |
EricLew | 0:80ee8f3b695e | 2220 | /** |
EricLew | 0:80ee8f3b695e | 2221 | * @brief Set Alarm B Sub seconds value |
EricLew | 0:80ee8f3b695e | 2222 | * @rmtoll ALRMBSSR SS LL_RTC_ALMB_SetSubSecond |
EricLew | 0:80ee8f3b695e | 2223 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2224 | * @param Subsecond 0. . .0x7FFF |
EricLew | 0:80ee8f3b695e | 2225 | * @retval None |
EricLew | 0:80ee8f3b695e | 2226 | */ |
EricLew | 0:80ee8f3b695e | 2227 | __STATIC_INLINE void LL_RTC_ALMB_SetSubSecond(RTC_TypeDef *RTCx, uint32_t Subsecond) |
EricLew | 0:80ee8f3b695e | 2228 | { |
EricLew | 0:80ee8f3b695e | 2229 | MODIFY_REG(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS, Subsecond); |
EricLew | 0:80ee8f3b695e | 2230 | } |
EricLew | 0:80ee8f3b695e | 2231 | |
EricLew | 0:80ee8f3b695e | 2232 | /** |
EricLew | 0:80ee8f3b695e | 2233 | * @brief Get Alarm B Sub seconds value |
EricLew | 0:80ee8f3b695e | 2234 | * @rmtoll ALRMBSSR SS LL_RTC_ALMB_GetSubSecond |
EricLew | 0:80ee8f3b695e | 2235 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2236 | * @retval 0. . .0x7FFF |
EricLew | 0:80ee8f3b695e | 2237 | */ |
EricLew | 0:80ee8f3b695e | 2238 | __STATIC_INLINE uint32_t LL_RTC_ALMB_GetSubSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2239 | { |
EricLew | 0:80ee8f3b695e | 2240 | return (uint32_t)(READ_BIT(RTCx->ALRMBSSR, RTC_ALRMBSSR_SS)); |
EricLew | 0:80ee8f3b695e | 2241 | } |
EricLew | 0:80ee8f3b695e | 2242 | |
EricLew | 0:80ee8f3b695e | 2243 | /** |
EricLew | 0:80ee8f3b695e | 2244 | * @} |
EricLew | 0:80ee8f3b695e | 2245 | */ |
EricLew | 0:80ee8f3b695e | 2246 | |
EricLew | 0:80ee8f3b695e | 2247 | /** @defgroup RTC_LL_EF_Timestamp Timestamp |
EricLew | 0:80ee8f3b695e | 2248 | * @{ |
EricLew | 0:80ee8f3b695e | 2249 | */ |
EricLew | 0:80ee8f3b695e | 2250 | |
EricLew | 0:80ee8f3b695e | 2251 | /** |
EricLew | 0:80ee8f3b695e | 2252 | * @brief Enable internal event timestamp |
EricLew | 0:80ee8f3b695e | 2253 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2254 | * @rmtoll CR ITSE LL_RTC_TS_EnableInternalEvent |
EricLew | 0:80ee8f3b695e | 2255 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2256 | * @retval None |
EricLew | 0:80ee8f3b695e | 2257 | */ |
EricLew | 0:80ee8f3b695e | 2258 | __STATIC_INLINE void LL_RTC_TS_EnableInternalEvent(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2259 | { |
EricLew | 0:80ee8f3b695e | 2260 | SET_BIT(RTCx->CR, RTC_CR_ITSE); |
EricLew | 0:80ee8f3b695e | 2261 | } |
EricLew | 0:80ee8f3b695e | 2262 | |
EricLew | 0:80ee8f3b695e | 2263 | /** |
EricLew | 0:80ee8f3b695e | 2264 | * @brief Disable internal event timestamp |
EricLew | 0:80ee8f3b695e | 2265 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2266 | * @rmtoll CR ITSE LL_RTC_TS_DisableInternalEvent |
EricLew | 0:80ee8f3b695e | 2267 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2268 | * @retval None |
EricLew | 0:80ee8f3b695e | 2269 | */ |
EricLew | 0:80ee8f3b695e | 2270 | __STATIC_INLINE void LL_RTC_TS_DisableInternalEvent(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2271 | { |
EricLew | 0:80ee8f3b695e | 2272 | CLEAR_BIT(RTCx->CR, RTC_CR_ITSE); |
EricLew | 0:80ee8f3b695e | 2273 | } |
EricLew | 0:80ee8f3b695e | 2274 | |
EricLew | 0:80ee8f3b695e | 2275 | /** |
EricLew | 0:80ee8f3b695e | 2276 | * @brief Enable Timestamp |
EricLew | 0:80ee8f3b695e | 2277 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2278 | * @rmtoll CR TSE LL_RTC_TS_Enable |
EricLew | 0:80ee8f3b695e | 2279 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2280 | * @retval None |
EricLew | 0:80ee8f3b695e | 2281 | */ |
EricLew | 0:80ee8f3b695e | 2282 | __STATIC_INLINE void LL_RTC_TS_Enable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2283 | { |
EricLew | 0:80ee8f3b695e | 2284 | SET_BIT(RTCx->CR, RTC_CR_TSE); |
EricLew | 0:80ee8f3b695e | 2285 | } |
EricLew | 0:80ee8f3b695e | 2286 | |
EricLew | 0:80ee8f3b695e | 2287 | /** |
EricLew | 0:80ee8f3b695e | 2288 | * @brief Disable Timestamp |
EricLew | 0:80ee8f3b695e | 2289 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2290 | * @rmtoll CR TSE LL_RTC_TS_Disable |
EricLew | 0:80ee8f3b695e | 2291 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2292 | * @retval None |
EricLew | 0:80ee8f3b695e | 2293 | */ |
EricLew | 0:80ee8f3b695e | 2294 | __STATIC_INLINE void LL_RTC_TS_Disable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2295 | { |
EricLew | 0:80ee8f3b695e | 2296 | CLEAR_BIT(RTCx->CR, RTC_CR_TSE); |
EricLew | 0:80ee8f3b695e | 2297 | } |
EricLew | 0:80ee8f3b695e | 2298 | |
EricLew | 0:80ee8f3b695e | 2299 | /** |
EricLew | 0:80ee8f3b695e | 2300 | * @brief Set Time-stamp event active edge |
EricLew | 0:80ee8f3b695e | 2301 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2302 | * @note TSE must be reset when TSEDGE is changed to avoid unwanted TSF setting |
EricLew | 0:80ee8f3b695e | 2303 | * @rmtoll CR TSEDGE LL_RTC_TS_SetActiveEdge |
EricLew | 0:80ee8f3b695e | 2304 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2305 | * @param Edge This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2306 | * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING |
EricLew | 0:80ee8f3b695e | 2307 | * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING |
EricLew | 0:80ee8f3b695e | 2308 | * @retval None |
EricLew | 0:80ee8f3b695e | 2309 | */ |
EricLew | 0:80ee8f3b695e | 2310 | __STATIC_INLINE void LL_RTC_TS_SetActiveEdge(RTC_TypeDef *RTCx, uint32_t Edge) |
EricLew | 0:80ee8f3b695e | 2311 | { |
EricLew | 0:80ee8f3b695e | 2312 | MODIFY_REG(RTCx->CR, RTC_CR_TSEDGE, Edge); |
EricLew | 0:80ee8f3b695e | 2313 | } |
EricLew | 0:80ee8f3b695e | 2314 | |
EricLew | 0:80ee8f3b695e | 2315 | /** |
EricLew | 0:80ee8f3b695e | 2316 | * @brief Get Time-stamp event active edge |
EricLew | 0:80ee8f3b695e | 2317 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2318 | * @rmtoll CR TSEDGE LL_RTC_TS_GetActiveEdge |
EricLew | 0:80ee8f3b695e | 2319 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2320 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2321 | * @arg @ref LL_RTC_TIMESTAMP_EDGE_RISING |
EricLew | 0:80ee8f3b695e | 2322 | * @arg @ref LL_RTC_TIMESTAMP_EDGE_FALLING |
EricLew | 0:80ee8f3b695e | 2323 | */ |
EricLew | 0:80ee8f3b695e | 2324 | __STATIC_INLINE uint32_t LL_RTC_TS_GetActiveEdge(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2325 | { |
EricLew | 0:80ee8f3b695e | 2326 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_TSEDGE)); |
EricLew | 0:80ee8f3b695e | 2327 | } |
EricLew | 0:80ee8f3b695e | 2328 | |
EricLew | 0:80ee8f3b695e | 2329 | /** |
EricLew | 0:80ee8f3b695e | 2330 | * @brief Get Timestamp AM/PM notation (AM or 24-hour format) |
EricLew | 0:80ee8f3b695e | 2331 | * @rmtoll TSTR PM LL_RTC_TS_GetTimeFormat |
EricLew | 0:80ee8f3b695e | 2332 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2333 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2334 | * @arg @ref LL_RTC_TS_TIME_FORMAT_AM |
EricLew | 0:80ee8f3b695e | 2335 | * @arg @ref LL_RTC_TS_TIME_FORMAT_PM |
EricLew | 0:80ee8f3b695e | 2336 | */ |
EricLew | 0:80ee8f3b695e | 2337 | __STATIC_INLINE uint32_t LL_RTC_TS_GetTimeFormat(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2338 | { |
EricLew | 0:80ee8f3b695e | 2339 | return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_PM)); |
EricLew | 0:80ee8f3b695e | 2340 | } |
EricLew | 0:80ee8f3b695e | 2341 | |
EricLew | 0:80ee8f3b695e | 2342 | /** |
EricLew | 0:80ee8f3b695e | 2343 | * @brief Get Timestamp Hour in BCD format |
EricLew | 0:80ee8f3b695e | 2344 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Hour from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2345 | * @rmtoll TSTR HT LL_RTC_TS_GetHour\n |
EricLew | 0:80ee8f3b695e | 2346 | * TSTR HU LL_RTC_TS_GetHour |
EricLew | 0:80ee8f3b695e | 2347 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2348 | * @retval 0x01. . .0x12 or 0x00. . .0x23 |
EricLew | 0:80ee8f3b695e | 2349 | */ |
EricLew | 0:80ee8f3b695e | 2350 | __STATIC_INLINE uint32_t LL_RTC_TS_GetHour(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2351 | { |
EricLew | 0:80ee8f3b695e | 2352 | return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_HT | RTC_TSTR_HU) >> RTC_POSITION_TS_HU); |
EricLew | 0:80ee8f3b695e | 2353 | } |
EricLew | 0:80ee8f3b695e | 2354 | |
EricLew | 0:80ee8f3b695e | 2355 | /** |
EricLew | 0:80ee8f3b695e | 2356 | * @brief Get Timestamp Minute in BCD format |
EricLew | 0:80ee8f3b695e | 2357 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Minute from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2358 | * @rmtoll TSTR MNT LL_RTC_TS_GetMinute\n |
EricLew | 0:80ee8f3b695e | 2359 | * TSTR MNU LL_RTC_TS_GetMinute |
EricLew | 0:80ee8f3b695e | 2360 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2361 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2362 | */ |
EricLew | 0:80ee8f3b695e | 2363 | __STATIC_INLINE uint32_t LL_RTC_TS_GetMinute(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2364 | { |
EricLew | 0:80ee8f3b695e | 2365 | return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_MNT | RTC_TSTR_MNU) >> RTC_POSITION_TS_MNU); |
EricLew | 0:80ee8f3b695e | 2366 | } |
EricLew | 0:80ee8f3b695e | 2367 | |
EricLew | 0:80ee8f3b695e | 2368 | /** |
EricLew | 0:80ee8f3b695e | 2369 | * @brief Get Timestamp Second in BCD format |
EricLew | 0:80ee8f3b695e | 2370 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Second from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2371 | * @rmtoll TSTR ST LL_RTC_TS_GetSecond\n |
EricLew | 0:80ee8f3b695e | 2372 | * TSTR SU LL_RTC_TS_GetSecond |
EricLew | 0:80ee8f3b695e | 2373 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2374 | * @retval 0x00. . .0x59 |
EricLew | 0:80ee8f3b695e | 2375 | */ |
EricLew | 0:80ee8f3b695e | 2376 | __STATIC_INLINE uint32_t LL_RTC_TS_GetSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2377 | { |
EricLew | 0:80ee8f3b695e | 2378 | return (uint32_t)(READ_BIT(RTCx->TSTR, RTC_TSTR_ST | RTC_TSTR_SU)); |
EricLew | 0:80ee8f3b695e | 2379 | } |
EricLew | 0:80ee8f3b695e | 2380 | |
EricLew | 0:80ee8f3b695e | 2381 | /** |
EricLew | 0:80ee8f3b695e | 2382 | * @brief Get Timestamp time (hour, minute and second) in BCD format |
EricLew | 0:80ee8f3b695e | 2383 | * @note helper macros __LL_RTC_GET_HOUR, __LL_RTC_GET_MINUTE and __LL_RTC_GET_SECOND |
EricLew | 0:80ee8f3b695e | 2384 | * are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 2385 | * @rmtoll TSTR HT LL_RTC_TS_GetTime\n |
EricLew | 0:80ee8f3b695e | 2386 | * TSTR HU LL_RTC_TS_GetTime\n |
EricLew | 0:80ee8f3b695e | 2387 | * TSTR MNT LL_RTC_TS_GetTime\n |
EricLew | 0:80ee8f3b695e | 2388 | * TSTR MNU LL_RTC_TS_GetTime\n |
EricLew | 0:80ee8f3b695e | 2389 | * TSTR ST LL_RTC_TS_GetTime\n |
EricLew | 0:80ee8f3b695e | 2390 | * TSTR SU LL_RTC_TS_GetTime |
EricLew | 0:80ee8f3b695e | 2391 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2392 | * @retval Combination of hours, minutes and seconds. |
EricLew | 0:80ee8f3b695e | 2393 | */ |
EricLew | 0:80ee8f3b695e | 2394 | __STATIC_INLINE uint32_t LL_RTC_TS_GetTime(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2395 | { |
EricLew | 0:80ee8f3b695e | 2396 | return (uint32_t)(READ_BIT(RTCx->TSTR, |
EricLew | 0:80ee8f3b695e | 2397 | RTC_TSTR_HT | RTC_TSTR_HU | RTC_TSTR_MNT | RTC_TSTR_MNU | RTC_TSTR_ST | RTC_TSTR_SU)); |
EricLew | 0:80ee8f3b695e | 2398 | } |
EricLew | 0:80ee8f3b695e | 2399 | |
EricLew | 0:80ee8f3b695e | 2400 | /** |
EricLew | 0:80ee8f3b695e | 2401 | * @brief Get Timestamp Week day |
EricLew | 0:80ee8f3b695e | 2402 | * @rmtoll TSDR WDU LL_RTC_TS_GetWeekDay |
EricLew | 0:80ee8f3b695e | 2403 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2404 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2405 | * @arg @ref LL_RTC_WEEKDAY_MONDAY |
EricLew | 0:80ee8f3b695e | 2406 | * @arg @ref LL_RTC_WEEKDAY_TUESDAY |
EricLew | 0:80ee8f3b695e | 2407 | * @arg @ref LL_RTC_WEEKDAY_WEDNESDAY |
EricLew | 0:80ee8f3b695e | 2408 | * @arg @ref LL_RTC_WEEKDAY_THURSDAY |
EricLew | 0:80ee8f3b695e | 2409 | * @arg @ref LL_RTC_WEEKDAY_FRIDAY |
EricLew | 0:80ee8f3b695e | 2410 | * @arg @ref LL_RTC_WEEKDAY_SATURDAY |
EricLew | 0:80ee8f3b695e | 2411 | * @arg @ref LL_RTC_WEEKDAY_SUNDAY |
EricLew | 0:80ee8f3b695e | 2412 | */ |
EricLew | 0:80ee8f3b695e | 2413 | __STATIC_INLINE uint32_t LL_RTC_TS_GetWeekDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2414 | { |
EricLew | 0:80ee8f3b695e | 2415 | return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU) >> RTC_POSITION_TS_WDU); |
EricLew | 0:80ee8f3b695e | 2416 | } |
EricLew | 0:80ee8f3b695e | 2417 | |
EricLew | 0:80ee8f3b695e | 2418 | /** |
EricLew | 0:80ee8f3b695e | 2419 | * @brief Get Timestamp Month in BCD format |
EricLew | 0:80ee8f3b695e | 2420 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Month from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2421 | * @rmtoll TSDR MT LL_RTC_TS_GetMonth\n |
EricLew | 0:80ee8f3b695e | 2422 | * TSDR MU LL_RTC_TS_GetMonth |
EricLew | 0:80ee8f3b695e | 2423 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2424 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2425 | * @arg @ref LL_RTC_MONTH_JANUARY |
EricLew | 0:80ee8f3b695e | 2426 | * @arg @ref LL_RTC_MONTH_FEBRUARY |
EricLew | 0:80ee8f3b695e | 2427 | * @arg @ref LL_RTC_MONTH_MARCH |
EricLew | 0:80ee8f3b695e | 2428 | * @arg @ref LL_RTC_MONTH_APRIL |
EricLew | 0:80ee8f3b695e | 2429 | * @arg @ref LL_RTC_MONTH_MAY |
EricLew | 0:80ee8f3b695e | 2430 | * @arg @ref LL_RTC_MONTH_JUNE |
EricLew | 0:80ee8f3b695e | 2431 | * @arg @ref LL_RTC_MONTH_JULY |
EricLew | 0:80ee8f3b695e | 2432 | * @arg @ref LL_RTC_MONTH_AUGUST |
EricLew | 0:80ee8f3b695e | 2433 | * @arg @ref LL_RTC_MONTH_SEPTEMBER |
EricLew | 0:80ee8f3b695e | 2434 | * @arg @ref LL_RTC_MONTH_OCTOBER |
EricLew | 0:80ee8f3b695e | 2435 | * @arg @ref LL_RTC_MONTH_NOVEMBER |
EricLew | 0:80ee8f3b695e | 2436 | * @arg @ref LL_RTC_MONTH_DECEMBER |
EricLew | 0:80ee8f3b695e | 2437 | */ |
EricLew | 0:80ee8f3b695e | 2438 | __STATIC_INLINE uint32_t LL_RTC_TS_GetMonth(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2439 | { |
EricLew | 0:80ee8f3b695e | 2440 | return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_MT | RTC_TSDR_MU) >> RTC_POSITION_TS_MU); |
EricLew | 0:80ee8f3b695e | 2441 | } |
EricLew | 0:80ee8f3b695e | 2442 | |
EricLew | 0:80ee8f3b695e | 2443 | /** |
EricLew | 0:80ee8f3b695e | 2444 | * @brief Get Timestamp Day in BCD format |
EricLew | 0:80ee8f3b695e | 2445 | * @note helper macro __LL_RTC_CONVERT_BCD2BIN is available to convert Day from BCD to Binary format |
EricLew | 0:80ee8f3b695e | 2446 | * @rmtoll TSDR DT LL_RTC_TS_GetDay\n |
EricLew | 0:80ee8f3b695e | 2447 | * TSDR DU LL_RTC_TS_GetDay |
EricLew | 0:80ee8f3b695e | 2448 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2449 | * @retval 0x01. . .0x31 |
EricLew | 0:80ee8f3b695e | 2450 | */ |
EricLew | 0:80ee8f3b695e | 2451 | __STATIC_INLINE uint32_t LL_RTC_TS_GetDay(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2452 | { |
EricLew | 0:80ee8f3b695e | 2453 | return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_DT | RTC_TSDR_DU)); |
EricLew | 0:80ee8f3b695e | 2454 | } |
EricLew | 0:80ee8f3b695e | 2455 | |
EricLew | 0:80ee8f3b695e | 2456 | /** |
EricLew | 0:80ee8f3b695e | 2457 | * @brief Get Timestamp date (WeekDay, Day and Month) in BCD format |
EricLew | 0:80ee8f3b695e | 2458 | * @note helper macros __LL_RTC_GET_WEEKDAY, __LL_RTC_GET_MONTH, |
EricLew | 0:80ee8f3b695e | 2459 | * and __LL_RTC_GET_DAY are available to get independently each parameter. |
EricLew | 0:80ee8f3b695e | 2460 | * @rmtoll TSDR WDU LL_RTC_TS_GetDate\n |
EricLew | 0:80ee8f3b695e | 2461 | * TSDR MT LL_RTC_TS_GetDate\n |
EricLew | 0:80ee8f3b695e | 2462 | * TSDR MU LL_RTC_TS_GetDate\n |
EricLew | 0:80ee8f3b695e | 2463 | * TSDR DT LL_RTC_TS_GetDate\n |
EricLew | 0:80ee8f3b695e | 2464 | * TSDR DU LL_RTC_TS_GetDate |
EricLew | 0:80ee8f3b695e | 2465 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2466 | * @retval Combination of Weekday, Day and Month |
EricLew | 0:80ee8f3b695e | 2467 | */ |
EricLew | 0:80ee8f3b695e | 2468 | __STATIC_INLINE uint32_t LL_RTC_TS_GetDate(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2469 | { |
EricLew | 0:80ee8f3b695e | 2470 | return (uint32_t)(READ_BIT(RTCx->TSDR, RTC_TSDR_WDU | RTC_TSDR_MT | RTC_TSDR_MU | RTC_TSDR_DT | RTC_TSDR_DU)); |
EricLew | 0:80ee8f3b695e | 2471 | } |
EricLew | 0:80ee8f3b695e | 2472 | |
EricLew | 0:80ee8f3b695e | 2473 | /** |
EricLew | 0:80ee8f3b695e | 2474 | * @brief Get time-stamp sub second value |
EricLew | 0:80ee8f3b695e | 2475 | * @rmtoll TSSSR SS LL_RTC_TS_GetSubSecond |
EricLew | 0:80ee8f3b695e | 2476 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2477 | * @retval 0x00. . .0xFFFF |
EricLew | 0:80ee8f3b695e | 2478 | */ |
EricLew | 0:80ee8f3b695e | 2479 | __STATIC_INLINE uint32_t LL_RTC_TS_GetSubSecond(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2480 | { |
EricLew | 0:80ee8f3b695e | 2481 | return (uint32_t)(READ_BIT(RTCx->TSSSR, RTC_TSSSR_SS)); |
EricLew | 0:80ee8f3b695e | 2482 | } |
EricLew | 0:80ee8f3b695e | 2483 | |
EricLew | 0:80ee8f3b695e | 2484 | /** |
EricLew | 0:80ee8f3b695e | 2485 | * @brief Activate timestamp on tamper detection event |
EricLew | 0:80ee8f3b695e | 2486 | * @rmtoll TAMPCR TAMPTS LL_RTC_TS_EnableOnTamper |
EricLew | 0:80ee8f3b695e | 2487 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2488 | * @retval None |
EricLew | 0:80ee8f3b695e | 2489 | */ |
EricLew | 0:80ee8f3b695e | 2490 | __STATIC_INLINE void LL_RTC_TS_EnableOnTamper(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2491 | { |
EricLew | 0:80ee8f3b695e | 2492 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS); |
EricLew | 0:80ee8f3b695e | 2493 | } |
EricLew | 0:80ee8f3b695e | 2494 | |
EricLew | 0:80ee8f3b695e | 2495 | /** |
EricLew | 0:80ee8f3b695e | 2496 | * @brief Disable timestamp on tamper detection event |
EricLew | 0:80ee8f3b695e | 2497 | * @rmtoll TAMPCR TAMPTS LL_RTC_TS_DisableOnTamper |
EricLew | 0:80ee8f3b695e | 2498 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2499 | * @retval None |
EricLew | 0:80ee8f3b695e | 2500 | */ |
EricLew | 0:80ee8f3b695e | 2501 | __STATIC_INLINE void LL_RTC_TS_DisableOnTamper(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2502 | { |
EricLew | 0:80ee8f3b695e | 2503 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPTS); |
EricLew | 0:80ee8f3b695e | 2504 | } |
EricLew | 0:80ee8f3b695e | 2505 | |
EricLew | 0:80ee8f3b695e | 2506 | /** |
EricLew | 0:80ee8f3b695e | 2507 | * @} |
EricLew | 0:80ee8f3b695e | 2508 | */ |
EricLew | 0:80ee8f3b695e | 2509 | |
EricLew | 0:80ee8f3b695e | 2510 | /** @defgroup RTC_LL_EF_Tamper Tamper |
EricLew | 0:80ee8f3b695e | 2511 | * @{ |
EricLew | 0:80ee8f3b695e | 2512 | */ |
EricLew | 0:80ee8f3b695e | 2513 | |
EricLew | 0:80ee8f3b695e | 2514 | /** |
EricLew | 0:80ee8f3b695e | 2515 | * @brief Enable RTC_TAMPx input detection |
EricLew | 0:80ee8f3b695e | 2516 | * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Enable\n |
EricLew | 0:80ee8f3b695e | 2517 | * TAMPCR TAMP2E LL_RTC_TAMPER_Enable\n |
EricLew | 0:80ee8f3b695e | 2518 | * TAMPCR TAMP3E LL_RTC_TAMPER_Enable |
EricLew | 0:80ee8f3b695e | 2519 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2520 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2521 | * @arg @ref LL_RTC_TAMPER_1 |
EricLew | 0:80ee8f3b695e | 2522 | * @arg @ref LL_RTC_TAMPER_2 |
EricLew | 0:80ee8f3b695e | 2523 | * @arg @ref LL_RTC_TAMPER_3 (*) |
EricLew | 0:80ee8f3b695e | 2524 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2525 | * @retval None |
EricLew | 0:80ee8f3b695e | 2526 | */ |
EricLew | 0:80ee8f3b695e | 2527 | __STATIC_INLINE void LL_RTC_TAMPER_Enable(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2528 | { |
EricLew | 0:80ee8f3b695e | 2529 | SET_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2530 | } |
EricLew | 0:80ee8f3b695e | 2531 | |
EricLew | 0:80ee8f3b695e | 2532 | /** |
EricLew | 0:80ee8f3b695e | 2533 | * @brief Clear RTC_TAMPx input detection |
EricLew | 0:80ee8f3b695e | 2534 | * @rmtoll TAMPCR TAMP1E LL_RTC_TAMPER_Disable\n |
EricLew | 0:80ee8f3b695e | 2535 | * TAMPCR TAMP2E LL_RTC_TAMPER_Disable\n |
EricLew | 0:80ee8f3b695e | 2536 | * TAMPCR TAMP3E LL_RTC_TAMPER_Disable |
EricLew | 0:80ee8f3b695e | 2537 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2538 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2539 | * @arg @ref LL_RTC_TAMPER_1 |
EricLew | 0:80ee8f3b695e | 2540 | * @arg @ref LL_RTC_TAMPER_2 |
EricLew | 0:80ee8f3b695e | 2541 | * @arg @ref LL_RTC_TAMPER_3 (*) |
EricLew | 0:80ee8f3b695e | 2542 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2543 | * @retval None |
EricLew | 0:80ee8f3b695e | 2544 | */ |
EricLew | 0:80ee8f3b695e | 2545 | __STATIC_INLINE void LL_RTC_TAMPER_Disable(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2546 | { |
EricLew | 0:80ee8f3b695e | 2547 | CLEAR_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2548 | } |
EricLew | 0:80ee8f3b695e | 2549 | |
EricLew | 0:80ee8f3b695e | 2550 | /** |
EricLew | 0:80ee8f3b695e | 2551 | * @brief Enable Tamper mask flag |
EricLew | 0:80ee8f3b695e | 2552 | * @note Associated Tamper IT must not enabled when tamper mask is set. |
EricLew | 0:80ee8f3b695e | 2553 | * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_EnableMask\n |
EricLew | 0:80ee8f3b695e | 2554 | * TAMPCR TAMP2MF LL_RTC_TAMPER_EnableMask\n |
EricLew | 0:80ee8f3b695e | 2555 | * TAMPCR TAMP3MF LL_RTC_TAMPER_EnableMask |
EricLew | 0:80ee8f3b695e | 2556 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2557 | * @param Mask This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2558 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 |
EricLew | 0:80ee8f3b695e | 2559 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 |
EricLew | 0:80ee8f3b695e | 2560 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 (*) |
EricLew | 0:80ee8f3b695e | 2561 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2562 | * @retval None |
EricLew | 0:80ee8f3b695e | 2563 | */ |
EricLew | 0:80ee8f3b695e | 2564 | __STATIC_INLINE void LL_RTC_TAMPER_EnableMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 2565 | { |
EricLew | 0:80ee8f3b695e | 2566 | SET_BIT(RTCx->TAMPCR, Mask); |
EricLew | 0:80ee8f3b695e | 2567 | } |
EricLew | 0:80ee8f3b695e | 2568 | |
EricLew | 0:80ee8f3b695e | 2569 | /** |
EricLew | 0:80ee8f3b695e | 2570 | * @brief Disable Tamper mask flag |
EricLew | 0:80ee8f3b695e | 2571 | * @rmtoll TAMPCR TAMP1MF LL_RTC_TAMPER_DisableMask\n |
EricLew | 0:80ee8f3b695e | 2572 | * TAMPCR TAMP2MF LL_RTC_TAMPER_DisableMask\n |
EricLew | 0:80ee8f3b695e | 2573 | * TAMPCR TAMP3MF LL_RTC_TAMPER_DisableMask |
EricLew | 0:80ee8f3b695e | 2574 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2575 | * @param Mask This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2576 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER1 |
EricLew | 0:80ee8f3b695e | 2577 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER2 |
EricLew | 0:80ee8f3b695e | 2578 | * @arg @ref LL_RTC_TAMPER_MASK_TAMPER3 (*) |
EricLew | 0:80ee8f3b695e | 2579 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2580 | * @retval None |
EricLew | 0:80ee8f3b695e | 2581 | */ |
EricLew | 0:80ee8f3b695e | 2582 | __STATIC_INLINE void LL_RTC_TAMPER_DisableMask(RTC_TypeDef *RTCx, uint32_t Mask) |
EricLew | 0:80ee8f3b695e | 2583 | { |
EricLew | 0:80ee8f3b695e | 2584 | CLEAR_BIT(RTCx->TAMPCR, Mask); |
EricLew | 0:80ee8f3b695e | 2585 | } |
EricLew | 0:80ee8f3b695e | 2586 | |
EricLew | 0:80ee8f3b695e | 2587 | /** |
EricLew | 0:80ee8f3b695e | 2588 | * @brief Enable backup register erase after Tamper event detection |
EricLew | 0:80ee8f3b695e | 2589 | * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_EnableEraseBKP\n |
EricLew | 0:80ee8f3b695e | 2590 | * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_EnableEraseBKP\n |
EricLew | 0:80ee8f3b695e | 2591 | * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_EnableEraseBKP |
EricLew | 0:80ee8f3b695e | 2592 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2593 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2594 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 |
EricLew | 0:80ee8f3b695e | 2595 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 |
EricLew | 0:80ee8f3b695e | 2596 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 (*) |
EricLew | 0:80ee8f3b695e | 2597 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2598 | * @retval None |
EricLew | 0:80ee8f3b695e | 2599 | */ |
EricLew | 0:80ee8f3b695e | 2600 | __STATIC_INLINE void LL_RTC_TAMPER_EnableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2601 | { |
EricLew | 0:80ee8f3b695e | 2602 | CLEAR_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2603 | } |
EricLew | 0:80ee8f3b695e | 2604 | |
EricLew | 0:80ee8f3b695e | 2605 | /** |
EricLew | 0:80ee8f3b695e | 2606 | * @brief Disable backup register erase after Tamper event detection |
EricLew | 0:80ee8f3b695e | 2607 | * @rmtoll TAMPCR TAMP1NOERASE LL_RTC_TAMPER_DisableEraseBKP\n |
EricLew | 0:80ee8f3b695e | 2608 | * TAMPCR TAMP2NOERASE LL_RTC_TAMPER_DisableEraseBKP\n |
EricLew | 0:80ee8f3b695e | 2609 | * TAMPCR TAMP3NOERASE LL_RTC_TAMPER_DisableEraseBKP |
EricLew | 0:80ee8f3b695e | 2610 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2611 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2612 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER1 |
EricLew | 0:80ee8f3b695e | 2613 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER2 |
EricLew | 0:80ee8f3b695e | 2614 | * @arg @ref LL_RTC_TAMPER_NOERASE_TAMPER3 (*) |
EricLew | 0:80ee8f3b695e | 2615 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2616 | * @retval None |
EricLew | 0:80ee8f3b695e | 2617 | */ |
EricLew | 0:80ee8f3b695e | 2618 | __STATIC_INLINE void LL_RTC_TAMPER_DisableEraseBKP(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2619 | { |
EricLew | 0:80ee8f3b695e | 2620 | SET_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2621 | } |
EricLew | 0:80ee8f3b695e | 2622 | |
EricLew | 0:80ee8f3b695e | 2623 | /** |
EricLew | 0:80ee8f3b695e | 2624 | * @brief Disable RTC_TAMPx pull-up disable (Disable precharge of RTC_TAMPx pins) |
EricLew | 0:80ee8f3b695e | 2625 | * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_DisablePullUp |
EricLew | 0:80ee8f3b695e | 2626 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2627 | * @retval None |
EricLew | 0:80ee8f3b695e | 2628 | */ |
EricLew | 0:80ee8f3b695e | 2629 | __STATIC_INLINE void LL_RTC_TAMPER_DisablePullUp(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2630 | { |
EricLew | 0:80ee8f3b695e | 2631 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS); |
EricLew | 0:80ee8f3b695e | 2632 | } |
EricLew | 0:80ee8f3b695e | 2633 | |
EricLew | 0:80ee8f3b695e | 2634 | /** |
EricLew | 0:80ee8f3b695e | 2635 | * @brief Enable RTC_TAMPx pull-up disable ( Precharge RTC_TAMPx pins before sampling) |
EricLew | 0:80ee8f3b695e | 2636 | * @rmtoll TAMPCR TAMPPUDIS LL_RTC_TAMPER_EnablePullUp |
EricLew | 0:80ee8f3b695e | 2637 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2638 | * @retval None |
EricLew | 0:80ee8f3b695e | 2639 | */ |
EricLew | 0:80ee8f3b695e | 2640 | __STATIC_INLINE void LL_RTC_TAMPER_EnablePullUp(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2641 | { |
EricLew | 0:80ee8f3b695e | 2642 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPUDIS); |
EricLew | 0:80ee8f3b695e | 2643 | } |
EricLew | 0:80ee8f3b695e | 2644 | |
EricLew | 0:80ee8f3b695e | 2645 | /** |
EricLew | 0:80ee8f3b695e | 2646 | * @brief Set RTC_TAMPx precharge duration |
EricLew | 0:80ee8f3b695e | 2647 | * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_SetPrecharge |
EricLew | 0:80ee8f3b695e | 2648 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2649 | * @param Duration This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2650 | * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK |
EricLew | 0:80ee8f3b695e | 2651 | * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK |
EricLew | 0:80ee8f3b695e | 2652 | * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK |
EricLew | 0:80ee8f3b695e | 2653 | * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK |
EricLew | 0:80ee8f3b695e | 2654 | * @retval None |
EricLew | 0:80ee8f3b695e | 2655 | */ |
EricLew | 0:80ee8f3b695e | 2656 | __STATIC_INLINE void LL_RTC_TAMPER_SetPrecharge(RTC_TypeDef *RTCx, uint32_t Duration) |
EricLew | 0:80ee8f3b695e | 2657 | { |
EricLew | 0:80ee8f3b695e | 2658 | MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH, Duration); |
EricLew | 0:80ee8f3b695e | 2659 | } |
EricLew | 0:80ee8f3b695e | 2660 | |
EricLew | 0:80ee8f3b695e | 2661 | /** |
EricLew | 0:80ee8f3b695e | 2662 | * @brief Get RTC_TAMPx precharge duration |
EricLew | 0:80ee8f3b695e | 2663 | * @rmtoll TAMPCR TAMPPRCH LL_RTC_TAMPER_GetPrecharge |
EricLew | 0:80ee8f3b695e | 2664 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2665 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2666 | * @arg @ref LL_RTC_TAMPER_DURATION_1RTCCLK |
EricLew | 0:80ee8f3b695e | 2667 | * @arg @ref LL_RTC_TAMPER_DURATION_2RTCCLK |
EricLew | 0:80ee8f3b695e | 2668 | * @arg @ref LL_RTC_TAMPER_DURATION_4RTCCLK |
EricLew | 0:80ee8f3b695e | 2669 | * @arg @ref LL_RTC_TAMPER_DURATION_8RTCCLK |
EricLew | 0:80ee8f3b695e | 2670 | */ |
EricLew | 0:80ee8f3b695e | 2671 | __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetPrecharge(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2672 | { |
EricLew | 0:80ee8f3b695e | 2673 | return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPPRCH)); |
EricLew | 0:80ee8f3b695e | 2674 | } |
EricLew | 0:80ee8f3b695e | 2675 | |
EricLew | 0:80ee8f3b695e | 2676 | /** |
EricLew | 0:80ee8f3b695e | 2677 | * @brief Set RTC_TAMPx filter count |
EricLew | 0:80ee8f3b695e | 2678 | * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_SetFilterCount |
EricLew | 0:80ee8f3b695e | 2679 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2680 | * @param FilterCount This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2681 | * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE |
EricLew | 0:80ee8f3b695e | 2682 | * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE |
EricLew | 0:80ee8f3b695e | 2683 | * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE |
EricLew | 0:80ee8f3b695e | 2684 | * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE |
EricLew | 0:80ee8f3b695e | 2685 | * @retval None |
EricLew | 0:80ee8f3b695e | 2686 | */ |
EricLew | 0:80ee8f3b695e | 2687 | __STATIC_INLINE void LL_RTC_TAMPER_SetFilterCount(RTC_TypeDef *RTCx, uint32_t FilterCount) |
EricLew | 0:80ee8f3b695e | 2688 | { |
EricLew | 0:80ee8f3b695e | 2689 | MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT, FilterCount); |
EricLew | 0:80ee8f3b695e | 2690 | } |
EricLew | 0:80ee8f3b695e | 2691 | |
EricLew | 0:80ee8f3b695e | 2692 | /** |
EricLew | 0:80ee8f3b695e | 2693 | * @brief Get RTC_TAMPx filter count |
EricLew | 0:80ee8f3b695e | 2694 | * @rmtoll TAMPCR TAMPFLT LL_RTC_TAMPER_GetFilterCount |
EricLew | 0:80ee8f3b695e | 2695 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2696 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2697 | * @arg @ref LL_RTC_TAMPER_FILTER_DISABLE |
EricLew | 0:80ee8f3b695e | 2698 | * @arg @ref LL_RTC_TAMPER_FILTER_2SAMPLE |
EricLew | 0:80ee8f3b695e | 2699 | * @arg @ref LL_RTC_TAMPER_FILTER_4SAMPLE |
EricLew | 0:80ee8f3b695e | 2700 | * @arg @ref LL_RTC_TAMPER_FILTER_8SAMPLE |
EricLew | 0:80ee8f3b695e | 2701 | */ |
EricLew | 0:80ee8f3b695e | 2702 | __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetFilterCount(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2703 | { |
EricLew | 0:80ee8f3b695e | 2704 | return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFLT)); |
EricLew | 0:80ee8f3b695e | 2705 | } |
EricLew | 0:80ee8f3b695e | 2706 | |
EricLew | 0:80ee8f3b695e | 2707 | /** |
EricLew | 0:80ee8f3b695e | 2708 | * @brief Set Tamper sampling frequency |
EricLew | 0:80ee8f3b695e | 2709 | * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_SetSamplingFreq |
EricLew | 0:80ee8f3b695e | 2710 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2711 | * @param SamplingFreq This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2712 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 |
EricLew | 0:80ee8f3b695e | 2713 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 |
EricLew | 0:80ee8f3b695e | 2714 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 |
EricLew | 0:80ee8f3b695e | 2715 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 |
EricLew | 0:80ee8f3b695e | 2716 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 |
EricLew | 0:80ee8f3b695e | 2717 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 |
EricLew | 0:80ee8f3b695e | 2718 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 |
EricLew | 0:80ee8f3b695e | 2719 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 |
EricLew | 0:80ee8f3b695e | 2720 | * @retval None |
EricLew | 0:80ee8f3b695e | 2721 | */ |
EricLew | 0:80ee8f3b695e | 2722 | __STATIC_INLINE void LL_RTC_TAMPER_SetSamplingFreq(RTC_TypeDef *RTCx, uint32_t SamplingFreq) |
EricLew | 0:80ee8f3b695e | 2723 | { |
EricLew | 0:80ee8f3b695e | 2724 | MODIFY_REG(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ, SamplingFreq); |
EricLew | 0:80ee8f3b695e | 2725 | } |
EricLew | 0:80ee8f3b695e | 2726 | |
EricLew | 0:80ee8f3b695e | 2727 | /** |
EricLew | 0:80ee8f3b695e | 2728 | * @brief Get Tamper sampling frequency |
EricLew | 0:80ee8f3b695e | 2729 | * @rmtoll TAMPCR TAMPFREQ LL_RTC_TAMPER_GetSamplingFreq |
EricLew | 0:80ee8f3b695e | 2730 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2731 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2732 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_32768 |
EricLew | 0:80ee8f3b695e | 2733 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_16384 |
EricLew | 0:80ee8f3b695e | 2734 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_8192 |
EricLew | 0:80ee8f3b695e | 2735 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_4096 |
EricLew | 0:80ee8f3b695e | 2736 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_2048 |
EricLew | 0:80ee8f3b695e | 2737 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_1024 |
EricLew | 0:80ee8f3b695e | 2738 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_512 |
EricLew | 0:80ee8f3b695e | 2739 | * @arg @ref LL_RTC_TAMPER_SAMPLFREQDIV_256 |
EricLew | 0:80ee8f3b695e | 2740 | */ |
EricLew | 0:80ee8f3b695e | 2741 | __STATIC_INLINE uint32_t LL_RTC_TAMPER_GetSamplingFreq(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2742 | { |
EricLew | 0:80ee8f3b695e | 2743 | return (uint32_t)(READ_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPFREQ)); |
EricLew | 0:80ee8f3b695e | 2744 | } |
EricLew | 0:80ee8f3b695e | 2745 | |
EricLew | 0:80ee8f3b695e | 2746 | /** |
EricLew | 0:80ee8f3b695e | 2747 | * @brief Enable Active level for Tamper input |
EricLew | 0:80ee8f3b695e | 2748 | * @rmtoll TAMPCR TAMP1_TRG LL_RTC_TAMPER_EnableActiveLevel\n |
EricLew | 0:80ee8f3b695e | 2749 | * TAMPCR TAMP2_TRG LL_RTC_TAMPER_EnableActiveLevel\n |
EricLew | 0:80ee8f3b695e | 2750 | * TAMPCR TAMP3_TRG LL_RTC_TAMPER_EnableActiveLevel |
EricLew | 0:80ee8f3b695e | 2751 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2752 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2753 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 |
EricLew | 0:80ee8f3b695e | 2754 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 |
EricLew | 0:80ee8f3b695e | 2755 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*) |
EricLew | 0:80ee8f3b695e | 2756 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2757 | * @retval None |
EricLew | 0:80ee8f3b695e | 2758 | */ |
EricLew | 0:80ee8f3b695e | 2759 | __STATIC_INLINE void LL_RTC_TAMPER_EnableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2760 | { |
EricLew | 0:80ee8f3b695e | 2761 | SET_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2762 | } |
EricLew | 0:80ee8f3b695e | 2763 | |
EricLew | 0:80ee8f3b695e | 2764 | /** |
EricLew | 0:80ee8f3b695e | 2765 | * @brief Disable Active level for Tamper input |
EricLew | 0:80ee8f3b695e | 2766 | * @rmtoll TAMPCR TAMP1_TRG LL_RTC_TAMPER_DisableActiveLevel\n |
EricLew | 0:80ee8f3b695e | 2767 | * TAMPCR TAMP2_TRG LL_RTC_TAMPER_DisableActiveLevel\n |
EricLew | 0:80ee8f3b695e | 2768 | * TAMPCR TAMP3_TRG LL_RTC_TAMPER_DisableActiveLevel |
EricLew | 0:80ee8f3b695e | 2769 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2770 | * @param Tamper This parameter can be a combination of the following values: |
EricLew | 0:80ee8f3b695e | 2771 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP1 |
EricLew | 0:80ee8f3b695e | 2772 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP2 |
EricLew | 0:80ee8f3b695e | 2773 | * @arg @ref LL_RTC_TAMPER_ACTIVELEVEL_TAMP3 (*) |
EricLew | 0:80ee8f3b695e | 2774 | * (*) value not defined in all devices. |
EricLew | 0:80ee8f3b695e | 2775 | * @retval None |
EricLew | 0:80ee8f3b695e | 2776 | */ |
EricLew | 0:80ee8f3b695e | 2777 | __STATIC_INLINE void LL_RTC_TAMPER_DisableActiveLevel(RTC_TypeDef *RTCx, uint32_t Tamper) |
EricLew | 0:80ee8f3b695e | 2778 | { |
EricLew | 0:80ee8f3b695e | 2779 | CLEAR_BIT(RTCx->TAMPCR, Tamper); |
EricLew | 0:80ee8f3b695e | 2780 | } |
EricLew | 0:80ee8f3b695e | 2781 | |
EricLew | 0:80ee8f3b695e | 2782 | /** |
EricLew | 0:80ee8f3b695e | 2783 | * @} |
EricLew | 0:80ee8f3b695e | 2784 | */ |
EricLew | 0:80ee8f3b695e | 2785 | |
EricLew | 0:80ee8f3b695e | 2786 | /** @defgroup RTC_LL_EF_Wakeup Wakeup |
EricLew | 0:80ee8f3b695e | 2787 | * @{ |
EricLew | 0:80ee8f3b695e | 2788 | */ |
EricLew | 0:80ee8f3b695e | 2789 | |
EricLew | 0:80ee8f3b695e | 2790 | /** |
EricLew | 0:80ee8f3b695e | 2791 | * @brief Enable Wakeup timer |
EricLew | 0:80ee8f3b695e | 2792 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2793 | * @rmtoll CR WUTE LL_RTC_WAKEUP_Enable |
EricLew | 0:80ee8f3b695e | 2794 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2795 | * @retval None |
EricLew | 0:80ee8f3b695e | 2796 | */ |
EricLew | 0:80ee8f3b695e | 2797 | __STATIC_INLINE void LL_RTC_WAKEUP_Enable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2798 | { |
EricLew | 0:80ee8f3b695e | 2799 | SET_BIT(RTCx->CR, RTC_CR_WUTE); |
EricLew | 0:80ee8f3b695e | 2800 | } |
EricLew | 0:80ee8f3b695e | 2801 | |
EricLew | 0:80ee8f3b695e | 2802 | /** |
EricLew | 0:80ee8f3b695e | 2803 | * @brief Disable Wakeup timer |
EricLew | 0:80ee8f3b695e | 2804 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2805 | * @rmtoll CR WUTE LL_RTC_WAKEUP_Disable |
EricLew | 0:80ee8f3b695e | 2806 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2807 | * @retval None |
EricLew | 0:80ee8f3b695e | 2808 | */ |
EricLew | 0:80ee8f3b695e | 2809 | __STATIC_INLINE void LL_RTC_WAKEUP_Disable(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2810 | { |
EricLew | 0:80ee8f3b695e | 2811 | CLEAR_BIT(RTCx->CR, RTC_CR_WUTE); |
EricLew | 0:80ee8f3b695e | 2812 | } |
EricLew | 0:80ee8f3b695e | 2813 | |
EricLew | 0:80ee8f3b695e | 2814 | /** |
EricLew | 0:80ee8f3b695e | 2815 | * @brief Check if Wakeup timer is enabled or not |
EricLew | 0:80ee8f3b695e | 2816 | * @rmtoll CR WUTE LL_RTC_WAKEUP_IsEnabled |
EricLew | 0:80ee8f3b695e | 2817 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2818 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 2819 | */ |
EricLew | 0:80ee8f3b695e | 2820 | __STATIC_INLINE uint32_t LL_RTC_WAKEUP_IsEnabled(RTC_TypeDef* RTCx) |
EricLew | 0:80ee8f3b695e | 2821 | { |
EricLew | 0:80ee8f3b695e | 2822 | return (READ_BIT(RTCx->CR, RTC_CR_WUTE) == (RTC_CR_WUTE)); |
EricLew | 0:80ee8f3b695e | 2823 | } |
EricLew | 0:80ee8f3b695e | 2824 | |
EricLew | 0:80ee8f3b695e | 2825 | /** |
EricLew | 0:80ee8f3b695e | 2826 | * @brief Select Wakeup clock |
EricLew | 0:80ee8f3b695e | 2827 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 2828 | * @note Bit can be written only when RTC_CR WUTE bit = 0 and RTC_ISR WUTWF bit = 1 |
EricLew | 0:80ee8f3b695e | 2829 | * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_SetClock |
EricLew | 0:80ee8f3b695e | 2830 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2831 | * @param WakeupClock This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2832 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16 |
EricLew | 0:80ee8f3b695e | 2833 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8 |
EricLew | 0:80ee8f3b695e | 2834 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4 |
EricLew | 0:80ee8f3b695e | 2835 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2 |
EricLew | 0:80ee8f3b695e | 2836 | * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE |
EricLew | 0:80ee8f3b695e | 2837 | * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT |
EricLew | 0:80ee8f3b695e | 2838 | * @retval None |
EricLew | 0:80ee8f3b695e | 2839 | */ |
EricLew | 0:80ee8f3b695e | 2840 | __STATIC_INLINE void LL_RTC_WAKEUP_SetClock(RTC_TypeDef *RTCx, uint32_t WakeupClock) |
EricLew | 0:80ee8f3b695e | 2841 | { |
EricLew | 0:80ee8f3b695e | 2842 | MODIFY_REG(RTCx->CR, RTC_CR_WUCKSEL, WakeupClock); |
EricLew | 0:80ee8f3b695e | 2843 | } |
EricLew | 0:80ee8f3b695e | 2844 | |
EricLew | 0:80ee8f3b695e | 2845 | /** |
EricLew | 0:80ee8f3b695e | 2846 | * @brief Get Wakeup clock |
EricLew | 0:80ee8f3b695e | 2847 | * @rmtoll CR WUCKSEL LL_RTC_WAKEUP_GetClock |
EricLew | 0:80ee8f3b695e | 2848 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2849 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2850 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_16 |
EricLew | 0:80ee8f3b695e | 2851 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_8 |
EricLew | 0:80ee8f3b695e | 2852 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_4 |
EricLew | 0:80ee8f3b695e | 2853 | * @arg @ref LL_RTC_WAKEUPCLOCK_DIV_2 |
EricLew | 0:80ee8f3b695e | 2854 | * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE |
EricLew | 0:80ee8f3b695e | 2855 | * @arg @ref LL_RTC_WAKEUPCLOCK_CKSPRE_WUT |
EricLew | 0:80ee8f3b695e | 2856 | */ |
EricLew | 0:80ee8f3b695e | 2857 | __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetClock(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2858 | { |
EricLew | 0:80ee8f3b695e | 2859 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_WUCKSEL)); |
EricLew | 0:80ee8f3b695e | 2860 | } |
EricLew | 0:80ee8f3b695e | 2861 | |
EricLew | 0:80ee8f3b695e | 2862 | /** |
EricLew | 0:80ee8f3b695e | 2863 | * @brief Set Wakeup auto-reload value |
EricLew | 0:80ee8f3b695e | 2864 | * @note Bit can be written only when WUTWF is set to 1 in RTC_ISR |
EricLew | 0:80ee8f3b695e | 2865 | * @rmtoll WUTR WUT LL_RTC_WAKEUP_SetAutoReload |
EricLew | 0:80ee8f3b695e | 2866 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2867 | * @param Value 0. . .0xFFFF |
EricLew | 0:80ee8f3b695e | 2868 | * @retval None |
EricLew | 0:80ee8f3b695e | 2869 | */ |
EricLew | 0:80ee8f3b695e | 2870 | __STATIC_INLINE void LL_RTC_WAKEUP_SetAutoReload(RTC_TypeDef *RTCx, uint32_t Value) |
EricLew | 0:80ee8f3b695e | 2871 | { |
EricLew | 0:80ee8f3b695e | 2872 | MODIFY_REG(RTCx->WUTR, RTC_WUTR_WUT, Value); |
EricLew | 0:80ee8f3b695e | 2873 | } |
EricLew | 0:80ee8f3b695e | 2874 | |
EricLew | 0:80ee8f3b695e | 2875 | /** |
EricLew | 0:80ee8f3b695e | 2876 | * @brief Get Wakeup auto-reload value |
EricLew | 0:80ee8f3b695e | 2877 | * @rmtoll WUTR WUT LL_RTC_WAKEUP_GetAutoReload |
EricLew | 0:80ee8f3b695e | 2878 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2879 | * @retval 0. . .0xFFFF |
EricLew | 0:80ee8f3b695e | 2880 | */ |
EricLew | 0:80ee8f3b695e | 2881 | __STATIC_INLINE uint32_t LL_RTC_WAKEUP_GetAutoReload(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 2882 | { |
EricLew | 0:80ee8f3b695e | 2883 | return (uint32_t)(READ_BIT(RTCx->WUTR, RTC_WUTR_WUT)); |
EricLew | 0:80ee8f3b695e | 2884 | } |
EricLew | 0:80ee8f3b695e | 2885 | |
EricLew | 0:80ee8f3b695e | 2886 | /** |
EricLew | 0:80ee8f3b695e | 2887 | * @} |
EricLew | 0:80ee8f3b695e | 2888 | */ |
EricLew | 0:80ee8f3b695e | 2889 | |
EricLew | 0:80ee8f3b695e | 2890 | /** @defgroup RTC_LL_EF_Backup_Registers Backup_Registers |
EricLew | 0:80ee8f3b695e | 2891 | * @{ |
EricLew | 0:80ee8f3b695e | 2892 | */ |
EricLew | 0:80ee8f3b695e | 2893 | |
EricLew | 0:80ee8f3b695e | 2894 | /** |
EricLew | 0:80ee8f3b695e | 2895 | * @brief Writes a data in a specified RTC Backup data register. |
EricLew | 0:80ee8f3b695e | 2896 | * @rmtoll BKPxR BKP LL_RTC_BAK_SetRegister |
EricLew | 0:80ee8f3b695e | 2897 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2898 | * @param BackupRegister This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2899 | * @arg @ref LL_RTC_BKP_DR0 |
EricLew | 0:80ee8f3b695e | 2900 | * @arg @ref LL_RTC_BKP_DR1 |
EricLew | 0:80ee8f3b695e | 2901 | * @arg @ref LL_RTC_BKP_DR2 |
EricLew | 0:80ee8f3b695e | 2902 | * @arg @ref LL_RTC_BKP_DR3 |
EricLew | 0:80ee8f3b695e | 2903 | * @arg @ref LL_RTC_BKP_DR4 |
EricLew | 0:80ee8f3b695e | 2904 | * @arg @ref LL_RTC_BKP_DR5 |
EricLew | 0:80ee8f3b695e | 2905 | * @arg @ref LL_RTC_BKP_DR6 |
EricLew | 0:80ee8f3b695e | 2906 | * @arg @ref LL_RTC_BKP_DR7 |
EricLew | 0:80ee8f3b695e | 2907 | * @arg @ref LL_RTC_BKP_DR8 |
EricLew | 0:80ee8f3b695e | 2908 | * @arg @ref LL_RTC_BKP_DR9 |
EricLew | 0:80ee8f3b695e | 2909 | * @arg @ref LL_RTC_BKP_DR10 |
EricLew | 0:80ee8f3b695e | 2910 | * @arg @ref LL_RTC_BKP_DR11 |
EricLew | 0:80ee8f3b695e | 2911 | * @arg @ref LL_RTC_BKP_DR12 |
EricLew | 0:80ee8f3b695e | 2912 | * @arg @ref LL_RTC_BKP_DR13 |
EricLew | 0:80ee8f3b695e | 2913 | * @arg @ref LL_RTC_BKP_DR14 |
EricLew | 0:80ee8f3b695e | 2914 | * @arg @ref LL_RTC_BKP_DR15 |
EricLew | 0:80ee8f3b695e | 2915 | * @arg @ref LL_RTC_BKP_DR16 |
EricLew | 0:80ee8f3b695e | 2916 | * @arg @ref LL_RTC_BKP_DR17 |
EricLew | 0:80ee8f3b695e | 2917 | * @arg @ref LL_RTC_BKP_DR18 |
EricLew | 0:80ee8f3b695e | 2918 | * @arg @ref LL_RTC_BKP_DR19 |
EricLew | 0:80ee8f3b695e | 2919 | * @arg @ref LL_RTC_BKP_DR20 |
EricLew | 0:80ee8f3b695e | 2920 | * @arg @ref LL_RTC_BKP_DR21 |
EricLew | 0:80ee8f3b695e | 2921 | * @arg @ref LL_RTC_BKP_DR22 |
EricLew | 0:80ee8f3b695e | 2922 | * @arg @ref LL_RTC_BKP_DR23 |
EricLew | 0:80ee8f3b695e | 2923 | * @arg @ref LL_RTC_BKP_DR24 |
EricLew | 0:80ee8f3b695e | 2924 | * @arg @ref LL_RTC_BKP_DR25 |
EricLew | 0:80ee8f3b695e | 2925 | * @arg @ref LL_RTC_BKP_DR26 |
EricLew | 0:80ee8f3b695e | 2926 | * @arg @ref LL_RTC_BKP_DR27 |
EricLew | 0:80ee8f3b695e | 2927 | * @arg @ref LL_RTC_BKP_DR28 |
EricLew | 0:80ee8f3b695e | 2928 | * @arg @ref LL_RTC_BKP_DR29 |
EricLew | 0:80ee8f3b695e | 2929 | * @arg @ref LL_RTC_BKP_DR30 |
EricLew | 0:80ee8f3b695e | 2930 | * @arg @ref LL_RTC_BKP_DR31 |
EricLew | 0:80ee8f3b695e | 2931 | * @param Data 0. . .0xFFFFFFFF |
EricLew | 0:80ee8f3b695e | 2932 | * @retval None |
EricLew | 0:80ee8f3b695e | 2933 | */ |
EricLew | 0:80ee8f3b695e | 2934 | __STATIC_INLINE void LL_RTC_BAK_SetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister, uint32_t Data) |
EricLew | 0:80ee8f3b695e | 2935 | { |
EricLew | 0:80ee8f3b695e | 2936 | register uint32_t tmp = 0; |
EricLew | 0:80ee8f3b695e | 2937 | |
EricLew | 0:80ee8f3b695e | 2938 | tmp = (uint32_t)(&(RTCx->BKP0R)); |
EricLew | 0:80ee8f3b695e | 2939 | tmp += (BackupRegister * 4); |
EricLew | 0:80ee8f3b695e | 2940 | |
EricLew | 0:80ee8f3b695e | 2941 | /* Write the specified register */ |
EricLew | 0:80ee8f3b695e | 2942 | *(__IO uint32_t *)tmp = (uint32_t)Data; |
EricLew | 0:80ee8f3b695e | 2943 | } |
EricLew | 0:80ee8f3b695e | 2944 | |
EricLew | 0:80ee8f3b695e | 2945 | /** |
EricLew | 0:80ee8f3b695e | 2946 | * @brief Reads data from the specified RTC Backup data Register. |
EricLew | 0:80ee8f3b695e | 2947 | * @rmtoll BKPxR BKP LL_RTC_BAK_GetRegister |
EricLew | 0:80ee8f3b695e | 2948 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 2949 | * @param BackupRegister This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 2950 | * @arg @ref LL_RTC_BKP_DR0 |
EricLew | 0:80ee8f3b695e | 2951 | * @arg @ref LL_RTC_BKP_DR1 |
EricLew | 0:80ee8f3b695e | 2952 | * @arg @ref LL_RTC_BKP_DR2 |
EricLew | 0:80ee8f3b695e | 2953 | * @arg @ref LL_RTC_BKP_DR3 |
EricLew | 0:80ee8f3b695e | 2954 | * @arg @ref LL_RTC_BKP_DR4 |
EricLew | 0:80ee8f3b695e | 2955 | * @arg @ref LL_RTC_BKP_DR5 |
EricLew | 0:80ee8f3b695e | 2956 | * @arg @ref LL_RTC_BKP_DR6 |
EricLew | 0:80ee8f3b695e | 2957 | * @arg @ref LL_RTC_BKP_DR7 |
EricLew | 0:80ee8f3b695e | 2958 | * @arg @ref LL_RTC_BKP_DR8 |
EricLew | 0:80ee8f3b695e | 2959 | * @arg @ref LL_RTC_BKP_DR9 |
EricLew | 0:80ee8f3b695e | 2960 | * @arg @ref LL_RTC_BKP_DR10 |
EricLew | 0:80ee8f3b695e | 2961 | * @arg @ref LL_RTC_BKP_DR11 |
EricLew | 0:80ee8f3b695e | 2962 | * @arg @ref LL_RTC_BKP_DR12 |
EricLew | 0:80ee8f3b695e | 2963 | * @arg @ref LL_RTC_BKP_DR13 |
EricLew | 0:80ee8f3b695e | 2964 | * @arg @ref LL_RTC_BKP_DR14 |
EricLew | 0:80ee8f3b695e | 2965 | * @arg @ref LL_RTC_BKP_DR15 |
EricLew | 0:80ee8f3b695e | 2966 | * @arg @ref LL_RTC_BKP_DR16 |
EricLew | 0:80ee8f3b695e | 2967 | * @arg @ref LL_RTC_BKP_DR17 |
EricLew | 0:80ee8f3b695e | 2968 | * @arg @ref LL_RTC_BKP_DR18 |
EricLew | 0:80ee8f3b695e | 2969 | * @arg @ref LL_RTC_BKP_DR19 |
EricLew | 0:80ee8f3b695e | 2970 | * @arg @ref LL_RTC_BKP_DR20 |
EricLew | 0:80ee8f3b695e | 2971 | * @arg @ref LL_RTC_BKP_DR21 |
EricLew | 0:80ee8f3b695e | 2972 | * @arg @ref LL_RTC_BKP_DR22 |
EricLew | 0:80ee8f3b695e | 2973 | * @arg @ref LL_RTC_BKP_DR23 |
EricLew | 0:80ee8f3b695e | 2974 | * @arg @ref LL_RTC_BKP_DR24 |
EricLew | 0:80ee8f3b695e | 2975 | * @arg @ref LL_RTC_BKP_DR25 |
EricLew | 0:80ee8f3b695e | 2976 | * @arg @ref LL_RTC_BKP_DR26 |
EricLew | 0:80ee8f3b695e | 2977 | * @arg @ref LL_RTC_BKP_DR27 |
EricLew | 0:80ee8f3b695e | 2978 | * @arg @ref LL_RTC_BKP_DR28 |
EricLew | 0:80ee8f3b695e | 2979 | * @arg @ref LL_RTC_BKP_DR29 |
EricLew | 0:80ee8f3b695e | 2980 | * @arg @ref LL_RTC_BKP_DR30 |
EricLew | 0:80ee8f3b695e | 2981 | * @arg @ref LL_RTC_BKP_DR31 |
EricLew | 0:80ee8f3b695e | 2982 | * @retval 0. . .0xFFFFFFFF |
EricLew | 0:80ee8f3b695e | 2983 | */ |
EricLew | 0:80ee8f3b695e | 2984 | __STATIC_INLINE uint32_t LL_RTC_BAK_GetRegister(RTC_TypeDef *RTCx, uint32_t BackupRegister) |
EricLew | 0:80ee8f3b695e | 2985 | { |
EricLew | 0:80ee8f3b695e | 2986 | register uint32_t tmp = 0; |
EricLew | 0:80ee8f3b695e | 2987 | |
EricLew | 0:80ee8f3b695e | 2988 | tmp = (uint32_t)(&(RTCx->BKP0R)); |
EricLew | 0:80ee8f3b695e | 2989 | tmp += (BackupRegister * 4); |
EricLew | 0:80ee8f3b695e | 2990 | |
EricLew | 0:80ee8f3b695e | 2991 | /* Read the specified register */ |
EricLew | 0:80ee8f3b695e | 2992 | return (*(__IO uint32_t *)tmp); |
EricLew | 0:80ee8f3b695e | 2993 | } |
EricLew | 0:80ee8f3b695e | 2994 | |
EricLew | 0:80ee8f3b695e | 2995 | /** |
EricLew | 0:80ee8f3b695e | 2996 | * @} |
EricLew | 0:80ee8f3b695e | 2997 | */ |
EricLew | 0:80ee8f3b695e | 2998 | |
EricLew | 0:80ee8f3b695e | 2999 | /** @defgroup RTC_LL_EF_Calibration Calibration |
EricLew | 0:80ee8f3b695e | 3000 | * @{ |
EricLew | 0:80ee8f3b695e | 3001 | */ |
EricLew | 0:80ee8f3b695e | 3002 | |
EricLew | 0:80ee8f3b695e | 3003 | /** |
EricLew | 0:80ee8f3b695e | 3004 | * @brief Set Calibration output frequency (1 Hz or 512 Hz) |
EricLew | 0:80ee8f3b695e | 3005 | * @note Bits are write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3006 | * @rmtoll CR COE LL_RTC_CAL_SetOutputFreq\n |
EricLew | 0:80ee8f3b695e | 3007 | * CR COSEL LL_RTC_CAL_SetOutputFreq |
EricLew | 0:80ee8f3b695e | 3008 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3009 | * @param Frequency This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 3010 | * @arg @ref LL_RTC_CALIB_OUTPUT_NONE |
EricLew | 0:80ee8f3b695e | 3011 | * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ |
EricLew | 0:80ee8f3b695e | 3012 | * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ |
EricLew | 0:80ee8f3b695e | 3013 | * @retval None |
EricLew | 0:80ee8f3b695e | 3014 | */ |
EricLew | 0:80ee8f3b695e | 3015 | __STATIC_INLINE void LL_RTC_CAL_SetOutputFreq(RTC_TypeDef *RTCx, uint32_t Frequency) |
EricLew | 0:80ee8f3b695e | 3016 | { |
EricLew | 0:80ee8f3b695e | 3017 | MODIFY_REG(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL, Frequency); |
EricLew | 0:80ee8f3b695e | 3018 | } |
EricLew | 0:80ee8f3b695e | 3019 | |
EricLew | 0:80ee8f3b695e | 3020 | /** |
EricLew | 0:80ee8f3b695e | 3021 | * @brief Get Calibration output frequency (1 Hz or 512 Hz) |
EricLew | 0:80ee8f3b695e | 3022 | * @rmtoll CR COE LL_RTC_CAL_GetOutputFreq\n |
EricLew | 0:80ee8f3b695e | 3023 | * CR COSEL LL_RTC_CAL_GetOutputFreq |
EricLew | 0:80ee8f3b695e | 3024 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3025 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 3026 | * @arg @ref LL_RTC_CALIB_OUTPUT_NONE |
EricLew | 0:80ee8f3b695e | 3027 | * @arg @ref LL_RTC_CALIB_OUTPUT_1HZ |
EricLew | 0:80ee8f3b695e | 3028 | * @arg @ref LL_RTC_CALIB_OUTPUT_512HZ |
EricLew | 0:80ee8f3b695e | 3029 | */ |
EricLew | 0:80ee8f3b695e | 3030 | __STATIC_INLINE uint32_t LL_RTC_CAL_GetOutputFreq(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3031 | { |
EricLew | 0:80ee8f3b695e | 3032 | return (uint32_t)(READ_BIT(RTCx->CR, RTC_CR_COE | RTC_CR_COSEL)); |
EricLew | 0:80ee8f3b695e | 3033 | } |
EricLew | 0:80ee8f3b695e | 3034 | |
EricLew | 0:80ee8f3b695e | 3035 | /** |
EricLew | 0:80ee8f3b695e | 3036 | * @brief Insert or not One RTCCLK pulse every 2exp11 pulses (frequency increased by 488.5 ppm) |
EricLew | 0:80ee8f3b695e | 3037 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3038 | * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR |
EricLew | 0:80ee8f3b695e | 3039 | * @rmtoll CALR CALP LL_RTC_CAL_SetPulse |
EricLew | 0:80ee8f3b695e | 3040 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3041 | * @param Pulse This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 3042 | * @arg @ref LL_RTC_CALIB_INSERTPULSE_NONE |
EricLew | 0:80ee8f3b695e | 3043 | * @arg @ref LL_RTC_CALIB_INSERTPULSE_SET |
EricLew | 0:80ee8f3b695e | 3044 | * @retval None |
EricLew | 0:80ee8f3b695e | 3045 | */ |
EricLew | 0:80ee8f3b695e | 3046 | __STATIC_INLINE void LL_RTC_CAL_SetPulse(RTC_TypeDef *RTCx, uint32_t Pulse) |
EricLew | 0:80ee8f3b695e | 3047 | { |
EricLew | 0:80ee8f3b695e | 3048 | MODIFY_REG(RTCx->CALR, RTC_CALR_CALP, Pulse); |
EricLew | 0:80ee8f3b695e | 3049 | } |
EricLew | 0:80ee8f3b695e | 3050 | |
EricLew | 0:80ee8f3b695e | 3051 | /** |
EricLew | 0:80ee8f3b695e | 3052 | * @brief Check if one RTCCLK has been inserted or not every 2exp11 pulses (frequency increased by 488.5 ppm) |
EricLew | 0:80ee8f3b695e | 3053 | * @rmtoll CALR CALP LL_RTC_CAL_IsPulseInserted |
EricLew | 0:80ee8f3b695e | 3054 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3055 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3056 | */ |
EricLew | 0:80ee8f3b695e | 3057 | __STATIC_INLINE uint32_t LL_RTC_CAL_IsPulseInserted(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3058 | { |
EricLew | 0:80ee8f3b695e | 3059 | return (READ_BIT(RTCx->CALR, RTC_CALR_CALP) == (RTC_CALR_CALP)); |
EricLew | 0:80ee8f3b695e | 3060 | } |
EricLew | 0:80ee8f3b695e | 3061 | |
EricLew | 0:80ee8f3b695e | 3062 | /** |
EricLew | 0:80ee8f3b695e | 3063 | * @brief Set the calibration cycle period |
EricLew | 0:80ee8f3b695e | 3064 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3065 | * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR |
EricLew | 0:80ee8f3b695e | 3066 | * @rmtoll CALR CALW8 LL_RTC_CAL_SetPeriod\n |
EricLew | 0:80ee8f3b695e | 3067 | * CALR CALW16 LL_RTC_CAL_SetPeriod |
EricLew | 0:80ee8f3b695e | 3068 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3069 | * @param Period This parameter can be one of the following values: |
EricLew | 0:80ee8f3b695e | 3070 | * @arg @ref LL_RTC_CALIB_PERIOD_32SEC |
EricLew | 0:80ee8f3b695e | 3071 | * @arg @ref LL_RTC_CALIB_PERIOD_16SEC |
EricLew | 0:80ee8f3b695e | 3072 | * @arg @ref LL_RTC_CALIB_PERIOD_8SEC |
EricLew | 0:80ee8f3b695e | 3073 | * @retval None |
EricLew | 0:80ee8f3b695e | 3074 | */ |
EricLew | 0:80ee8f3b695e | 3075 | __STATIC_INLINE void LL_RTC_CAL_SetPeriod(RTC_TypeDef *RTCx, uint32_t Period) |
EricLew | 0:80ee8f3b695e | 3076 | { |
EricLew | 0:80ee8f3b695e | 3077 | MODIFY_REG(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16, Period); |
EricLew | 0:80ee8f3b695e | 3078 | } |
EricLew | 0:80ee8f3b695e | 3079 | |
EricLew | 0:80ee8f3b695e | 3080 | /** |
EricLew | 0:80ee8f3b695e | 3081 | * @brief Get the calibration cycle period |
EricLew | 0:80ee8f3b695e | 3082 | * @rmtoll CALR CALW8 LL_RTC_CAL_GetPeriod\n |
EricLew | 0:80ee8f3b695e | 3083 | * CALR CALW16 LL_RTC_CAL_GetPeriod |
EricLew | 0:80ee8f3b695e | 3084 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3085 | * @retval Returned value can be one of the following values: |
EricLew | 0:80ee8f3b695e | 3086 | * @arg @ref LL_RTC_CALIB_PERIOD_32SEC |
EricLew | 0:80ee8f3b695e | 3087 | * @arg @ref LL_RTC_CALIB_PERIOD_16SEC |
EricLew | 0:80ee8f3b695e | 3088 | * @arg @ref LL_RTC_CALIB_PERIOD_8SEC |
EricLew | 0:80ee8f3b695e | 3089 | */ |
EricLew | 0:80ee8f3b695e | 3090 | __STATIC_INLINE uint32_t LL_RTC_CAL_GetPeriod(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3091 | { |
EricLew | 0:80ee8f3b695e | 3092 | return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALW8 | RTC_CALR_CALW16)); |
EricLew | 0:80ee8f3b695e | 3093 | } |
EricLew | 0:80ee8f3b695e | 3094 | |
EricLew | 0:80ee8f3b695e | 3095 | /** |
EricLew | 0:80ee8f3b695e | 3096 | * @brief Set Calibration minus |
EricLew | 0:80ee8f3b695e | 3097 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3098 | * @note Bit can be written only when RECALPF is set to 0 in RTC_ISR |
EricLew | 0:80ee8f3b695e | 3099 | * @rmtoll CALR CALM LL_RTC_CAL_SetMinus |
EricLew | 0:80ee8f3b695e | 3100 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3101 | * @param CalibMinus 0. . . 0x1FF |
EricLew | 0:80ee8f3b695e | 3102 | * @retval None |
EricLew | 0:80ee8f3b695e | 3103 | */ |
EricLew | 0:80ee8f3b695e | 3104 | __STATIC_INLINE void LL_RTC_CAL_SetMinus(RTC_TypeDef *RTCx, uint32_t CalibMinus) |
EricLew | 0:80ee8f3b695e | 3105 | { |
EricLew | 0:80ee8f3b695e | 3106 | MODIFY_REG(RTCx->CALR, RTC_CALR_CALM, CalibMinus); |
EricLew | 0:80ee8f3b695e | 3107 | } |
EricLew | 0:80ee8f3b695e | 3108 | |
EricLew | 0:80ee8f3b695e | 3109 | /** |
EricLew | 0:80ee8f3b695e | 3110 | * @brief Get Calibration minus |
EricLew | 0:80ee8f3b695e | 3111 | * @rmtoll CALR CALM LL_RTC_CAL_GetMinus |
EricLew | 0:80ee8f3b695e | 3112 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3113 | * @retval 0. . . 0x1FF |
EricLew | 0:80ee8f3b695e | 3114 | */ |
EricLew | 0:80ee8f3b695e | 3115 | __STATIC_INLINE uint32_t LL_RTC_CAL_GetMinus(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3116 | { |
EricLew | 0:80ee8f3b695e | 3117 | return (uint32_t)(READ_BIT(RTCx->CALR, RTC_CALR_CALM)); |
EricLew | 0:80ee8f3b695e | 3118 | } |
EricLew | 0:80ee8f3b695e | 3119 | |
EricLew | 0:80ee8f3b695e | 3120 | /** |
EricLew | 0:80ee8f3b695e | 3121 | * @} |
EricLew | 0:80ee8f3b695e | 3122 | */ |
EricLew | 0:80ee8f3b695e | 3123 | |
EricLew | 0:80ee8f3b695e | 3124 | /** @defgroup RTC_LL_EF_FLAG_Management FLAG_Management |
EricLew | 0:80ee8f3b695e | 3125 | * @{ |
EricLew | 0:80ee8f3b695e | 3126 | */ |
EricLew | 0:80ee8f3b695e | 3127 | |
EricLew | 0:80ee8f3b695e | 3128 | /** |
EricLew | 0:80ee8f3b695e | 3129 | * @brief Get Internal Time-stamp flag |
EricLew | 0:80ee8f3b695e | 3130 | * @rmtoll ISR ITSF LL_RTC_IsActiveFlag_ITS |
EricLew | 0:80ee8f3b695e | 3131 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3132 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3133 | */ |
EricLew | 0:80ee8f3b695e | 3134 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ITS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3135 | { |
EricLew | 0:80ee8f3b695e | 3136 | return (READ_BIT(RTCx->ISR, RTC_ISR_ITSF) == (RTC_ISR_ITSF)); |
EricLew | 0:80ee8f3b695e | 3137 | } |
EricLew | 0:80ee8f3b695e | 3138 | |
EricLew | 0:80ee8f3b695e | 3139 | /** |
EricLew | 0:80ee8f3b695e | 3140 | * @brief Get Recalibration pending Flag |
EricLew | 0:80ee8f3b695e | 3141 | * @rmtoll ISR RECALPF LL_RTC_IsActiveFlag_RECALP |
EricLew | 0:80ee8f3b695e | 3142 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3143 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3144 | */ |
EricLew | 0:80ee8f3b695e | 3145 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RECALP(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3146 | { |
EricLew | 0:80ee8f3b695e | 3147 | return (READ_BIT(RTCx->ISR, RTC_ISR_RECALPF) == (RTC_ISR_RECALPF)); |
EricLew | 0:80ee8f3b695e | 3148 | } |
EricLew | 0:80ee8f3b695e | 3149 | |
EricLew | 0:80ee8f3b695e | 3150 | /** |
EricLew | 0:80ee8f3b695e | 3151 | * @brief Get RTC_TAMP3 detection flag |
EricLew | 0:80ee8f3b695e | 3152 | * @rmtoll ISR TAMP3F LL_RTC_IsActiveFlag_TAMP3 |
EricLew | 0:80ee8f3b695e | 3153 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3154 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3155 | */ |
EricLew | 0:80ee8f3b695e | 3156 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP3(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3157 | { |
EricLew | 0:80ee8f3b695e | 3158 | return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP3F) == (RTC_ISR_TAMP3F)); |
EricLew | 0:80ee8f3b695e | 3159 | } |
EricLew | 0:80ee8f3b695e | 3160 | |
EricLew | 0:80ee8f3b695e | 3161 | /** |
EricLew | 0:80ee8f3b695e | 3162 | * @brief Get RTC_TAMP2 detection flag |
EricLew | 0:80ee8f3b695e | 3163 | * @rmtoll ISR TAMP2F LL_RTC_IsActiveFlag_TAMP2 |
EricLew | 0:80ee8f3b695e | 3164 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3165 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3166 | */ |
EricLew | 0:80ee8f3b695e | 3167 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP2(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3168 | { |
EricLew | 0:80ee8f3b695e | 3169 | return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP2F) == (RTC_ISR_TAMP2F)); |
EricLew | 0:80ee8f3b695e | 3170 | } |
EricLew | 0:80ee8f3b695e | 3171 | |
EricLew | 0:80ee8f3b695e | 3172 | /** |
EricLew | 0:80ee8f3b695e | 3173 | * @brief Get RTC_TAMP1 detection flag |
EricLew | 0:80ee8f3b695e | 3174 | * @rmtoll ISR TAMP1F LL_RTC_IsActiveFlag_TAMP1 |
EricLew | 0:80ee8f3b695e | 3175 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3176 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3177 | */ |
EricLew | 0:80ee8f3b695e | 3178 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TAMP1(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3179 | { |
EricLew | 0:80ee8f3b695e | 3180 | return (READ_BIT(RTCx->ISR, RTC_ISR_TAMP1F) == (RTC_ISR_TAMP1F)); |
EricLew | 0:80ee8f3b695e | 3181 | } |
EricLew | 0:80ee8f3b695e | 3182 | |
EricLew | 0:80ee8f3b695e | 3183 | /** |
EricLew | 0:80ee8f3b695e | 3184 | * @brief Get Time-stamp overflow flag |
EricLew | 0:80ee8f3b695e | 3185 | * @rmtoll ISR TSOVF LL_RTC_IsActiveFlag_TSOV |
EricLew | 0:80ee8f3b695e | 3186 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3187 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3188 | */ |
EricLew | 0:80ee8f3b695e | 3189 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TSOV(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3190 | { |
EricLew | 0:80ee8f3b695e | 3191 | return (READ_BIT(RTCx->ISR, RTC_ISR_TSOVF) == (RTC_ISR_TSOVF)); |
EricLew | 0:80ee8f3b695e | 3192 | } |
EricLew | 0:80ee8f3b695e | 3193 | |
EricLew | 0:80ee8f3b695e | 3194 | /** |
EricLew | 0:80ee8f3b695e | 3195 | * @brief Get Time-stamp flag |
EricLew | 0:80ee8f3b695e | 3196 | * @rmtoll ISR TSF LL_RTC_IsActiveFlag_TS |
EricLew | 0:80ee8f3b695e | 3197 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3198 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3199 | */ |
EricLew | 0:80ee8f3b695e | 3200 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_TS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3201 | { |
EricLew | 0:80ee8f3b695e | 3202 | return (READ_BIT(RTCx->ISR, RTC_ISR_TSF) == (RTC_ISR_TSF)); |
EricLew | 0:80ee8f3b695e | 3203 | } |
EricLew | 0:80ee8f3b695e | 3204 | |
EricLew | 0:80ee8f3b695e | 3205 | /** |
EricLew | 0:80ee8f3b695e | 3206 | * @brief Get Wakeup timer flag |
EricLew | 0:80ee8f3b695e | 3207 | * @rmtoll ISR WUTF LL_RTC_IsActiveFlag_WUT |
EricLew | 0:80ee8f3b695e | 3208 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3209 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3210 | */ |
EricLew | 0:80ee8f3b695e | 3211 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3212 | { |
EricLew | 0:80ee8f3b695e | 3213 | return (READ_BIT(RTCx->ISR, RTC_ISR_WUTF) == (RTC_ISR_WUTF)); |
EricLew | 0:80ee8f3b695e | 3214 | } |
EricLew | 0:80ee8f3b695e | 3215 | |
EricLew | 0:80ee8f3b695e | 3216 | /** |
EricLew | 0:80ee8f3b695e | 3217 | * @brief Get Alarm B flag |
EricLew | 0:80ee8f3b695e | 3218 | * @rmtoll ISR ALRBF LL_RTC_IsActiveFlag_ALRB |
EricLew | 0:80ee8f3b695e | 3219 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3220 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3221 | */ |
EricLew | 0:80ee8f3b695e | 3222 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRB(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3223 | { |
EricLew | 0:80ee8f3b695e | 3224 | return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBF) == (RTC_ISR_ALRBF)); |
EricLew | 0:80ee8f3b695e | 3225 | } |
EricLew | 0:80ee8f3b695e | 3226 | |
EricLew | 0:80ee8f3b695e | 3227 | /** |
EricLew | 0:80ee8f3b695e | 3228 | * @brief Get Alarm A flag |
EricLew | 0:80ee8f3b695e | 3229 | * @rmtoll ISR ALRAF LL_RTC_IsActiveFlag_ALRA |
EricLew | 0:80ee8f3b695e | 3230 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3231 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3232 | */ |
EricLew | 0:80ee8f3b695e | 3233 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRA(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3234 | { |
EricLew | 0:80ee8f3b695e | 3235 | return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAF) == (RTC_ISR_ALRAF)); |
EricLew | 0:80ee8f3b695e | 3236 | } |
EricLew | 0:80ee8f3b695e | 3237 | |
EricLew | 0:80ee8f3b695e | 3238 | /** |
EricLew | 0:80ee8f3b695e | 3239 | * @brief Clear Internal Time-stamp flag |
EricLew | 0:80ee8f3b695e | 3240 | * @rmtoll ISR ITSF LL_RTC_ClearFlag_ITS |
EricLew | 0:80ee8f3b695e | 3241 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3242 | * @retval None |
EricLew | 0:80ee8f3b695e | 3243 | */ |
EricLew | 0:80ee8f3b695e | 3244 | __STATIC_INLINE void LL_RTC_ClearFlag_ITS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3245 | { |
EricLew | 0:80ee8f3b695e | 3246 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_ITSF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3247 | } |
EricLew | 0:80ee8f3b695e | 3248 | |
EricLew | 0:80ee8f3b695e | 3249 | /** |
EricLew | 0:80ee8f3b695e | 3250 | * @brief Clear RTC_TAMP3 detection flag |
EricLew | 0:80ee8f3b695e | 3251 | * @rmtoll ISR TAMP3F LL_RTC_ClearFlag_TAMP3 |
EricLew | 0:80ee8f3b695e | 3252 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3253 | * @retval None |
EricLew | 0:80ee8f3b695e | 3254 | */ |
EricLew | 0:80ee8f3b695e | 3255 | __STATIC_INLINE void LL_RTC_ClearFlag_TAMP3(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3256 | { |
EricLew | 0:80ee8f3b695e | 3257 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP3F | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3258 | } |
EricLew | 0:80ee8f3b695e | 3259 | |
EricLew | 0:80ee8f3b695e | 3260 | /** |
EricLew | 0:80ee8f3b695e | 3261 | * @brief Clear RTC_TAMP2 detection flag |
EricLew | 0:80ee8f3b695e | 3262 | * @rmtoll ISR TAMP2F LL_RTC_ClearFlag_TAMP2 |
EricLew | 0:80ee8f3b695e | 3263 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3264 | * @retval None |
EricLew | 0:80ee8f3b695e | 3265 | */ |
EricLew | 0:80ee8f3b695e | 3266 | __STATIC_INLINE void LL_RTC_ClearFlag_TAMP2(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3267 | { |
EricLew | 0:80ee8f3b695e | 3268 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP2F | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3269 | } |
EricLew | 0:80ee8f3b695e | 3270 | |
EricLew | 0:80ee8f3b695e | 3271 | /** |
EricLew | 0:80ee8f3b695e | 3272 | * @brief Clear RTC_TAMP1 detection flag |
EricLew | 0:80ee8f3b695e | 3273 | * @rmtoll ISR TAMP1F LL_RTC_ClearFlag_TAMP1 |
EricLew | 0:80ee8f3b695e | 3274 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3275 | * @retval None |
EricLew | 0:80ee8f3b695e | 3276 | */ |
EricLew | 0:80ee8f3b695e | 3277 | __STATIC_INLINE void LL_RTC_ClearFlag_TAMP1(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3278 | { |
EricLew | 0:80ee8f3b695e | 3279 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_TAMP1F | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3280 | } |
EricLew | 0:80ee8f3b695e | 3281 | |
EricLew | 0:80ee8f3b695e | 3282 | /** |
EricLew | 0:80ee8f3b695e | 3283 | * @brief Clear Time-stamp overflow flag |
EricLew | 0:80ee8f3b695e | 3284 | * @rmtoll ISR TSOVF LL_RTC_ClearFlag_TSOV |
EricLew | 0:80ee8f3b695e | 3285 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3286 | * @retval None |
EricLew | 0:80ee8f3b695e | 3287 | */ |
EricLew | 0:80ee8f3b695e | 3288 | __STATIC_INLINE void LL_RTC_ClearFlag_TSOV(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3289 | { |
EricLew | 0:80ee8f3b695e | 3290 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSOVF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3291 | } |
EricLew | 0:80ee8f3b695e | 3292 | |
EricLew | 0:80ee8f3b695e | 3293 | /** |
EricLew | 0:80ee8f3b695e | 3294 | * @brief Clear Time-stamp flag |
EricLew | 0:80ee8f3b695e | 3295 | * @rmtoll ISR TSF LL_RTC_ClearFlag_TS |
EricLew | 0:80ee8f3b695e | 3296 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3297 | * @retval None |
EricLew | 0:80ee8f3b695e | 3298 | */ |
EricLew | 0:80ee8f3b695e | 3299 | __STATIC_INLINE void LL_RTC_ClearFlag_TS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3300 | { |
EricLew | 0:80ee8f3b695e | 3301 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_TSF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3302 | } |
EricLew | 0:80ee8f3b695e | 3303 | |
EricLew | 0:80ee8f3b695e | 3304 | /** |
EricLew | 0:80ee8f3b695e | 3305 | * @brief Clear Wakeup timer flag |
EricLew | 0:80ee8f3b695e | 3306 | * @rmtoll ISR WUTF LL_RTC_ClearFlag_WUT |
EricLew | 0:80ee8f3b695e | 3307 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3308 | * @retval None |
EricLew | 0:80ee8f3b695e | 3309 | */ |
EricLew | 0:80ee8f3b695e | 3310 | __STATIC_INLINE void LL_RTC_ClearFlag_WUT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3311 | { |
EricLew | 0:80ee8f3b695e | 3312 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_WUTF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3313 | } |
EricLew | 0:80ee8f3b695e | 3314 | |
EricLew | 0:80ee8f3b695e | 3315 | /** |
EricLew | 0:80ee8f3b695e | 3316 | * @brief Clear Alarm B flag |
EricLew | 0:80ee8f3b695e | 3317 | * @rmtoll ISR ALRBF LL_RTC_ClearFlag_ALRB |
EricLew | 0:80ee8f3b695e | 3318 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3319 | * @retval None |
EricLew | 0:80ee8f3b695e | 3320 | */ |
EricLew | 0:80ee8f3b695e | 3321 | __STATIC_INLINE void LL_RTC_ClearFlag_ALRB(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3322 | { |
EricLew | 0:80ee8f3b695e | 3323 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRBF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3324 | } |
EricLew | 0:80ee8f3b695e | 3325 | |
EricLew | 0:80ee8f3b695e | 3326 | /** |
EricLew | 0:80ee8f3b695e | 3327 | * @brief Clear Alarm A flag |
EricLew | 0:80ee8f3b695e | 3328 | * @rmtoll ISR ALRAF LL_RTC_ClearFlag_ALRA |
EricLew | 0:80ee8f3b695e | 3329 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3330 | * @retval None |
EricLew | 0:80ee8f3b695e | 3331 | */ |
EricLew | 0:80ee8f3b695e | 3332 | __STATIC_INLINE void LL_RTC_ClearFlag_ALRA(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3333 | { |
EricLew | 0:80ee8f3b695e | 3334 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_ALRAF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3335 | } |
EricLew | 0:80ee8f3b695e | 3336 | |
EricLew | 0:80ee8f3b695e | 3337 | /** |
EricLew | 0:80ee8f3b695e | 3338 | * @brief Get Initialization flag |
EricLew | 0:80ee8f3b695e | 3339 | * @rmtoll ISR INITF LL_RTC_IsActiveFlag_INIT |
EricLew | 0:80ee8f3b695e | 3340 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3341 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3342 | */ |
EricLew | 0:80ee8f3b695e | 3343 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INIT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3344 | { |
EricLew | 0:80ee8f3b695e | 3345 | return (READ_BIT(RTCx->ISR, RTC_ISR_INITF) == (RTC_ISR_INITF)); |
EricLew | 0:80ee8f3b695e | 3346 | } |
EricLew | 0:80ee8f3b695e | 3347 | |
EricLew | 0:80ee8f3b695e | 3348 | /** |
EricLew | 0:80ee8f3b695e | 3349 | * @brief Get Registers synchronization flag |
EricLew | 0:80ee8f3b695e | 3350 | * @rmtoll ISR RSF LL_RTC_IsActiveFlag_RS |
EricLew | 0:80ee8f3b695e | 3351 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3352 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3353 | */ |
EricLew | 0:80ee8f3b695e | 3354 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_RS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3355 | { |
EricLew | 0:80ee8f3b695e | 3356 | return (READ_BIT(RTCx->ISR, RTC_ISR_RSF) == (RTC_ISR_RSF)); |
EricLew | 0:80ee8f3b695e | 3357 | } |
EricLew | 0:80ee8f3b695e | 3358 | |
EricLew | 0:80ee8f3b695e | 3359 | /** |
EricLew | 0:80ee8f3b695e | 3360 | * @brief Clear Registers synchronization flag |
EricLew | 0:80ee8f3b695e | 3361 | * @rmtoll ISR RSF LL_RTC_ClearFlag_RS |
EricLew | 0:80ee8f3b695e | 3362 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3363 | * @retval None |
EricLew | 0:80ee8f3b695e | 3364 | */ |
EricLew | 0:80ee8f3b695e | 3365 | __STATIC_INLINE void LL_RTC_ClearFlag_RS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3366 | { |
EricLew | 0:80ee8f3b695e | 3367 | WRITE_REG(RTCx->ISR, (~((RTC_ISR_RSF | RTC_ISR_INIT) & 0x0000FFFF) | (RTCx->ISR & RTC_ISR_INIT))); |
EricLew | 0:80ee8f3b695e | 3368 | } |
EricLew | 0:80ee8f3b695e | 3369 | |
EricLew | 0:80ee8f3b695e | 3370 | /** |
EricLew | 0:80ee8f3b695e | 3371 | * @brief Get Initialization status flag |
EricLew | 0:80ee8f3b695e | 3372 | * @rmtoll ISR INITS LL_RTC_IsActiveFlag_INITS |
EricLew | 0:80ee8f3b695e | 3373 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3374 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3375 | */ |
EricLew | 0:80ee8f3b695e | 3376 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_INITS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3377 | { |
EricLew | 0:80ee8f3b695e | 3378 | return (READ_BIT(RTCx->ISR, RTC_ISR_INITS) == (RTC_ISR_INITS)); |
EricLew | 0:80ee8f3b695e | 3379 | } |
EricLew | 0:80ee8f3b695e | 3380 | |
EricLew | 0:80ee8f3b695e | 3381 | /** |
EricLew | 0:80ee8f3b695e | 3382 | * @brief Get Shift operation pending flag |
EricLew | 0:80ee8f3b695e | 3383 | * @rmtoll ISR SHPF LL_RTC_IsActiveFlag_SHP |
EricLew | 0:80ee8f3b695e | 3384 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3385 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3386 | */ |
EricLew | 0:80ee8f3b695e | 3387 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_SHP(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3388 | { |
EricLew | 0:80ee8f3b695e | 3389 | return (READ_BIT(RTCx->ISR, RTC_ISR_SHPF) == (RTC_ISR_SHPF)); |
EricLew | 0:80ee8f3b695e | 3390 | } |
EricLew | 0:80ee8f3b695e | 3391 | |
EricLew | 0:80ee8f3b695e | 3392 | /** |
EricLew | 0:80ee8f3b695e | 3393 | * @brief Get Wakeup timer write flag |
EricLew | 0:80ee8f3b695e | 3394 | * @rmtoll ISR WUTWF LL_RTC_IsActiveFlag_WUTW |
EricLew | 0:80ee8f3b695e | 3395 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3396 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3397 | */ |
EricLew | 0:80ee8f3b695e | 3398 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_WUTW(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3399 | { |
EricLew | 0:80ee8f3b695e | 3400 | return (READ_BIT(RTCx->ISR, RTC_ISR_WUTWF) == (RTC_ISR_WUTWF)); |
EricLew | 0:80ee8f3b695e | 3401 | } |
EricLew | 0:80ee8f3b695e | 3402 | |
EricLew | 0:80ee8f3b695e | 3403 | /** |
EricLew | 0:80ee8f3b695e | 3404 | * @brief Get Alarm B write flag |
EricLew | 0:80ee8f3b695e | 3405 | * @rmtoll ISR ALRBWF LL_RTC_IsActiveFlag_ALRBW |
EricLew | 0:80ee8f3b695e | 3406 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3407 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3408 | */ |
EricLew | 0:80ee8f3b695e | 3409 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRBW(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3410 | { |
EricLew | 0:80ee8f3b695e | 3411 | return (READ_BIT(RTCx->ISR, RTC_ISR_ALRBWF) == (RTC_ISR_ALRBWF)); |
EricLew | 0:80ee8f3b695e | 3412 | } |
EricLew | 0:80ee8f3b695e | 3413 | |
EricLew | 0:80ee8f3b695e | 3414 | /** |
EricLew | 0:80ee8f3b695e | 3415 | * @brief Get Alarm A write flag |
EricLew | 0:80ee8f3b695e | 3416 | * @rmtoll ISR ALRAWF LL_RTC_IsActiveFlag_ALRAW |
EricLew | 0:80ee8f3b695e | 3417 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3418 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3419 | */ |
EricLew | 0:80ee8f3b695e | 3420 | __STATIC_INLINE uint32_t LL_RTC_IsActiveFlag_ALRAW(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3421 | { |
EricLew | 0:80ee8f3b695e | 3422 | return (READ_BIT(RTCx->ISR, RTC_ISR_ALRAWF) == (RTC_ISR_ALRAWF)); |
EricLew | 0:80ee8f3b695e | 3423 | } |
EricLew | 0:80ee8f3b695e | 3424 | |
EricLew | 0:80ee8f3b695e | 3425 | /** |
EricLew | 0:80ee8f3b695e | 3426 | * @} |
EricLew | 0:80ee8f3b695e | 3427 | */ |
EricLew | 0:80ee8f3b695e | 3428 | |
EricLew | 0:80ee8f3b695e | 3429 | /** @defgroup RTC_LL_EF_IT_Management IT_Management |
EricLew | 0:80ee8f3b695e | 3430 | * @{ |
EricLew | 0:80ee8f3b695e | 3431 | */ |
EricLew | 0:80ee8f3b695e | 3432 | |
EricLew | 0:80ee8f3b695e | 3433 | /** |
EricLew | 0:80ee8f3b695e | 3434 | * @brief Enable Time-stamp interrupt |
EricLew | 0:80ee8f3b695e | 3435 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3436 | * @rmtoll CR TSIE LL_RTC_EnableIT_TS |
EricLew | 0:80ee8f3b695e | 3437 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3438 | * @retval None |
EricLew | 0:80ee8f3b695e | 3439 | */ |
EricLew | 0:80ee8f3b695e | 3440 | __STATIC_INLINE void LL_RTC_EnableIT_TS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3441 | { |
EricLew | 0:80ee8f3b695e | 3442 | SET_BIT(RTCx->CR, RTC_CR_TSIE); |
EricLew | 0:80ee8f3b695e | 3443 | } |
EricLew | 0:80ee8f3b695e | 3444 | |
EricLew | 0:80ee8f3b695e | 3445 | /** |
EricLew | 0:80ee8f3b695e | 3446 | * @brief Disable Time-stamp interrupt |
EricLew | 0:80ee8f3b695e | 3447 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3448 | * @rmtoll CR TSIE LL_RTC_DisableIT_TS |
EricLew | 0:80ee8f3b695e | 3449 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3450 | * @retval None |
EricLew | 0:80ee8f3b695e | 3451 | */ |
EricLew | 0:80ee8f3b695e | 3452 | __STATIC_INLINE void LL_RTC_DisableIT_TS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3453 | { |
EricLew | 0:80ee8f3b695e | 3454 | CLEAR_BIT(RTCx->CR, RTC_CR_TSIE); |
EricLew | 0:80ee8f3b695e | 3455 | } |
EricLew | 0:80ee8f3b695e | 3456 | |
EricLew | 0:80ee8f3b695e | 3457 | /** |
EricLew | 0:80ee8f3b695e | 3458 | * @brief Enable Wakeup timer interrupt |
EricLew | 0:80ee8f3b695e | 3459 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3460 | * @rmtoll CR WUTIE LL_RTC_EnableIT_WUT |
EricLew | 0:80ee8f3b695e | 3461 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3462 | * @retval None |
EricLew | 0:80ee8f3b695e | 3463 | */ |
EricLew | 0:80ee8f3b695e | 3464 | __STATIC_INLINE void LL_RTC_EnableIT_WUT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3465 | { |
EricLew | 0:80ee8f3b695e | 3466 | SET_BIT(RTCx->CR, RTC_CR_WUTIE); |
EricLew | 0:80ee8f3b695e | 3467 | } |
EricLew | 0:80ee8f3b695e | 3468 | |
EricLew | 0:80ee8f3b695e | 3469 | /** |
EricLew | 0:80ee8f3b695e | 3470 | * @brief Disable Wakeup timer interrupt |
EricLew | 0:80ee8f3b695e | 3471 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3472 | * @rmtoll CR WUTIE LL_RTC_DisableIT_WUT |
EricLew | 0:80ee8f3b695e | 3473 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3474 | * @retval None |
EricLew | 0:80ee8f3b695e | 3475 | */ |
EricLew | 0:80ee8f3b695e | 3476 | __STATIC_INLINE void LL_RTC_DisableIT_WUT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3477 | { |
EricLew | 0:80ee8f3b695e | 3478 | CLEAR_BIT(RTCx->CR, RTC_CR_WUTIE); |
EricLew | 0:80ee8f3b695e | 3479 | } |
EricLew | 0:80ee8f3b695e | 3480 | |
EricLew | 0:80ee8f3b695e | 3481 | /** |
EricLew | 0:80ee8f3b695e | 3482 | * @brief Enable Alarm B interrupt |
EricLew | 0:80ee8f3b695e | 3483 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3484 | * @rmtoll CR ALRBIE LL_RTC_EnableIT_ALRB |
EricLew | 0:80ee8f3b695e | 3485 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3486 | * @retval None |
EricLew | 0:80ee8f3b695e | 3487 | */ |
EricLew | 0:80ee8f3b695e | 3488 | __STATIC_INLINE void LL_RTC_EnableIT_ALRB(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3489 | { |
EricLew | 0:80ee8f3b695e | 3490 | SET_BIT(RTCx->CR, RTC_CR_ALRBIE); |
EricLew | 0:80ee8f3b695e | 3491 | } |
EricLew | 0:80ee8f3b695e | 3492 | |
EricLew | 0:80ee8f3b695e | 3493 | /** |
EricLew | 0:80ee8f3b695e | 3494 | * @brief Disable Alarm B interrupt |
EricLew | 0:80ee8f3b695e | 3495 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3496 | * @rmtoll CR ALRBIE LL_RTC_DisableIT_ALRB |
EricLew | 0:80ee8f3b695e | 3497 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3498 | * @retval None |
EricLew | 0:80ee8f3b695e | 3499 | */ |
EricLew | 0:80ee8f3b695e | 3500 | __STATIC_INLINE void LL_RTC_DisableIT_ALRB(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3501 | { |
EricLew | 0:80ee8f3b695e | 3502 | CLEAR_BIT(RTCx->CR, RTC_CR_ALRBIE); |
EricLew | 0:80ee8f3b695e | 3503 | } |
EricLew | 0:80ee8f3b695e | 3504 | |
EricLew | 0:80ee8f3b695e | 3505 | /** |
EricLew | 0:80ee8f3b695e | 3506 | * @brief Enable Alarm A interrupt |
EricLew | 0:80ee8f3b695e | 3507 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3508 | * @rmtoll CR ALRAIE LL_RTC_EnableIT_ALRA |
EricLew | 0:80ee8f3b695e | 3509 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3510 | * @retval None |
EricLew | 0:80ee8f3b695e | 3511 | */ |
EricLew | 0:80ee8f3b695e | 3512 | __STATIC_INLINE void LL_RTC_EnableIT_ALRA(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3513 | { |
EricLew | 0:80ee8f3b695e | 3514 | SET_BIT(RTCx->CR, RTC_CR_ALRAIE); |
EricLew | 0:80ee8f3b695e | 3515 | } |
EricLew | 0:80ee8f3b695e | 3516 | |
EricLew | 0:80ee8f3b695e | 3517 | /** |
EricLew | 0:80ee8f3b695e | 3518 | * @brief Disable Alarm A interrupt |
EricLew | 0:80ee8f3b695e | 3519 | * @note Bit is write-protected. @ref LL_RTC_DisableWriteProtection function should be called before. |
EricLew | 0:80ee8f3b695e | 3520 | * @rmtoll CR ALRAIE LL_RTC_DisableIT_ALRA |
EricLew | 0:80ee8f3b695e | 3521 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3522 | * @retval None |
EricLew | 0:80ee8f3b695e | 3523 | */ |
EricLew | 0:80ee8f3b695e | 3524 | __STATIC_INLINE void LL_RTC_DisableIT_ALRA(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3525 | { |
EricLew | 0:80ee8f3b695e | 3526 | CLEAR_BIT(RTCx->CR, RTC_CR_ALRAIE); |
EricLew | 0:80ee8f3b695e | 3527 | } |
EricLew | 0:80ee8f3b695e | 3528 | |
EricLew | 0:80ee8f3b695e | 3529 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 3530 | /** |
EricLew | 0:80ee8f3b695e | 3531 | * @brief Enable Tamper 3 interrupt |
EricLew | 0:80ee8f3b695e | 3532 | * @rmtoll TAMPCR TAMP3IE LL_RTC_EnableIT_TAMP3 |
EricLew | 0:80ee8f3b695e | 3533 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3534 | * @retval None |
EricLew | 0:80ee8f3b695e | 3535 | */ |
EricLew | 0:80ee8f3b695e | 3536 | __STATIC_INLINE void LL_RTC_EnableIT_TAMP3(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3537 | { |
EricLew | 0:80ee8f3b695e | 3538 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE); |
EricLew | 0:80ee8f3b695e | 3539 | } |
EricLew | 0:80ee8f3b695e | 3540 | #endif /* RTC_FEATURE_TAMPER3 */ |
EricLew | 0:80ee8f3b695e | 3541 | |
EricLew | 0:80ee8f3b695e | 3542 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 3543 | /** |
EricLew | 0:80ee8f3b695e | 3544 | * @brief Disable Tamper 3 interrupt |
EricLew | 0:80ee8f3b695e | 3545 | * @rmtoll TAMPCR TAMP3IE LL_RTC_DisableIT_TAMP3 |
EricLew | 0:80ee8f3b695e | 3546 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3547 | * @retval None |
EricLew | 0:80ee8f3b695e | 3548 | */ |
EricLew | 0:80ee8f3b695e | 3549 | __STATIC_INLINE void LL_RTC_DisableIT_TAMP3(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3550 | { |
EricLew | 0:80ee8f3b695e | 3551 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP3IE); |
EricLew | 0:80ee8f3b695e | 3552 | } |
EricLew | 0:80ee8f3b695e | 3553 | #endif /* RTC_FEATURE_TAMPER3 */ |
EricLew | 0:80ee8f3b695e | 3554 | |
EricLew | 0:80ee8f3b695e | 3555 | /** |
EricLew | 0:80ee8f3b695e | 3556 | * @brief Enable Tamper 2 interrupt |
EricLew | 0:80ee8f3b695e | 3557 | * @rmtoll TAMPCR TAMP2IE LL_RTC_EnableIT_TAMP2 |
EricLew | 0:80ee8f3b695e | 3558 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3559 | * @retval None |
EricLew | 0:80ee8f3b695e | 3560 | */ |
EricLew | 0:80ee8f3b695e | 3561 | __STATIC_INLINE void LL_RTC_EnableIT_TAMP2(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3562 | { |
EricLew | 0:80ee8f3b695e | 3563 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE); |
EricLew | 0:80ee8f3b695e | 3564 | } |
EricLew | 0:80ee8f3b695e | 3565 | |
EricLew | 0:80ee8f3b695e | 3566 | /** |
EricLew | 0:80ee8f3b695e | 3567 | * @brief Disable Tamper 2 interrupt |
EricLew | 0:80ee8f3b695e | 3568 | * @rmtoll TAMPCR TAMP2IE LL_RTC_DisableIT_TAMP2 |
EricLew | 0:80ee8f3b695e | 3569 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3570 | * @retval None |
EricLew | 0:80ee8f3b695e | 3571 | */ |
EricLew | 0:80ee8f3b695e | 3572 | __STATIC_INLINE void LL_RTC_DisableIT_TAMP2(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3573 | { |
EricLew | 0:80ee8f3b695e | 3574 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP2IE); |
EricLew | 0:80ee8f3b695e | 3575 | } |
EricLew | 0:80ee8f3b695e | 3576 | |
EricLew | 0:80ee8f3b695e | 3577 | /** |
EricLew | 0:80ee8f3b695e | 3578 | * @brief Enable Tamper 1 interrupt |
EricLew | 0:80ee8f3b695e | 3579 | * @rmtoll TAMPCR TAMP1IE LL_RTC_EnableIT_TAMP1 |
EricLew | 0:80ee8f3b695e | 3580 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3581 | * @retval None |
EricLew | 0:80ee8f3b695e | 3582 | */ |
EricLew | 0:80ee8f3b695e | 3583 | __STATIC_INLINE void LL_RTC_EnableIT_TAMP1(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3584 | { |
EricLew | 0:80ee8f3b695e | 3585 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE); |
EricLew | 0:80ee8f3b695e | 3586 | } |
EricLew | 0:80ee8f3b695e | 3587 | |
EricLew | 0:80ee8f3b695e | 3588 | /** |
EricLew | 0:80ee8f3b695e | 3589 | * @brief Disable Tamper 1 interrupt |
EricLew | 0:80ee8f3b695e | 3590 | * @rmtoll TAMPCR TAMP1IE LL_RTC_DisableIT_TAMP1 |
EricLew | 0:80ee8f3b695e | 3591 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3592 | * @retval None |
EricLew | 0:80ee8f3b695e | 3593 | */ |
EricLew | 0:80ee8f3b695e | 3594 | __STATIC_INLINE void LL_RTC_DisableIT_TAMP1(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3595 | { |
EricLew | 0:80ee8f3b695e | 3596 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMP1IE); |
EricLew | 0:80ee8f3b695e | 3597 | } |
EricLew | 0:80ee8f3b695e | 3598 | |
EricLew | 0:80ee8f3b695e | 3599 | /** |
EricLew | 0:80ee8f3b695e | 3600 | * @brief Enable all Tamper Interrupt |
EricLew | 0:80ee8f3b695e | 3601 | * @rmtoll TAMPCR TAMPIE LL_RTC_EnableIT_TAMP |
EricLew | 0:80ee8f3b695e | 3602 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3603 | * @retval None |
EricLew | 0:80ee8f3b695e | 3604 | */ |
EricLew | 0:80ee8f3b695e | 3605 | __STATIC_INLINE void LL_RTC_EnableIT_TAMP(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3606 | { |
EricLew | 0:80ee8f3b695e | 3607 | SET_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE); |
EricLew | 0:80ee8f3b695e | 3608 | } |
EricLew | 0:80ee8f3b695e | 3609 | |
EricLew | 0:80ee8f3b695e | 3610 | /** |
EricLew | 0:80ee8f3b695e | 3611 | * @brief Disable all Tamper Interrupt |
EricLew | 0:80ee8f3b695e | 3612 | * @rmtoll TAMPCR TAMPIE LL_RTC_DisableIT_TAMP |
EricLew | 0:80ee8f3b695e | 3613 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3614 | * @retval None |
EricLew | 0:80ee8f3b695e | 3615 | */ |
EricLew | 0:80ee8f3b695e | 3616 | __STATIC_INLINE void LL_RTC_DisableIT_TAMP(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3617 | { |
EricLew | 0:80ee8f3b695e | 3618 | CLEAR_BIT(RTCx->TAMPCR, RTC_TAMPCR_TAMPIE); |
EricLew | 0:80ee8f3b695e | 3619 | } |
EricLew | 0:80ee8f3b695e | 3620 | |
EricLew | 0:80ee8f3b695e | 3621 | /** |
EricLew | 0:80ee8f3b695e | 3622 | * @brief Check if Time-stamp interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3623 | * @rmtoll CR TSIE LL_RTC_IsEnabledIT_TS |
EricLew | 0:80ee8f3b695e | 3624 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3625 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3626 | */ |
EricLew | 0:80ee8f3b695e | 3627 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TS(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3628 | { |
EricLew | 0:80ee8f3b695e | 3629 | return (READ_BIT(RTCx->CR, RTC_CR_TSIE) == (RTC_CR_TSIE)); |
EricLew | 0:80ee8f3b695e | 3630 | } |
EricLew | 0:80ee8f3b695e | 3631 | |
EricLew | 0:80ee8f3b695e | 3632 | /** |
EricLew | 0:80ee8f3b695e | 3633 | * @brief Check if Wakeup timer interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3634 | * @rmtoll CR WUTIE LL_RTC_IsEnabledIT_WUT |
EricLew | 0:80ee8f3b695e | 3635 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3636 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3637 | */ |
EricLew | 0:80ee8f3b695e | 3638 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_WUT(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3639 | { |
EricLew | 0:80ee8f3b695e | 3640 | return (READ_BIT(RTCx->CR, RTC_CR_WUTIE) == (RTC_CR_WUTIE)); |
EricLew | 0:80ee8f3b695e | 3641 | } |
EricLew | 0:80ee8f3b695e | 3642 | |
EricLew | 0:80ee8f3b695e | 3643 | /** |
EricLew | 0:80ee8f3b695e | 3644 | * @brief Check if Alarm B interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3645 | * @rmtoll CR ALRBIE LL_RTC_IsEnabledIT_ALRB |
EricLew | 0:80ee8f3b695e | 3646 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3647 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3648 | */ |
EricLew | 0:80ee8f3b695e | 3649 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRB(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3650 | { |
EricLew | 0:80ee8f3b695e | 3651 | return (READ_BIT(RTCx->CR, RTC_CR_ALRBIE) == (RTC_CR_ALRBIE)); |
EricLew | 0:80ee8f3b695e | 3652 | } |
EricLew | 0:80ee8f3b695e | 3653 | |
EricLew | 0:80ee8f3b695e | 3654 | /** |
EricLew | 0:80ee8f3b695e | 3655 | * @brief Check if Alarm A interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3656 | * @rmtoll CR ALRAIE LL_RTC_IsEnabledIT_ALRA |
EricLew | 0:80ee8f3b695e | 3657 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3658 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3659 | */ |
EricLew | 0:80ee8f3b695e | 3660 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_ALRA(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3661 | { |
EricLew | 0:80ee8f3b695e | 3662 | return (READ_BIT(RTCx->CR, RTC_CR_ALRAIE) == (RTC_CR_ALRAIE)); |
EricLew | 0:80ee8f3b695e | 3663 | } |
EricLew | 0:80ee8f3b695e | 3664 | |
EricLew | 0:80ee8f3b695e | 3665 | #if defined(RTC_FEATURE_TAMPER3) |
EricLew | 0:80ee8f3b695e | 3666 | /** |
EricLew | 0:80ee8f3b695e | 3667 | * @brief Check if Tamper 3 interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3668 | * @rmtoll TAMPCR TAMP3IE LL_RTC_IsEnabledIT_TAMP3 |
EricLew | 0:80ee8f3b695e | 3669 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3670 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3671 | */ |
EricLew | 0:80ee8f3b695e | 3672 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP3(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3673 | { |
EricLew | 0:80ee8f3b695e | 3674 | return (READ_BIT(RTCx->TAMPCR, |
EricLew | 0:80ee8f3b695e | 3675 | RTC_TAMPCR_TAMP3IE) == (RTC_TAMPCR_TAMP3IE)); |
EricLew | 0:80ee8f3b695e | 3676 | } |
EricLew | 0:80ee8f3b695e | 3677 | #endif /* RTC_FEATURE_TAMPER3 */ |
EricLew | 0:80ee8f3b695e | 3678 | |
EricLew | 0:80ee8f3b695e | 3679 | /** |
EricLew | 0:80ee8f3b695e | 3680 | * @brief Check if Tamper 2 interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3681 | * @rmtoll TAMPCR TAMP2IE LL_RTC_IsEnabledIT_TAMP2 |
EricLew | 0:80ee8f3b695e | 3682 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3683 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3684 | */ |
EricLew | 0:80ee8f3b695e | 3685 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP2(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3686 | { |
EricLew | 0:80ee8f3b695e | 3687 | return (READ_BIT(RTCx->TAMPCR, |
EricLew | 0:80ee8f3b695e | 3688 | RTC_TAMPCR_TAMP2IE) == (RTC_TAMPCR_TAMP2IE)); |
EricLew | 0:80ee8f3b695e | 3689 | } |
EricLew | 0:80ee8f3b695e | 3690 | |
EricLew | 0:80ee8f3b695e | 3691 | /** |
EricLew | 0:80ee8f3b695e | 3692 | * @brief Check if Tamper 1 interrupt is enabled or not |
EricLew | 0:80ee8f3b695e | 3693 | * @rmtoll TAMPCR TAMP1IE LL_RTC_IsEnabledIT_TAMP1 |
EricLew | 0:80ee8f3b695e | 3694 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3695 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3696 | */ |
EricLew | 0:80ee8f3b695e | 3697 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP1(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3698 | { |
EricLew | 0:80ee8f3b695e | 3699 | return (READ_BIT(RTCx->TAMPCR, |
EricLew | 0:80ee8f3b695e | 3700 | RTC_TAMPCR_TAMP1IE) == (RTC_TAMPCR_TAMP1IE)); |
EricLew | 0:80ee8f3b695e | 3701 | } |
EricLew | 0:80ee8f3b695e | 3702 | |
EricLew | 0:80ee8f3b695e | 3703 | /** |
EricLew | 0:80ee8f3b695e | 3704 | * @brief Check if all the TAMPER interrupts are enabled or not |
EricLew | 0:80ee8f3b695e | 3705 | * @rmtoll TAMPCR TAMPIE LL_RTC_IsEnabledIT_TAMP |
EricLew | 0:80ee8f3b695e | 3706 | * @param RTCx RTC Instance |
EricLew | 0:80ee8f3b695e | 3707 | * @retval State of bit (1 or 0). |
EricLew | 0:80ee8f3b695e | 3708 | */ |
EricLew | 0:80ee8f3b695e | 3709 | __STATIC_INLINE uint32_t LL_RTC_IsEnabledIT_TAMP(RTC_TypeDef *RTCx) |
EricLew | 0:80ee8f3b695e | 3710 | { |
EricLew | 0:80ee8f3b695e | 3711 | return (READ_BIT(RTCx->TAMPCR, |
EricLew | 0:80ee8f3b695e | 3712 | RTC_TAMPCR_TAMPIE) == (RTC_TAMPCR_TAMPIE)); |
EricLew | 0:80ee8f3b695e | 3713 | } |
EricLew | 0:80ee8f3b695e | 3714 | |
EricLew | 0:80ee8f3b695e | 3715 | /** |
EricLew | 0:80ee8f3b695e | 3716 | * @} |
EricLew | 0:80ee8f3b695e | 3717 | */ |
EricLew | 0:80ee8f3b695e | 3718 | |
EricLew | 0:80ee8f3b695e | 3719 | |
EricLew | 0:80ee8f3b695e | 3720 | /** |
EricLew | 0:80ee8f3b695e | 3721 | * @} |
EricLew | 0:80ee8f3b695e | 3722 | */ |
EricLew | 0:80ee8f3b695e | 3723 | |
EricLew | 0:80ee8f3b695e | 3724 | /** |
EricLew | 0:80ee8f3b695e | 3725 | * @} |
EricLew | 0:80ee8f3b695e | 3726 | */ |
EricLew | 0:80ee8f3b695e | 3727 | |
EricLew | 0:80ee8f3b695e | 3728 | #endif /* defined(RTC) */ |
EricLew | 0:80ee8f3b695e | 3729 | |
EricLew | 0:80ee8f3b695e | 3730 | /** |
EricLew | 0:80ee8f3b695e | 3731 | * @} |
EricLew | 0:80ee8f3b695e | 3732 | */ |
EricLew | 0:80ee8f3b695e | 3733 | |
EricLew | 0:80ee8f3b695e | 3734 | #ifdef __cplusplus |
EricLew | 0:80ee8f3b695e | 3735 | } |
EricLew | 0:80ee8f3b695e | 3736 | #endif |
EricLew | 0:80ee8f3b695e | 3737 | |
EricLew | 0:80ee8f3b695e | 3738 | #endif /* __STM32L4xx_LL_RTC_H */ |
EricLew | 0:80ee8f3b695e | 3739 | |
EricLew | 0:80ee8f3b695e | 3740 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
EricLew | 0:80ee8f3b695e | 3741 |