2 ** ###################################################################
3 ** Compilers: Keil ARM C/C++ Compiler
4 ** Freescale C/C++ for Embedded ARM
6 ** IAR ANSI C/C++ Compiler for ARM
8 ** Reference manual: K22P121M120SF7RM, Rev. 1, March 24, 2014
9 ** Version: rev. 2.5, 2014-05-06
13 ** Extension to the CMSIS register access layer header.
15 ** Copyright (c) 2014 Freescale Semiconductor, Inc.
16 ** All rights reserved.
18 ** Redistribution and use in source and binary forms, with or without modification,
19 ** are permitted provided that the following conditions are met:
21 ** o Redistributions of source code must retain the above copyright notice, this list
22 ** of conditions and the following disclaimer.
24 ** o Redistributions in binary form must reproduce the above copyright notice, this
25 ** list of conditions and the following disclaimer in the documentation and/or
26 ** other materials provided with the distribution.
28 ** o Neither the name of Freescale Semiconductor, Inc. nor the names of its
29 ** contributors may be used to endorse or promote products derived from this
30 ** software without specific prior written permission.
32 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
33 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
34 ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
36 ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
37 ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
38 ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
39 ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 ** http: www.freescale.com
44 ** mail: support@freescale.com
47 ** - rev. 1.0 (2013-07-23)
49 ** - rev. 1.1 (2013-09-17)
50 ** RM rev. 0.4 update.
51 ** - rev. 2.0 (2013-10-29)
52 ** Register accessor macros added to the memory map.
53 ** Symbols for Processor Expert memory map compatibility added to the memory map.
54 ** Startup file for gcc has been updated according to CMSIS 3.2.
55 ** System initialization updated.
56 ** - rev. 2.1 (2013-10-30)
57 ** Definition of BITBAND macros updated to support peripherals with 32-bit acces disabled.
58 ** - rev. 2.2 (2013-12-20)
59 ** Update according to reference manual rev. 0.6,
60 ** - rev. 2.3 (2014-01-13)
61 ** Update according to reference manual rev. 0.61,
62 ** - rev. 2.4 (2014-02-10)
63 ** The declaration of clock configurations has been moved to separate header file system_MK22F51212.h
64 ** - rev. 2.5 (2014-05-06)
65 ** Update according to reference manual rev. 1.0,
66 ** Update of system and startup files.
67 ** Module access macro module_BASES replaced by module_BASE_PTRS.
69 ** ###################################################################
73 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
75 * This file was generated automatically and any changes may be lost.
77 #ifndef __HW_RTC_REGISTERS_H__
78 #define __HW_RTC_REGISTERS_H__
80 #include "MK22F51212.h"
81 #include "fsl_bitaccess.h"
86 * Secure Real Time Clock
88 * Registers defined in this header file:
89 * - HW_RTC_TSR - RTC Time Seconds Register
90 * - HW_RTC_TPR - RTC Time Prescaler Register
91 * - HW_RTC_TAR - RTC Time Alarm Register
92 * - HW_RTC_TCR - RTC Time Compensation Register
93 * - HW_RTC_CR - RTC Control Register
94 * - HW_RTC_SR - RTC Status Register
95 * - HW_RTC_LR - RTC Lock Register
96 * - HW_RTC_IER - RTC Interrupt Enable Register
97 * - HW_RTC_WAR - RTC Write Access Register
98 * - HW_RTC_RAR - RTC Read Access Register
100 * - hw_rtc_t - Struct containing all module registers.
103 #define HW_RTC_INSTANCE_COUNT (1U) /*!< Number of instances of the RTC module. */
105 /*******************************************************************************
106 * HW_RTC_TSR - RTC Time Seconds Register
107 ******************************************************************************/
110 * @brief HW_RTC_TSR - RTC Time Seconds Register (RW)
112 * Reset value: 0x00000000U
114 typedef union _hw_rtc_tsr
117 struct _hw_rtc_tsr_bitfields
119 uint32_t TSR : 32; /*!< [31:0] Time Seconds Register */
124 * @name Constants and macros for entire RTC_TSR register
127 #define HW_RTC_TSR_ADDR(x) ((x) + 0x0U)
129 #define HW_RTC_TSR(x) (*(__IO hw_rtc_tsr_t *) HW_RTC_TSR_ADDR(x))
130 #define HW_RTC_TSR_RD(x) (HW_RTC_TSR(x).U)
131 #define HW_RTC_TSR_WR(x, v) (HW_RTC_TSR(x).U = (v))
132 #define HW_RTC_TSR_SET(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) | (v)))
133 #define HW_RTC_TSR_CLR(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) & ~(v)))
134 #define HW_RTC_TSR_TOG(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) ^ (v)))
138 * Constants & macros for individual RTC_TSR bitfields
142 * @name Register RTC_TSR, field TSR[31:0] (RW)
144 * When the time counter is enabled, the TSR is read only and increments once a
145 * second provided SR[TOF] or SR[TIF] are not set. The time counter will read as
146 * zero when SR[TOF] or SR[TIF] are set. When the time counter is disabled, the
147 * TSR can be read or written. Writing to the TSR when the time counter is
148 * disabled will clear the SR[TOF] and/or the SR[TIF]. Writing to TSR with zero is
149 * supported, but not recommended because TSR will read as zero when SR[TIF] or
150 * SR[TOF] are set (indicating the time is invalid).
153 #define BP_RTC_TSR_TSR (0U) /*!< Bit position for RTC_TSR_TSR. */
154 #define BM_RTC_TSR_TSR (0xFFFFFFFFU) /*!< Bit mask for RTC_TSR_TSR. */
155 #define BS_RTC_TSR_TSR (32U) /*!< Bit field size in bits for RTC_TSR_TSR. */
157 /*! @brief Read current value of the RTC_TSR_TSR field. */
158 #define BR_RTC_TSR_TSR(x) (HW_RTC_TSR(x).U)
160 /*! @brief Format value for bitfield RTC_TSR_TSR. */
161 #define BF_RTC_TSR_TSR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TSR_TSR) & BM_RTC_TSR_TSR)
163 /*! @brief Set the TSR field to a new value. */
164 #define BW_RTC_TSR_TSR(x, v) (HW_RTC_TSR_WR(x, v))
167 /*******************************************************************************
168 * HW_RTC_TPR - RTC Time Prescaler Register
169 ******************************************************************************/
172 * @brief HW_RTC_TPR - RTC Time Prescaler Register (RW)
174 * Reset value: 0x00000000U
176 typedef union _hw_rtc_tpr
179 struct _hw_rtc_tpr_bitfields
181 uint32_t TPR : 16; /*!< [15:0] Time Prescaler Register */
182 uint32_t RESERVED0 : 16; /*!< [31:16] */
187 * @name Constants and macros for entire RTC_TPR register
190 #define HW_RTC_TPR_ADDR(x) ((x) + 0x4U)
192 #define HW_RTC_TPR(x) (*(__IO hw_rtc_tpr_t *) HW_RTC_TPR_ADDR(x))
193 #define HW_RTC_TPR_RD(x) (HW_RTC_TPR(x).U)
194 #define HW_RTC_TPR_WR(x, v) (HW_RTC_TPR(x).U = (v))
195 #define HW_RTC_TPR_SET(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) | (v)))
196 #define HW_RTC_TPR_CLR(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) & ~(v)))
197 #define HW_RTC_TPR_TOG(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) ^ (v)))
201 * Constants & macros for individual RTC_TPR bitfields
205 * @name Register RTC_TPR, field TPR[15:0] (RW)
207 * When the time counter is enabled, the TPR is read only and increments every
208 * 32.768 kHz clock cycle. The time counter will read as zero when SR[TOF] or
209 * SR[TIF] are set. When the time counter is disabled, the TPR can be read or
210 * written. The TSR[TSR] increments when bit 14 of the TPR transitions from a logic one
214 #define BP_RTC_TPR_TPR (0U) /*!< Bit position for RTC_TPR_TPR. */
215 #define BM_RTC_TPR_TPR (0x0000FFFFU) /*!< Bit mask for RTC_TPR_TPR. */
216 #define BS_RTC_TPR_TPR (16U) /*!< Bit field size in bits for RTC_TPR_TPR. */
218 /*! @brief Read current value of the RTC_TPR_TPR field. */
219 #define BR_RTC_TPR_TPR(x) (HW_RTC_TPR(x).B.TPR)
221 /*! @brief Format value for bitfield RTC_TPR_TPR. */
222 #define BF_RTC_TPR_TPR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TPR_TPR) & BM_RTC_TPR_TPR)
224 /*! @brief Set the TPR field to a new value. */
225 #define BW_RTC_TPR_TPR(x, v) (HW_RTC_TPR_WR(x, (HW_RTC_TPR_RD(x) & ~BM_RTC_TPR_TPR) | BF_RTC_TPR_TPR(v)))
228 /*******************************************************************************
229 * HW_RTC_TAR - RTC Time Alarm Register
230 ******************************************************************************/
233 * @brief HW_RTC_TAR - RTC Time Alarm Register (RW)
235 * Reset value: 0x00000000U
237 typedef union _hw_rtc_tar
240 struct _hw_rtc_tar_bitfields
242 uint32_t TAR : 32; /*!< [31:0] Time Alarm Register */
247 * @name Constants and macros for entire RTC_TAR register
250 #define HW_RTC_TAR_ADDR(x) ((x) + 0x8U)
252 #define HW_RTC_TAR(x) (*(__IO hw_rtc_tar_t *) HW_RTC_TAR_ADDR(x))
253 #define HW_RTC_TAR_RD(x) (HW_RTC_TAR(x).U)
254 #define HW_RTC_TAR_WR(x, v) (HW_RTC_TAR(x).U = (v))
255 #define HW_RTC_TAR_SET(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) | (v)))
256 #define HW_RTC_TAR_CLR(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) & ~(v)))
257 #define HW_RTC_TAR_TOG(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) ^ (v)))
261 * Constants & macros for individual RTC_TAR bitfields
265 * @name Register RTC_TAR, field TAR[31:0] (RW)
267 * When the time counter is enabled, the SR[TAF] is set whenever the TAR[TAR]
268 * equals the TSR[TSR] and the TSR[TSR] increments. Writing to the TAR clears the
272 #define BP_RTC_TAR_TAR (0U) /*!< Bit position for RTC_TAR_TAR. */
273 #define BM_RTC_TAR_TAR (0xFFFFFFFFU) /*!< Bit mask for RTC_TAR_TAR. */
274 #define BS_RTC_TAR_TAR (32U) /*!< Bit field size in bits for RTC_TAR_TAR. */
276 /*! @brief Read current value of the RTC_TAR_TAR field. */
277 #define BR_RTC_TAR_TAR(x) (HW_RTC_TAR(x).U)
279 /*! @brief Format value for bitfield RTC_TAR_TAR. */
280 #define BF_RTC_TAR_TAR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TAR_TAR) & BM_RTC_TAR_TAR)
282 /*! @brief Set the TAR field to a new value. */
283 #define BW_RTC_TAR_TAR(x, v) (HW_RTC_TAR_WR(x, v))
286 /*******************************************************************************
287 * HW_RTC_TCR - RTC Time Compensation Register
288 ******************************************************************************/
291 * @brief HW_RTC_TCR - RTC Time Compensation Register (RW)
293 * Reset value: 0x00000000U
295 typedef union _hw_rtc_tcr
298 struct _hw_rtc_tcr_bitfields
300 uint32_t TCR : 8; /*!< [7:0] Time Compensation Register */
301 uint32_t CIR : 8; /*!< [15:8] Compensation Interval Register */
302 uint32_t TCV : 8; /*!< [23:16] Time Compensation Value */
303 uint32_t CIC : 8; /*!< [31:24] Compensation Interval Counter */
308 * @name Constants and macros for entire RTC_TCR register
311 #define HW_RTC_TCR_ADDR(x) ((x) + 0xCU)
313 #define HW_RTC_TCR(x) (*(__IO hw_rtc_tcr_t *) HW_RTC_TCR_ADDR(x))
314 #define HW_RTC_TCR_RD(x) (HW_RTC_TCR(x).U)
315 #define HW_RTC_TCR_WR(x, v) (HW_RTC_TCR(x).U = (v))
316 #define HW_RTC_TCR_SET(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) | (v)))
317 #define HW_RTC_TCR_CLR(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) & ~(v)))
318 #define HW_RTC_TCR_TOG(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) ^ (v)))
322 * Constants & macros for individual RTC_TCR bitfields
326 * @name Register RTC_TCR, field TCR[7:0] (RW)
328 * Configures the number of 32.768 kHz clock cycles in each second. This
329 * register is double buffered and writes do not take affect until the end of the
330 * current compensation interval.
333 * - 10000000 - Time Prescaler Register overflows every 32896 clock cycles.
334 * - 11111111 - Time Prescaler Register overflows every 32769 clock cycles.
335 * - 0 - Time Prescaler Register overflows every 32768 clock cycles.
336 * - 1 - Time Prescaler Register overflows every 32767 clock cycles.
337 * - 1111111 - Time Prescaler Register overflows every 32641 clock cycles.
340 #define BP_RTC_TCR_TCR (0U) /*!< Bit position for RTC_TCR_TCR. */
341 #define BM_RTC_TCR_TCR (0x000000FFU) /*!< Bit mask for RTC_TCR_TCR. */
342 #define BS_RTC_TCR_TCR (8U) /*!< Bit field size in bits for RTC_TCR_TCR. */
344 /*! @brief Read current value of the RTC_TCR_TCR field. */
345 #define BR_RTC_TCR_TCR(x) (HW_RTC_TCR(x).B.TCR)
347 /*! @brief Format value for bitfield RTC_TCR_TCR. */
348 #define BF_RTC_TCR_TCR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TCR_TCR) & BM_RTC_TCR_TCR)
350 /*! @brief Set the TCR field to a new value. */
351 #define BW_RTC_TCR_TCR(x, v) (HW_RTC_TCR_WR(x, (HW_RTC_TCR_RD(x) & ~BM_RTC_TCR_TCR) | BF_RTC_TCR_TCR(v)))
355 * @name Register RTC_TCR, field CIR[15:8] (RW)
357 * Configures the compensation interval in seconds from 1 to 256 to control how
358 * frequently the TCR should adjust the number of 32.768 kHz cycles in each
359 * second. The value written should be one less than the number of seconds. For
360 * example, write zero to configure for a compensation interval of one second. This
361 * register is double buffered and writes do not take affect until the end of the
362 * current compensation interval.
365 #define BP_RTC_TCR_CIR (8U) /*!< Bit position for RTC_TCR_CIR. */
366 #define BM_RTC_TCR_CIR (0x0000FF00U) /*!< Bit mask for RTC_TCR_CIR. */
367 #define BS_RTC_TCR_CIR (8U) /*!< Bit field size in bits for RTC_TCR_CIR. */
369 /*! @brief Read current value of the RTC_TCR_CIR field. */
370 #define BR_RTC_TCR_CIR(x) (HW_RTC_TCR(x).B.CIR)
372 /*! @brief Format value for bitfield RTC_TCR_CIR. */
373 #define BF_RTC_TCR_CIR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TCR_CIR) & BM_RTC_TCR_CIR)
375 /*! @brief Set the CIR field to a new value. */
376 #define BW_RTC_TCR_CIR(x, v) (HW_RTC_TCR_WR(x, (HW_RTC_TCR_RD(x) & ~BM_RTC_TCR_CIR) | BF_RTC_TCR_CIR(v)))
380 * @name Register RTC_TCR, field TCV[23:16] (RO)
382 * Current value used by the compensation logic for the present second interval.
383 * Updated once a second if the CIC equals 0 with the contents of the TCR field.
384 * If the CIC does not equal zero then it is loaded with zero (compensation is
385 * not enabled for that second increment).
388 #define BP_RTC_TCR_TCV (16U) /*!< Bit position for RTC_TCR_TCV. */
389 #define BM_RTC_TCR_TCV (0x00FF0000U) /*!< Bit mask for RTC_TCR_TCV. */
390 #define BS_RTC_TCR_TCV (8U) /*!< Bit field size in bits for RTC_TCR_TCV. */
392 /*! @brief Read current value of the RTC_TCR_TCV field. */
393 #define BR_RTC_TCR_TCV(x) (HW_RTC_TCR(x).B.TCV)
397 * @name Register RTC_TCR, field CIC[31:24] (RO)
399 * Current value of the compensation interval counter. If the compensation
400 * interval counter equals zero then it is loaded with the contents of the CIR. If the
401 * CIC does not equal zero then it is decremented once a second.
404 #define BP_RTC_TCR_CIC (24U) /*!< Bit position for RTC_TCR_CIC. */
405 #define BM_RTC_TCR_CIC (0xFF000000U) /*!< Bit mask for RTC_TCR_CIC. */
406 #define BS_RTC_TCR_CIC (8U) /*!< Bit field size in bits for RTC_TCR_CIC. */
408 /*! @brief Read current value of the RTC_TCR_CIC field. */
409 #define BR_RTC_TCR_CIC(x) (HW_RTC_TCR(x).B.CIC)
412 /*******************************************************************************
413 * HW_RTC_CR - RTC Control Register
414 ******************************************************************************/
417 * @brief HW_RTC_CR - RTC Control Register (RW)
419 * Reset value: 0x00000000U
421 typedef union _hw_rtc_cr
424 struct _hw_rtc_cr_bitfields
426 uint32_t SWR : 1; /*!< [0] Software Reset */
427 uint32_t WPE : 1; /*!< [1] Wakeup Pin Enable */
428 uint32_t SUP : 1; /*!< [2] Supervisor Access */
429 uint32_t UM : 1; /*!< [3] Update Mode */
430 uint32_t WPS : 1; /*!< [4] Wakeup Pin Select */
431 uint32_t RESERVED0 : 3; /*!< [7:5] */
432 uint32_t OSCE : 1; /*!< [8] Oscillator Enable */
433 uint32_t CLKO : 1; /*!< [9] Clock Output */
434 uint32_t SC16P : 1; /*!< [10] Oscillator 16pF Load Configure */
435 uint32_t SC8P : 1; /*!< [11] Oscillator 8pF Load Configure */
436 uint32_t SC4P : 1; /*!< [12] Oscillator 4pF Load Configure */
437 uint32_t SC2P : 1; /*!< [13] Oscillator 2pF Load Configure */
438 uint32_t RESERVED1 : 18; /*!< [31:14] */
443 * @name Constants and macros for entire RTC_CR register
446 #define HW_RTC_CR_ADDR(x) ((x) + 0x10U)
448 #define HW_RTC_CR(x) (*(__IO hw_rtc_cr_t *) HW_RTC_CR_ADDR(x))
449 #define HW_RTC_CR_RD(x) (HW_RTC_CR(x).U)
450 #define HW_RTC_CR_WR(x, v) (HW_RTC_CR(x).U = (v))
451 #define HW_RTC_CR_SET(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) | (v)))
452 #define HW_RTC_CR_CLR(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) & ~(v)))
453 #define HW_RTC_CR_TOG(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) ^ (v)))
457 * Constants & macros for individual RTC_CR bitfields
461 * @name Register RTC_CR, field SWR[0] (RW)
465 * - 1 - Resets all RTC registers except for the SWR bit and the RTC_WAR and
466 * RTC_RAR registers . The SWR bit is cleared by VBAT POR and by software
467 * explicitly clearing it.
470 #define BP_RTC_CR_SWR (0U) /*!< Bit position for RTC_CR_SWR. */
471 #define BM_RTC_CR_SWR (0x00000001U) /*!< Bit mask for RTC_CR_SWR. */
472 #define BS_RTC_CR_SWR (1U) /*!< Bit field size in bits for RTC_CR_SWR. */
474 /*! @brief Read current value of the RTC_CR_SWR field. */
475 #define BR_RTC_CR_SWR(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SWR))
477 /*! @brief Format value for bitfield RTC_CR_SWR. */
478 #define BF_RTC_CR_SWR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SWR) & BM_RTC_CR_SWR)
480 /*! @brief Set the SWR field to a new value. */
481 #define BW_RTC_CR_SWR(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SWR) = (v))
485 * @name Register RTC_CR, field WPE[1] (RW)
487 * The wakeup pin is optional and not available on all devices.
490 * - 0 - Wakeup pin is disabled.
491 * - 1 - Wakeup pin is enabled and wakeup pin asserts if the RTC interrupt
492 * asserts or the wakeup pin is turned on.
495 #define BP_RTC_CR_WPE (1U) /*!< Bit position for RTC_CR_WPE. */
496 #define BM_RTC_CR_WPE (0x00000002U) /*!< Bit mask for RTC_CR_WPE. */
497 #define BS_RTC_CR_WPE (1U) /*!< Bit field size in bits for RTC_CR_WPE. */
499 /*! @brief Read current value of the RTC_CR_WPE field. */
500 #define BR_RTC_CR_WPE(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPE))
502 /*! @brief Format value for bitfield RTC_CR_WPE. */
503 #define BF_RTC_CR_WPE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_WPE) & BM_RTC_CR_WPE)
505 /*! @brief Set the WPE field to a new value. */
506 #define BW_RTC_CR_WPE(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPE) = (v))
510 * @name Register RTC_CR, field SUP[2] (RW)
513 * - 0 - Non-supervisor mode write accesses are not supported and generate a bus
515 * - 1 - Non-supervisor mode write accesses are supported.
518 #define BP_RTC_CR_SUP (2U) /*!< Bit position for RTC_CR_SUP. */
519 #define BM_RTC_CR_SUP (0x00000004U) /*!< Bit mask for RTC_CR_SUP. */
520 #define BS_RTC_CR_SUP (1U) /*!< Bit field size in bits for RTC_CR_SUP. */
522 /*! @brief Read current value of the RTC_CR_SUP field. */
523 #define BR_RTC_CR_SUP(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SUP))
525 /*! @brief Format value for bitfield RTC_CR_SUP. */
526 #define BF_RTC_CR_SUP(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SUP) & BM_RTC_CR_SUP)
528 /*! @brief Set the SUP field to a new value. */
529 #define BW_RTC_CR_SUP(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SUP) = (v))
533 * @name Register RTC_CR, field UM[3] (RW)
535 * Allows SR[TCE] to be written even when the Status Register is locked. When
536 * set, the SR[TCE] can always be written if the SR[TIF] or SR[TOF] are set or if
537 * the SR[TCE] is clear.
540 * - 0 - Registers cannot be written when locked.
541 * - 1 - Registers can be written when locked under limited conditions.
544 #define BP_RTC_CR_UM (3U) /*!< Bit position for RTC_CR_UM. */
545 #define BM_RTC_CR_UM (0x00000008U) /*!< Bit mask for RTC_CR_UM. */
546 #define BS_RTC_CR_UM (1U) /*!< Bit field size in bits for RTC_CR_UM. */
548 /*! @brief Read current value of the RTC_CR_UM field. */
549 #define BR_RTC_CR_UM(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_UM))
551 /*! @brief Format value for bitfield RTC_CR_UM. */
552 #define BF_RTC_CR_UM(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_UM) & BM_RTC_CR_UM)
554 /*! @brief Set the UM field to a new value. */
555 #define BW_RTC_CR_UM(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_UM) = (v))
559 * @name Register RTC_CR, field WPS[4] (RW)
561 * The wakeup pin is optional and not available on all devices.
564 * - 0 - Wakeup pin asserts (active low, open drain) if the RTC interrupt
565 * asserts or the wakeup pin is turned on.
566 * - 1 - Wakeup pin instead outputs the RTC 32kHz clock, provided the wakeup pin
567 * is turned on and the 32kHz clock is output to other peripherals.
570 #define BP_RTC_CR_WPS (4U) /*!< Bit position for RTC_CR_WPS. */
571 #define BM_RTC_CR_WPS (0x00000010U) /*!< Bit mask for RTC_CR_WPS. */
572 #define BS_RTC_CR_WPS (1U) /*!< Bit field size in bits for RTC_CR_WPS. */
574 /*! @brief Read current value of the RTC_CR_WPS field. */
575 #define BR_RTC_CR_WPS(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPS))
577 /*! @brief Format value for bitfield RTC_CR_WPS. */
578 #define BF_RTC_CR_WPS(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_WPS) & BM_RTC_CR_WPS)
580 /*! @brief Set the WPS field to a new value. */
581 #define BW_RTC_CR_WPS(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPS) = (v))
585 * @name Register RTC_CR, field OSCE[8] (RW)
588 * - 0 - 32.768 kHz oscillator is disabled.
589 * - 1 - 32.768 kHz oscillator is enabled. After setting this bit, wait the
590 * oscillator startup time before enabling the time counter to allow the 32.768
591 * kHz clock time to stabilize.
594 #define BP_RTC_CR_OSCE (8U) /*!< Bit position for RTC_CR_OSCE. */
595 #define BM_RTC_CR_OSCE (0x00000100U) /*!< Bit mask for RTC_CR_OSCE. */
596 #define BS_RTC_CR_OSCE (1U) /*!< Bit field size in bits for RTC_CR_OSCE. */
598 /*! @brief Read current value of the RTC_CR_OSCE field. */
599 #define BR_RTC_CR_OSCE(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_OSCE))
601 /*! @brief Format value for bitfield RTC_CR_OSCE. */
602 #define BF_RTC_CR_OSCE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_OSCE) & BM_RTC_CR_OSCE)
604 /*! @brief Set the OSCE field to a new value. */
605 #define BW_RTC_CR_OSCE(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_OSCE) = (v))
609 * @name Register RTC_CR, field CLKO[9] (RW)
612 * - 0 - The 32 kHz clock is output to other peripherals.
613 * - 1 - The 32 kHz clock is not output to other peripherals.
616 #define BP_RTC_CR_CLKO (9U) /*!< Bit position for RTC_CR_CLKO. */
617 #define BM_RTC_CR_CLKO (0x00000200U) /*!< Bit mask for RTC_CR_CLKO. */
618 #define BS_RTC_CR_CLKO (1U) /*!< Bit field size in bits for RTC_CR_CLKO. */
620 /*! @brief Read current value of the RTC_CR_CLKO field. */
621 #define BR_RTC_CR_CLKO(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_CLKO))
623 /*! @brief Format value for bitfield RTC_CR_CLKO. */
624 #define BF_RTC_CR_CLKO(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_CLKO) & BM_RTC_CR_CLKO)
626 /*! @brief Set the CLKO field to a new value. */
627 #define BW_RTC_CR_CLKO(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_CLKO) = (v))
631 * @name Register RTC_CR, field SC16P[10] (RW)
634 * - 0 - Disable the load.
635 * - 1 - Enable the additional load.
638 #define BP_RTC_CR_SC16P (10U) /*!< Bit position for RTC_CR_SC16P. */
639 #define BM_RTC_CR_SC16P (0x00000400U) /*!< Bit mask for RTC_CR_SC16P. */
640 #define BS_RTC_CR_SC16P (1U) /*!< Bit field size in bits for RTC_CR_SC16P. */
642 /*! @brief Read current value of the RTC_CR_SC16P field. */
643 #define BR_RTC_CR_SC16P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC16P))
645 /*! @brief Format value for bitfield RTC_CR_SC16P. */
646 #define BF_RTC_CR_SC16P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC16P) & BM_RTC_CR_SC16P)
648 /*! @brief Set the SC16P field to a new value. */
649 #define BW_RTC_CR_SC16P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC16P) = (v))
653 * @name Register RTC_CR, field SC8P[11] (RW)
656 * - 0 - Disable the load.
657 * - 1 - Enable the additional load.
660 #define BP_RTC_CR_SC8P (11U) /*!< Bit position for RTC_CR_SC8P. */
661 #define BM_RTC_CR_SC8P (0x00000800U) /*!< Bit mask for RTC_CR_SC8P. */
662 #define BS_RTC_CR_SC8P (1U) /*!< Bit field size in bits for RTC_CR_SC8P. */
664 /*! @brief Read current value of the RTC_CR_SC8P field. */
665 #define BR_RTC_CR_SC8P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC8P))
667 /*! @brief Format value for bitfield RTC_CR_SC8P. */
668 #define BF_RTC_CR_SC8P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC8P) & BM_RTC_CR_SC8P)
670 /*! @brief Set the SC8P field to a new value. */
671 #define BW_RTC_CR_SC8P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC8P) = (v))
675 * @name Register RTC_CR, field SC4P[12] (RW)
678 * - 0 - Disable the load.
679 * - 1 - Enable the additional load.
682 #define BP_RTC_CR_SC4P (12U) /*!< Bit position for RTC_CR_SC4P. */
683 #define BM_RTC_CR_SC4P (0x00001000U) /*!< Bit mask for RTC_CR_SC4P. */
684 #define BS_RTC_CR_SC4P (1U) /*!< Bit field size in bits for RTC_CR_SC4P. */
686 /*! @brief Read current value of the RTC_CR_SC4P field. */
687 #define BR_RTC_CR_SC4P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC4P))
689 /*! @brief Format value for bitfield RTC_CR_SC4P. */
690 #define BF_RTC_CR_SC4P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC4P) & BM_RTC_CR_SC4P)
692 /*! @brief Set the SC4P field to a new value. */
693 #define BW_RTC_CR_SC4P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC4P) = (v))
697 * @name Register RTC_CR, field SC2P[13] (RW)
700 * - 0 - Disable the load.
701 * - 1 - Enable the additional load.
704 #define BP_RTC_CR_SC2P (13U) /*!< Bit position for RTC_CR_SC2P. */
705 #define BM_RTC_CR_SC2P (0x00002000U) /*!< Bit mask for RTC_CR_SC2P. */
706 #define BS_RTC_CR_SC2P (1U) /*!< Bit field size in bits for RTC_CR_SC2P. */
708 /*! @brief Read current value of the RTC_CR_SC2P field. */
709 #define BR_RTC_CR_SC2P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC2P))
711 /*! @brief Format value for bitfield RTC_CR_SC2P. */
712 #define BF_RTC_CR_SC2P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC2P) & BM_RTC_CR_SC2P)
714 /*! @brief Set the SC2P field to a new value. */
715 #define BW_RTC_CR_SC2P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC2P) = (v))
718 /*******************************************************************************
719 * HW_RTC_SR - RTC Status Register
720 ******************************************************************************/
723 * @brief HW_RTC_SR - RTC Status Register (RW)
725 * Reset value: 0x00000001U
727 typedef union _hw_rtc_sr
730 struct _hw_rtc_sr_bitfields
732 uint32_t TIF : 1; /*!< [0] Time Invalid Flag */
733 uint32_t TOF : 1; /*!< [1] Time Overflow Flag */
734 uint32_t TAF : 1; /*!< [2] Time Alarm Flag */
735 uint32_t RESERVED0 : 1; /*!< [3] */
736 uint32_t TCE : 1; /*!< [4] Time Counter Enable */
737 uint32_t RESERVED1 : 27; /*!< [31:5] */
742 * @name Constants and macros for entire RTC_SR register
745 #define HW_RTC_SR_ADDR(x) ((x) + 0x14U)
747 #define HW_RTC_SR(x) (*(__IO hw_rtc_sr_t *) HW_RTC_SR_ADDR(x))
748 #define HW_RTC_SR_RD(x) (HW_RTC_SR(x).U)
749 #define HW_RTC_SR_WR(x, v) (HW_RTC_SR(x).U = (v))
750 #define HW_RTC_SR_SET(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) | (v)))
751 #define HW_RTC_SR_CLR(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) & ~(v)))
752 #define HW_RTC_SR_TOG(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) ^ (v)))
756 * Constants & macros for individual RTC_SR bitfields
760 * @name Register RTC_SR, field TIF[0] (RO)
762 * The time invalid flag is set on VBAT POR or software reset. The TSR and TPR
763 * do not increment and read as zero when this bit is set. This bit is cleared by
764 * writing the TSR register when the time counter is disabled.
767 * - 0 - Time is valid.
768 * - 1 - Time is invalid and time counter is read as zero.
771 #define BP_RTC_SR_TIF (0U) /*!< Bit position for RTC_SR_TIF. */
772 #define BM_RTC_SR_TIF (0x00000001U) /*!< Bit mask for RTC_SR_TIF. */
773 #define BS_RTC_SR_TIF (1U) /*!< Bit field size in bits for RTC_SR_TIF. */
775 /*! @brief Read current value of the RTC_SR_TIF field. */
776 #define BR_RTC_SR_TIF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TIF))
780 * @name Register RTC_SR, field TOF[1] (RO)
782 * Time overflow flag is set when the time counter is enabled and overflows. The
783 * TSR and TPR do not increment and read as zero when this bit is set. This bit
784 * is cleared by writing the TSR register when the time counter is disabled.
787 * - 0 - Time overflow has not occurred.
788 * - 1 - Time overflow has occurred and time counter is read as zero.
791 #define BP_RTC_SR_TOF (1U) /*!< Bit position for RTC_SR_TOF. */
792 #define BM_RTC_SR_TOF (0x00000002U) /*!< Bit mask for RTC_SR_TOF. */
793 #define BS_RTC_SR_TOF (1U) /*!< Bit field size in bits for RTC_SR_TOF. */
795 /*! @brief Read current value of the RTC_SR_TOF field. */
796 #define BR_RTC_SR_TOF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TOF))
800 * @name Register RTC_SR, field TAF[2] (RO)
802 * Time alarm flag is set when the TAR[TAR] equals the TSR[TSR] and the TSR[TSR]
803 * increments. This bit is cleared by writing the TAR register.
806 * - 0 - Time alarm has not occurred.
807 * - 1 - Time alarm has occurred.
810 #define BP_RTC_SR_TAF (2U) /*!< Bit position for RTC_SR_TAF. */
811 #define BM_RTC_SR_TAF (0x00000004U) /*!< Bit mask for RTC_SR_TAF. */
812 #define BS_RTC_SR_TAF (1U) /*!< Bit field size in bits for RTC_SR_TAF. */
814 /*! @brief Read current value of the RTC_SR_TAF field. */
815 #define BR_RTC_SR_TAF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TAF))
819 * @name Register RTC_SR, field TCE[4] (RW)
821 * When time counter is disabled the TSR register and TPR register are
822 * writeable, but do not increment. When time counter is enabled the TSR register and TPR
823 * register are not writeable, but increment.
826 * - 0 - Time counter is disabled.
827 * - 1 - Time counter is enabled.
830 #define BP_RTC_SR_TCE (4U) /*!< Bit position for RTC_SR_TCE. */
831 #define BM_RTC_SR_TCE (0x00000010U) /*!< Bit mask for RTC_SR_TCE. */
832 #define BS_RTC_SR_TCE (1U) /*!< Bit field size in bits for RTC_SR_TCE. */
834 /*! @brief Read current value of the RTC_SR_TCE field. */
835 #define BR_RTC_SR_TCE(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TCE))
837 /*! @brief Format value for bitfield RTC_SR_TCE. */
838 #define BF_RTC_SR_TCE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_SR_TCE) & BM_RTC_SR_TCE)
840 /*! @brief Set the TCE field to a new value. */
841 #define BW_RTC_SR_TCE(x, v) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TCE) = (v))
844 /*******************************************************************************
845 * HW_RTC_LR - RTC Lock Register
846 ******************************************************************************/
849 * @brief HW_RTC_LR - RTC Lock Register (RW)
851 * Reset value: 0x000000FFU
853 typedef union _hw_rtc_lr
856 struct _hw_rtc_lr_bitfields
858 uint32_t RESERVED0 : 3; /*!< [2:0] */
859 uint32_t TCL : 1; /*!< [3] Time Compensation Lock */
860 uint32_t CRL : 1; /*!< [4] Control Register Lock */
861 uint32_t SRL : 1; /*!< [5] Status Register Lock */
862 uint32_t LRL : 1; /*!< [6] Lock Register Lock */
863 uint32_t RESERVED1 : 25; /*!< [31:7] */
868 * @name Constants and macros for entire RTC_LR register
871 #define HW_RTC_LR_ADDR(x) ((x) + 0x18U)
873 #define HW_RTC_LR(x) (*(__IO hw_rtc_lr_t *) HW_RTC_LR_ADDR(x))
874 #define HW_RTC_LR_RD(x) (HW_RTC_LR(x).U)
875 #define HW_RTC_LR_WR(x, v) (HW_RTC_LR(x).U = (v))
876 #define HW_RTC_LR_SET(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) | (v)))
877 #define HW_RTC_LR_CLR(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) & ~(v)))
878 #define HW_RTC_LR_TOG(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) ^ (v)))
882 * Constants & macros for individual RTC_LR bitfields
886 * @name Register RTC_LR, field TCL[3] (RW)
888 * After being cleared, this bit can be set only by VBAT POR or software reset.
891 * - 0 - Time Compensation Register is locked and writes are ignored.
892 * - 1 - Time Compensation Register is not locked and writes complete as normal.
895 #define BP_RTC_LR_TCL (3U) /*!< Bit position for RTC_LR_TCL. */
896 #define BM_RTC_LR_TCL (0x00000008U) /*!< Bit mask for RTC_LR_TCL. */
897 #define BS_RTC_LR_TCL (1U) /*!< Bit field size in bits for RTC_LR_TCL. */
899 /*! @brief Read current value of the RTC_LR_TCL field. */
900 #define BR_RTC_LR_TCL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_TCL))
902 /*! @brief Format value for bitfield RTC_LR_TCL. */
903 #define BF_RTC_LR_TCL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_TCL) & BM_RTC_LR_TCL)
905 /*! @brief Set the TCL field to a new value. */
906 #define BW_RTC_LR_TCL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_TCL) = (v))
910 * @name Register RTC_LR, field CRL[4] (RW)
912 * After being cleared, this bit can only be set by VBAT POR.
915 * - 0 - Control Register is locked and writes are ignored.
916 * - 1 - Control Register is not locked and writes complete as normal.
919 #define BP_RTC_LR_CRL (4U) /*!< Bit position for RTC_LR_CRL. */
920 #define BM_RTC_LR_CRL (0x00000010U) /*!< Bit mask for RTC_LR_CRL. */
921 #define BS_RTC_LR_CRL (1U) /*!< Bit field size in bits for RTC_LR_CRL. */
923 /*! @brief Read current value of the RTC_LR_CRL field. */
924 #define BR_RTC_LR_CRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_CRL))
926 /*! @brief Format value for bitfield RTC_LR_CRL. */
927 #define BF_RTC_LR_CRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_CRL) & BM_RTC_LR_CRL)
929 /*! @brief Set the CRL field to a new value. */
930 #define BW_RTC_LR_CRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_CRL) = (v))
934 * @name Register RTC_LR, field SRL[5] (RW)
936 * After being cleared, this bit can be set only by VBAT POR or software reset.
939 * - 0 - Status Register is locked and writes are ignored.
940 * - 1 - Status Register is not locked and writes complete as normal.
943 #define BP_RTC_LR_SRL (5U) /*!< Bit position for RTC_LR_SRL. */
944 #define BM_RTC_LR_SRL (0x00000020U) /*!< Bit mask for RTC_LR_SRL. */
945 #define BS_RTC_LR_SRL (1U) /*!< Bit field size in bits for RTC_LR_SRL. */
947 /*! @brief Read current value of the RTC_LR_SRL field. */
948 #define BR_RTC_LR_SRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_SRL))
950 /*! @brief Format value for bitfield RTC_LR_SRL. */
951 #define BF_RTC_LR_SRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_SRL) & BM_RTC_LR_SRL)
953 /*! @brief Set the SRL field to a new value. */
954 #define BW_RTC_LR_SRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_SRL) = (v))
958 * @name Register RTC_LR, field LRL[6] (RW)
960 * After being cleared, this bit can be set only by VBAT POR or software reset.
963 * - 0 - Lock Register is locked and writes are ignored.
964 * - 1 - Lock Register is not locked and writes complete as normal.
967 #define BP_RTC_LR_LRL (6U) /*!< Bit position for RTC_LR_LRL. */
968 #define BM_RTC_LR_LRL (0x00000040U) /*!< Bit mask for RTC_LR_LRL. */
969 #define BS_RTC_LR_LRL (1U) /*!< Bit field size in bits for RTC_LR_LRL. */
971 /*! @brief Read current value of the RTC_LR_LRL field. */
972 #define BR_RTC_LR_LRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_LRL))
974 /*! @brief Format value for bitfield RTC_LR_LRL. */
975 #define BF_RTC_LR_LRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_LRL) & BM_RTC_LR_LRL)
977 /*! @brief Set the LRL field to a new value. */
978 #define BW_RTC_LR_LRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_LRL) = (v))
981 /*******************************************************************************
982 * HW_RTC_IER - RTC Interrupt Enable Register
983 ******************************************************************************/
986 * @brief HW_RTC_IER - RTC Interrupt Enable Register (RW)
988 * Reset value: 0x00000007U
990 typedef union _hw_rtc_ier
993 struct _hw_rtc_ier_bitfields
995 uint32_t TIIE : 1; /*!< [0] Time Invalid Interrupt Enable */
996 uint32_t TOIE : 1; /*!< [1] Time Overflow Interrupt Enable */
997 uint32_t TAIE : 1; /*!< [2] Time Alarm Interrupt Enable */
998 uint32_t RESERVED0 : 1; /*!< [3] */
999 uint32_t TSIE : 1; /*!< [4] Time Seconds Interrupt Enable */
1000 uint32_t RESERVED1 : 2; /*!< [6:5] */
1001 uint32_t WPON : 1; /*!< [7] Wakeup Pin On */
1002 uint32_t RESERVED2 : 24; /*!< [31:8] */
1007 * @name Constants and macros for entire RTC_IER register
1010 #define HW_RTC_IER_ADDR(x) ((x) + 0x1CU)
1012 #define HW_RTC_IER(x) (*(__IO hw_rtc_ier_t *) HW_RTC_IER_ADDR(x))
1013 #define HW_RTC_IER_RD(x) (HW_RTC_IER(x).U)
1014 #define HW_RTC_IER_WR(x, v) (HW_RTC_IER(x).U = (v))
1015 #define HW_RTC_IER_SET(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) | (v)))
1016 #define HW_RTC_IER_CLR(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) & ~(v)))
1017 #define HW_RTC_IER_TOG(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) ^ (v)))
1021 * Constants & macros for individual RTC_IER bitfields
1025 * @name Register RTC_IER, field TIIE[0] (RW)
1028 * - 0 - Time invalid flag does not generate an interrupt.
1029 * - 1 - Time invalid flag does generate an interrupt.
1032 #define BP_RTC_IER_TIIE (0U) /*!< Bit position for RTC_IER_TIIE. */
1033 #define BM_RTC_IER_TIIE (0x00000001U) /*!< Bit mask for RTC_IER_TIIE. */
1034 #define BS_RTC_IER_TIIE (1U) /*!< Bit field size in bits for RTC_IER_TIIE. */
1036 /*! @brief Read current value of the RTC_IER_TIIE field. */
1037 #define BR_RTC_IER_TIIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TIIE))
1039 /*! @brief Format value for bitfield RTC_IER_TIIE. */
1040 #define BF_RTC_IER_TIIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TIIE) & BM_RTC_IER_TIIE)
1042 /*! @brief Set the TIIE field to a new value. */
1043 #define BW_RTC_IER_TIIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TIIE) = (v))
1047 * @name Register RTC_IER, field TOIE[1] (RW)
1050 * - 0 - Time overflow flag does not generate an interrupt.
1051 * - 1 - Time overflow flag does generate an interrupt.
1054 #define BP_RTC_IER_TOIE (1U) /*!< Bit position for RTC_IER_TOIE. */
1055 #define BM_RTC_IER_TOIE (0x00000002U) /*!< Bit mask for RTC_IER_TOIE. */
1056 #define BS_RTC_IER_TOIE (1U) /*!< Bit field size in bits for RTC_IER_TOIE. */
1058 /*! @brief Read current value of the RTC_IER_TOIE field. */
1059 #define BR_RTC_IER_TOIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TOIE))
1061 /*! @brief Format value for bitfield RTC_IER_TOIE. */
1062 #define BF_RTC_IER_TOIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TOIE) & BM_RTC_IER_TOIE)
1064 /*! @brief Set the TOIE field to a new value. */
1065 #define BW_RTC_IER_TOIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TOIE) = (v))
1069 * @name Register RTC_IER, field TAIE[2] (RW)
1072 * - 0 - Time alarm flag does not generate an interrupt.
1073 * - 1 - Time alarm flag does generate an interrupt.
1076 #define BP_RTC_IER_TAIE (2U) /*!< Bit position for RTC_IER_TAIE. */
1077 #define BM_RTC_IER_TAIE (0x00000004U) /*!< Bit mask for RTC_IER_TAIE. */
1078 #define BS_RTC_IER_TAIE (1U) /*!< Bit field size in bits for RTC_IER_TAIE. */
1080 /*! @brief Read current value of the RTC_IER_TAIE field. */
1081 #define BR_RTC_IER_TAIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TAIE))
1083 /*! @brief Format value for bitfield RTC_IER_TAIE. */
1084 #define BF_RTC_IER_TAIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TAIE) & BM_RTC_IER_TAIE)
1086 /*! @brief Set the TAIE field to a new value. */
1087 #define BW_RTC_IER_TAIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TAIE) = (v))
1091 * @name Register RTC_IER, field TSIE[4] (RW)
1093 * The seconds interrupt is an edge-sensitive interrupt with a dedicated
1094 * interrupt vector. It is generated once a second and requires no software overhead
1095 * (there is no corresponding status flag to clear).
1098 * - 0 - Seconds interrupt is disabled.
1099 * - 1 - Seconds interrupt is enabled.
1102 #define BP_RTC_IER_TSIE (4U) /*!< Bit position for RTC_IER_TSIE. */
1103 #define BM_RTC_IER_TSIE (0x00000010U) /*!< Bit mask for RTC_IER_TSIE. */
1104 #define BS_RTC_IER_TSIE (1U) /*!< Bit field size in bits for RTC_IER_TSIE. */
1106 /*! @brief Read current value of the RTC_IER_TSIE field. */
1107 #define BR_RTC_IER_TSIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TSIE))
1109 /*! @brief Format value for bitfield RTC_IER_TSIE. */
1110 #define BF_RTC_IER_TSIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TSIE) & BM_RTC_IER_TSIE)
1112 /*! @brief Set the TSIE field to a new value. */
1113 #define BW_RTC_IER_TSIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TSIE) = (v))
1117 * @name Register RTC_IER, field WPON[7] (RW)
1119 * The wakeup pin is optional and not available on all devices. Whenever the
1120 * wakeup pin is enabled and this bit is set, the wakeup pin will assert.
1124 * - 1 - If the wakeup pin is enabled, then the wakeup pin will assert.
1127 #define BP_RTC_IER_WPON (7U) /*!< Bit position for RTC_IER_WPON. */
1128 #define BM_RTC_IER_WPON (0x00000080U) /*!< Bit mask for RTC_IER_WPON. */
1129 #define BS_RTC_IER_WPON (1U) /*!< Bit field size in bits for RTC_IER_WPON. */
1131 /*! @brief Read current value of the RTC_IER_WPON field. */
1132 #define BR_RTC_IER_WPON(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_WPON))
1134 /*! @brief Format value for bitfield RTC_IER_WPON. */
1135 #define BF_RTC_IER_WPON(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_WPON) & BM_RTC_IER_WPON)
1137 /*! @brief Set the WPON field to a new value. */
1138 #define BW_RTC_IER_WPON(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_WPON) = (v))
1141 /*******************************************************************************
1142 * HW_RTC_WAR - RTC Write Access Register
1143 ******************************************************************************/
1146 * @brief HW_RTC_WAR - RTC Write Access Register (RW)
1148 * Reset value: 0x000000FFU
1150 typedef union _hw_rtc_war
1153 struct _hw_rtc_war_bitfields
1155 uint32_t TSRW : 1; /*!< [0] Time Seconds Register Write */
1156 uint32_t TPRW : 1; /*!< [1] Time Prescaler Register Write */
1157 uint32_t TARW : 1; /*!< [2] Time Alarm Register Write */
1158 uint32_t TCRW : 1; /*!< [3] Time Compensation Register Write */
1159 uint32_t CRW : 1; /*!< [4] Control Register Write */
1160 uint32_t SRW : 1; /*!< [5] Status Register Write */
1161 uint32_t LRW : 1; /*!< [6] Lock Register Write */
1162 uint32_t IERW : 1; /*!< [7] Interrupt Enable Register Write */
1163 uint32_t RESERVED0 : 24; /*!< [31:8] */
1168 * @name Constants and macros for entire RTC_WAR register
1171 #define HW_RTC_WAR_ADDR(x) ((x) + 0x800U)
1173 #define HW_RTC_WAR(x) (*(__IO hw_rtc_war_t *) HW_RTC_WAR_ADDR(x))
1174 #define HW_RTC_WAR_RD(x) (HW_RTC_WAR(x).U)
1175 #define HW_RTC_WAR_WR(x, v) (HW_RTC_WAR(x).U = (v))
1176 #define HW_RTC_WAR_SET(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) | (v)))
1177 #define HW_RTC_WAR_CLR(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) & ~(v)))
1178 #define HW_RTC_WAR_TOG(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) ^ (v)))
1182 * Constants & macros for individual RTC_WAR bitfields
1186 * @name Register RTC_WAR, field TSRW[0] (RW)
1188 * After being cleared, this bit is set only by system reset. It is not affected
1189 * by VBAT POR or software reset.
1192 * - 0 - Writes to the Time Seconds Register are ignored.
1193 * - 1 - Writes to the Time Seconds Register complete as normal.
1196 #define BP_RTC_WAR_TSRW (0U) /*!< Bit position for RTC_WAR_TSRW. */
1197 #define BM_RTC_WAR_TSRW (0x00000001U) /*!< Bit mask for RTC_WAR_TSRW. */
1198 #define BS_RTC_WAR_TSRW (1U) /*!< Bit field size in bits for RTC_WAR_TSRW. */
1200 /*! @brief Read current value of the RTC_WAR_TSRW field. */
1201 #define BR_RTC_WAR_TSRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TSRW))
1203 /*! @brief Format value for bitfield RTC_WAR_TSRW. */
1204 #define BF_RTC_WAR_TSRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TSRW) & BM_RTC_WAR_TSRW)
1206 /*! @brief Set the TSRW field to a new value. */
1207 #define BW_RTC_WAR_TSRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TSRW) = (v))
1211 * @name Register RTC_WAR, field TPRW[1] (RW)
1213 * After being cleared, this bit is set only by system reset. It is not affected
1214 * by VBAT POR or software reset.
1217 * - 0 - Writes to the Time Prescaler Register are ignored.
1218 * - 1 - Writes to the Time Prescaler Register complete as normal.
1221 #define BP_RTC_WAR_TPRW (1U) /*!< Bit position for RTC_WAR_TPRW. */
1222 #define BM_RTC_WAR_TPRW (0x00000002U) /*!< Bit mask for RTC_WAR_TPRW. */
1223 #define BS_RTC_WAR_TPRW (1U) /*!< Bit field size in bits for RTC_WAR_TPRW. */
1225 /*! @brief Read current value of the RTC_WAR_TPRW field. */
1226 #define BR_RTC_WAR_TPRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TPRW))
1228 /*! @brief Format value for bitfield RTC_WAR_TPRW. */
1229 #define BF_RTC_WAR_TPRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TPRW) & BM_RTC_WAR_TPRW)
1231 /*! @brief Set the TPRW field to a new value. */
1232 #define BW_RTC_WAR_TPRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TPRW) = (v))
1236 * @name Register RTC_WAR, field TARW[2] (RW)
1238 * After being cleared, this bit is set only by system reset. It is not affected
1239 * by VBAT POR or software reset.
1242 * - 0 - Writes to the Time Alarm Register are ignored.
1243 * - 1 - Writes to the Time Alarm Register complete as normal.
1246 #define BP_RTC_WAR_TARW (2U) /*!< Bit position for RTC_WAR_TARW. */
1247 #define BM_RTC_WAR_TARW (0x00000004U) /*!< Bit mask for RTC_WAR_TARW. */
1248 #define BS_RTC_WAR_TARW (1U) /*!< Bit field size in bits for RTC_WAR_TARW. */
1250 /*! @brief Read current value of the RTC_WAR_TARW field. */
1251 #define BR_RTC_WAR_TARW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TARW))
1253 /*! @brief Format value for bitfield RTC_WAR_TARW. */
1254 #define BF_RTC_WAR_TARW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TARW) & BM_RTC_WAR_TARW)
1256 /*! @brief Set the TARW field to a new value. */
1257 #define BW_RTC_WAR_TARW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TARW) = (v))
1261 * @name Register RTC_WAR, field TCRW[3] (RW)
1263 * After being cleared, this bit is set only by system reset. It is not affected
1264 * by VBAT POR or software reset.
1267 * - 0 - Writes to the Time Compensation Register are ignored.
1268 * - 1 - Writes to the Time Compensation Register complete as normal.
1271 #define BP_RTC_WAR_TCRW (3U) /*!< Bit position for RTC_WAR_TCRW. */
1272 #define BM_RTC_WAR_TCRW (0x00000008U) /*!< Bit mask for RTC_WAR_TCRW. */
1273 #define BS_RTC_WAR_TCRW (1U) /*!< Bit field size in bits for RTC_WAR_TCRW. */
1275 /*! @brief Read current value of the RTC_WAR_TCRW field. */
1276 #define BR_RTC_WAR_TCRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TCRW))
1278 /*! @brief Format value for bitfield RTC_WAR_TCRW. */
1279 #define BF_RTC_WAR_TCRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TCRW) & BM_RTC_WAR_TCRW)
1281 /*! @brief Set the TCRW field to a new value. */
1282 #define BW_RTC_WAR_TCRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TCRW) = (v))
1286 * @name Register RTC_WAR, field CRW[4] (RW)
1288 * After being cleared, this bit is set only by system reset. It is not affected
1289 * by VBAT POR or software reset.
1292 * - 0 - Writes to the Control Register are ignored.
1293 * - 1 - Writes to the Control Register complete as normal.
1296 #define BP_RTC_WAR_CRW (4U) /*!< Bit position for RTC_WAR_CRW. */
1297 #define BM_RTC_WAR_CRW (0x00000010U) /*!< Bit mask for RTC_WAR_CRW. */
1298 #define BS_RTC_WAR_CRW (1U) /*!< Bit field size in bits for RTC_WAR_CRW. */
1300 /*! @brief Read current value of the RTC_WAR_CRW field. */
1301 #define BR_RTC_WAR_CRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_CRW))
1303 /*! @brief Format value for bitfield RTC_WAR_CRW. */
1304 #define BF_RTC_WAR_CRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_CRW) & BM_RTC_WAR_CRW)
1306 /*! @brief Set the CRW field to a new value. */
1307 #define BW_RTC_WAR_CRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_CRW) = (v))
1311 * @name Register RTC_WAR, field SRW[5] (RW)
1313 * After being cleared, this bit is set only by system reset. It is not affected
1314 * by VBAT POR or software reset.
1317 * - 0 - Writes to the Status Register are ignored.
1318 * - 1 - Writes to the Status Register complete as normal.
1321 #define BP_RTC_WAR_SRW (5U) /*!< Bit position for RTC_WAR_SRW. */
1322 #define BM_RTC_WAR_SRW (0x00000020U) /*!< Bit mask for RTC_WAR_SRW. */
1323 #define BS_RTC_WAR_SRW (1U) /*!< Bit field size in bits for RTC_WAR_SRW. */
1325 /*! @brief Read current value of the RTC_WAR_SRW field. */
1326 #define BR_RTC_WAR_SRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_SRW))
1328 /*! @brief Format value for bitfield RTC_WAR_SRW. */
1329 #define BF_RTC_WAR_SRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_SRW) & BM_RTC_WAR_SRW)
1331 /*! @brief Set the SRW field to a new value. */
1332 #define BW_RTC_WAR_SRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_SRW) = (v))
1336 * @name Register RTC_WAR, field LRW[6] (RW)
1338 * After being cleared, this bit is set only by system reset. It is not affected
1339 * by VBAT POR or software reset.
1342 * - 0 - Writes to the Lock Register are ignored.
1343 * - 1 - Writes to the Lock Register complete as normal.
1346 #define BP_RTC_WAR_LRW (6U) /*!< Bit position for RTC_WAR_LRW. */
1347 #define BM_RTC_WAR_LRW (0x00000040U) /*!< Bit mask for RTC_WAR_LRW. */
1348 #define BS_RTC_WAR_LRW (1U) /*!< Bit field size in bits for RTC_WAR_LRW. */
1350 /*! @brief Read current value of the RTC_WAR_LRW field. */
1351 #define BR_RTC_WAR_LRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_LRW))
1353 /*! @brief Format value for bitfield RTC_WAR_LRW. */
1354 #define BF_RTC_WAR_LRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_LRW) & BM_RTC_WAR_LRW)
1356 /*! @brief Set the LRW field to a new value. */
1357 #define BW_RTC_WAR_LRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_LRW) = (v))
1361 * @name Register RTC_WAR, field IERW[7] (RW)
1363 * After being cleared, this bit is set only by system reset. It is not affected
1364 * by VBAT POR or software reset.
1367 * - 0 - Writes to the Interupt Enable Register are ignored.
1368 * - 1 - Writes to the Interrupt Enable Register complete as normal.
1371 #define BP_RTC_WAR_IERW (7U) /*!< Bit position for RTC_WAR_IERW. */
1372 #define BM_RTC_WAR_IERW (0x00000080U) /*!< Bit mask for RTC_WAR_IERW. */
1373 #define BS_RTC_WAR_IERW (1U) /*!< Bit field size in bits for RTC_WAR_IERW. */
1375 /*! @brief Read current value of the RTC_WAR_IERW field. */
1376 #define BR_RTC_WAR_IERW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_IERW))
1378 /*! @brief Format value for bitfield RTC_WAR_IERW. */
1379 #define BF_RTC_WAR_IERW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_IERW) & BM_RTC_WAR_IERW)
1381 /*! @brief Set the IERW field to a new value. */
1382 #define BW_RTC_WAR_IERW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_IERW) = (v))
1385 /*******************************************************************************
1386 * HW_RTC_RAR - RTC Read Access Register
1387 ******************************************************************************/
1390 * @brief HW_RTC_RAR - RTC Read Access Register (RW)
1392 * Reset value: 0x000000FFU
1394 typedef union _hw_rtc_rar
1397 struct _hw_rtc_rar_bitfields
1399 uint32_t TSRR : 1; /*!< [0] Time Seconds Register Read */
1400 uint32_t TPRR : 1; /*!< [1] Time Prescaler Register Read */
1401 uint32_t TARR : 1; /*!< [2] Time Alarm Register Read */
1402 uint32_t TCRR : 1; /*!< [3] Time Compensation Register Read */
1403 uint32_t CRR : 1; /*!< [4] Control Register Read */
1404 uint32_t SRR : 1; /*!< [5] Status Register Read */
1405 uint32_t LRR : 1; /*!< [6] Lock Register Read */
1406 uint32_t IERR : 1; /*!< [7] Interrupt Enable Register Read */
1407 uint32_t RESERVED0 : 24; /*!< [31:8] */
1412 * @name Constants and macros for entire RTC_RAR register
1415 #define HW_RTC_RAR_ADDR(x) ((x) + 0x804U)
1417 #define HW_RTC_RAR(x) (*(__IO hw_rtc_rar_t *) HW_RTC_RAR_ADDR(x))
1418 #define HW_RTC_RAR_RD(x) (HW_RTC_RAR(x).U)
1419 #define HW_RTC_RAR_WR(x, v) (HW_RTC_RAR(x).U = (v))
1420 #define HW_RTC_RAR_SET(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) | (v)))
1421 #define HW_RTC_RAR_CLR(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) & ~(v)))
1422 #define HW_RTC_RAR_TOG(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) ^ (v)))
1426 * Constants & macros for individual RTC_RAR bitfields
1430 * @name Register RTC_RAR, field TSRR[0] (RW)
1432 * After being cleared, this bit is set only by system reset. It is not affected
1433 * by VBAT POR or software reset.
1436 * - 0 - Reads to the Time Seconds Register are ignored.
1437 * - 1 - Reads to the Time Seconds Register complete as normal.
1440 #define BP_RTC_RAR_TSRR (0U) /*!< Bit position for RTC_RAR_TSRR. */
1441 #define BM_RTC_RAR_TSRR (0x00000001U) /*!< Bit mask for RTC_RAR_TSRR. */
1442 #define BS_RTC_RAR_TSRR (1U) /*!< Bit field size in bits for RTC_RAR_TSRR. */
1444 /*! @brief Read current value of the RTC_RAR_TSRR field. */
1445 #define BR_RTC_RAR_TSRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TSRR))
1447 /*! @brief Format value for bitfield RTC_RAR_TSRR. */
1448 #define BF_RTC_RAR_TSRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TSRR) & BM_RTC_RAR_TSRR)
1450 /*! @brief Set the TSRR field to a new value. */
1451 #define BW_RTC_RAR_TSRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TSRR) = (v))
1455 * @name Register RTC_RAR, field TPRR[1] (RW)
1457 * After being cleared, this bit is set only by system reset. It is not affected
1458 * by VBAT POR or software reset.
1461 * - 0 - Reads to the Time Pprescaler Register are ignored.
1462 * - 1 - Reads to the Time Prescaler Register complete as normal.
1465 #define BP_RTC_RAR_TPRR (1U) /*!< Bit position for RTC_RAR_TPRR. */
1466 #define BM_RTC_RAR_TPRR (0x00000002U) /*!< Bit mask for RTC_RAR_TPRR. */
1467 #define BS_RTC_RAR_TPRR (1U) /*!< Bit field size in bits for RTC_RAR_TPRR. */
1469 /*! @brief Read current value of the RTC_RAR_TPRR field. */
1470 #define BR_RTC_RAR_TPRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TPRR))
1472 /*! @brief Format value for bitfield RTC_RAR_TPRR. */
1473 #define BF_RTC_RAR_TPRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TPRR) & BM_RTC_RAR_TPRR)
1475 /*! @brief Set the TPRR field to a new value. */
1476 #define BW_RTC_RAR_TPRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TPRR) = (v))
1480 * @name Register RTC_RAR, field TARR[2] (RW)
1482 * After being cleared, this bit is set only by system reset. It is not affected
1483 * by VBAT POR or software reset.
1486 * - 0 - Reads to the Time Alarm Register are ignored.
1487 * - 1 - Reads to the Time Alarm Register complete as normal.
1490 #define BP_RTC_RAR_TARR (2U) /*!< Bit position for RTC_RAR_TARR. */
1491 #define BM_RTC_RAR_TARR (0x00000004U) /*!< Bit mask for RTC_RAR_TARR. */
1492 #define BS_RTC_RAR_TARR (1U) /*!< Bit field size in bits for RTC_RAR_TARR. */
1494 /*! @brief Read current value of the RTC_RAR_TARR field. */
1495 #define BR_RTC_RAR_TARR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TARR))
1497 /*! @brief Format value for bitfield RTC_RAR_TARR. */
1498 #define BF_RTC_RAR_TARR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TARR) & BM_RTC_RAR_TARR)
1500 /*! @brief Set the TARR field to a new value. */
1501 #define BW_RTC_RAR_TARR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TARR) = (v))
1505 * @name Register RTC_RAR, field TCRR[3] (RW)
1507 * After being cleared, this bit is set only by system reset. It is not affected
1508 * by VBAT POR or software reset.
1511 * - 0 - Reads to the Time Compensation Register are ignored.
1512 * - 1 - Reads to the Time Compensation Register complete as normal.
1515 #define BP_RTC_RAR_TCRR (3U) /*!< Bit position for RTC_RAR_TCRR. */
1516 #define BM_RTC_RAR_TCRR (0x00000008U) /*!< Bit mask for RTC_RAR_TCRR. */
1517 #define BS_RTC_RAR_TCRR (1U) /*!< Bit field size in bits for RTC_RAR_TCRR. */
1519 /*! @brief Read current value of the RTC_RAR_TCRR field. */
1520 #define BR_RTC_RAR_TCRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TCRR))
1522 /*! @brief Format value for bitfield RTC_RAR_TCRR. */
1523 #define BF_RTC_RAR_TCRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TCRR) & BM_RTC_RAR_TCRR)
1525 /*! @brief Set the TCRR field to a new value. */
1526 #define BW_RTC_RAR_TCRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TCRR) = (v))
1530 * @name Register RTC_RAR, field CRR[4] (RW)
1532 * After being cleared, this bit is set only by system reset. It is not affected
1533 * by VBAT POR or software reset.
1536 * - 0 - Reads to the Control Register are ignored.
1537 * - 1 - Reads to the Control Register complete as normal.
1540 #define BP_RTC_RAR_CRR (4U) /*!< Bit position for RTC_RAR_CRR. */
1541 #define BM_RTC_RAR_CRR (0x00000010U) /*!< Bit mask for RTC_RAR_CRR. */
1542 #define BS_RTC_RAR_CRR (1U) /*!< Bit field size in bits for RTC_RAR_CRR. */
1544 /*! @brief Read current value of the RTC_RAR_CRR field. */
1545 #define BR_RTC_RAR_CRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_CRR))
1547 /*! @brief Format value for bitfield RTC_RAR_CRR. */
1548 #define BF_RTC_RAR_CRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_CRR) & BM_RTC_RAR_CRR)
1550 /*! @brief Set the CRR field to a new value. */
1551 #define BW_RTC_RAR_CRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_CRR) = (v))
1555 * @name Register RTC_RAR, field SRR[5] (RW)
1557 * After being cleared, this bit is set only by system reset. It is not affected
1558 * by VBAT POR or software reset.
1561 * - 0 - Reads to the Status Register are ignored.
1562 * - 1 - Reads to the Status Register complete as normal.
1565 #define BP_RTC_RAR_SRR (5U) /*!< Bit position for RTC_RAR_SRR. */
1566 #define BM_RTC_RAR_SRR (0x00000020U) /*!< Bit mask for RTC_RAR_SRR. */
1567 #define BS_RTC_RAR_SRR (1U) /*!< Bit field size in bits for RTC_RAR_SRR. */
1569 /*! @brief Read current value of the RTC_RAR_SRR field. */
1570 #define BR_RTC_RAR_SRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_SRR))
1572 /*! @brief Format value for bitfield RTC_RAR_SRR. */
1573 #define BF_RTC_RAR_SRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_SRR) & BM_RTC_RAR_SRR)
1575 /*! @brief Set the SRR field to a new value. */
1576 #define BW_RTC_RAR_SRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_SRR) = (v))
1580 * @name Register RTC_RAR, field LRR[6] (RW)
1582 * After being cleared, this bit is set only by system reset. It is not affected
1583 * by VBAT POR or software reset.
1586 * - 0 - Reads to the Lock Register are ignored.
1587 * - 1 - Reads to the Lock Register complete as normal.
1590 #define BP_RTC_RAR_LRR (6U) /*!< Bit position for RTC_RAR_LRR. */
1591 #define BM_RTC_RAR_LRR (0x00000040U) /*!< Bit mask for RTC_RAR_LRR. */
1592 #define BS_RTC_RAR_LRR (1U) /*!< Bit field size in bits for RTC_RAR_LRR. */
1594 /*! @brief Read current value of the RTC_RAR_LRR field. */
1595 #define BR_RTC_RAR_LRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_LRR))
1597 /*! @brief Format value for bitfield RTC_RAR_LRR. */
1598 #define BF_RTC_RAR_LRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_LRR) & BM_RTC_RAR_LRR)
1600 /*! @brief Set the LRR field to a new value. */
1601 #define BW_RTC_RAR_LRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_LRR) = (v))
1605 * @name Register RTC_RAR, field IERR[7] (RW)
1607 * After being cleared, this bit is set only by system reset. It is not affected
1608 * by VBAT POR or software reset.
1611 * - 0 - Reads to the Interrupt Enable Register are ignored.
1612 * - 1 - Reads to the Interrupt Enable Register complete as normal.
1615 #define BP_RTC_RAR_IERR (7U) /*!< Bit position for RTC_RAR_IERR. */
1616 #define BM_RTC_RAR_IERR (0x00000080U) /*!< Bit mask for RTC_RAR_IERR. */
1617 #define BS_RTC_RAR_IERR (1U) /*!< Bit field size in bits for RTC_RAR_IERR. */
1619 /*! @brief Read current value of the RTC_RAR_IERR field. */
1620 #define BR_RTC_RAR_IERR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_IERR))
1622 /*! @brief Format value for bitfield RTC_RAR_IERR. */
1623 #define BF_RTC_RAR_IERR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_IERR) & BM_RTC_RAR_IERR)
1625 /*! @brief Set the IERR field to a new value. */
1626 #define BW_RTC_RAR_IERR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_IERR) = (v))
1629 /*******************************************************************************
1630 * hw_rtc_t - module struct
1631 ******************************************************************************/
1633 * @brief All RTC module registers.
1636 typedef struct _hw_rtc
1638 __IO hw_rtc_tsr_t TSR; /*!< [0x0] RTC Time Seconds Register */
1639 __IO hw_rtc_tpr_t TPR; /*!< [0x4] RTC Time Prescaler Register */
1640 __IO hw_rtc_tar_t TAR; /*!< [0x8] RTC Time Alarm Register */
1641 __IO hw_rtc_tcr_t TCR; /*!< [0xC] RTC Time Compensation Register */
1642 __IO hw_rtc_cr_t CR; /*!< [0x10] RTC Control Register */
1643 __IO hw_rtc_sr_t SR; /*!< [0x14] RTC Status Register */
1644 __IO hw_rtc_lr_t LR; /*!< [0x18] RTC Lock Register */
1645 __IO hw_rtc_ier_t IER; /*!< [0x1C] RTC Interrupt Enable Register */
1646 uint8_t _reserved0[2016];
1647 __IO hw_rtc_war_t WAR; /*!< [0x800] RTC Write Access Register */
1648 __IO hw_rtc_rar_t RAR; /*!< [0x804] RTC Read Access Register */
1652 /*! @brief Macro to access all RTC registers. */
1653 /*! @param x RTC module instance base address. */
1654 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1655 * use the '&' operator, like <code>&HW_RTC(RTC_BASE)</code>. */
1656 #define HW_RTC(x) (*(hw_rtc_t *)(x))
1658 #endif /* __HW_RTC_REGISTERS_H__ */