]>
git.gir.st - tmk_keyboard.git/blob - tmk_core/tool/mbed/mbed-sdk/libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KPSDK_MCUS/TARGET_MCU_K64F/device/device/MK64F12/MK64F12_rtc.h
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: K64P144M120SF5RM, Rev.2, January 2014
9 ** Version: rev. 2.5, 2014-02-10
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-08-12)
49 ** - rev. 2.0 (2013-10-29)
50 ** Register accessor macros added to the memory map.
51 ** Symbols for Processor Expert memory map compatibility added to the memory map.
52 ** Startup file for gcc has been updated according to CMSIS 3.2.
53 ** System initialization updated.
54 ** MCG - registers updated.
55 ** PORTA, PORTB, PORTC, PORTE - registers for digital filter removed.
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-09)
59 ** DMA - EARS register removed.
60 ** AIPS0, AIPS1 - MPRA register updated.
61 ** - rev. 2.3 (2014-01-24)
62 ** Update according to reference manual rev. 2
63 ** ENET, MCG, MCM, SIM, USB - registers updated
64 ** - rev. 2.4 (2014-02-10)
65 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
66 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
67 ** - rev. 2.5 (2014-02-10)
68 ** The declaration of clock configurations has been moved to separate header file system_MK64F12.h
69 ** Update of SystemInit() and SystemCoreClockUpdate() functions.
70 ** Module access macro module_BASES replaced by module_BASE_PTRS.
72 ** ###################################################################
76 * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
78 * This file was generated automatically and any changes may be lost.
80 #ifndef __HW_RTC_REGISTERS_H__
81 #define __HW_RTC_REGISTERS_H__
84 #include "fsl_bitaccess.h"
89 * Secure Real Time Clock
91 * Registers defined in this header file:
92 * - HW_RTC_TSR - RTC Time Seconds Register
93 * - HW_RTC_TPR - RTC Time Prescaler Register
94 * - HW_RTC_TAR - RTC Time Alarm Register
95 * - HW_RTC_TCR - RTC Time Compensation Register
96 * - HW_RTC_CR - RTC Control Register
97 * - HW_RTC_SR - RTC Status Register
98 * - HW_RTC_LR - RTC Lock Register
99 * - HW_RTC_IER - RTC Interrupt Enable Register
100 * - HW_RTC_WAR - RTC Write Access Register
101 * - HW_RTC_RAR - RTC Read Access Register
103 * - hw_rtc_t - Struct containing all module registers.
106 #define HW_RTC_INSTANCE_COUNT (1U) /*!< Number of instances of the RTC module. */
108 /*******************************************************************************
109 * HW_RTC_TSR - RTC Time Seconds Register
110 ******************************************************************************/
113 * @brief HW_RTC_TSR - RTC Time Seconds Register (RW)
115 * Reset value: 0x00000000U
117 typedef union _hw_rtc_tsr
120 struct _hw_rtc_tsr_bitfields
122 uint32_t TSR
: 32; /*!< [31:0] Time Seconds Register */
127 * @name Constants and macros for entire RTC_TSR register
130 #define HW_RTC_TSR_ADDR(x) ((x) + 0x0U)
132 #define HW_RTC_TSR(x) (*(__IO hw_rtc_tsr_t *) HW_RTC_TSR_ADDR(x))
133 #define HW_RTC_TSR_RD(x) (HW_RTC_TSR(x).U)
134 #define HW_RTC_TSR_WR(x, v) (HW_RTC_TSR(x).U = (v))
135 #define HW_RTC_TSR_SET(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) | (v)))
136 #define HW_RTC_TSR_CLR(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) & ~(v)))
137 #define HW_RTC_TSR_TOG(x, v) (HW_RTC_TSR_WR(x, HW_RTC_TSR_RD(x) ^ (v)))
141 * Constants & macros for individual RTC_TSR bitfields
145 * @name Register RTC_TSR, field TSR[31:0] (RW)
147 * When the time counter is enabled, the TSR is read only and increments once a
148 * second provided SR[TOF] or SR[TIF] are not set. The time counter will read as
149 * zero when SR[TOF] or SR[TIF] are set. When the time counter is disabled, the
150 * TSR can be read or written. Writing to the TSR when the time counter is
151 * disabled will clear the SR[TOF] and/or the SR[TIF]. Writing to TSR with zero is
152 * supported, but not recommended because TSR will read as zero when SR[TIF] or
153 * SR[TOF] are set (indicating the time is invalid).
156 #define BP_RTC_TSR_TSR (0U) /*!< Bit position for RTC_TSR_TSR. */
157 #define BM_RTC_TSR_TSR (0xFFFFFFFFU) /*!< Bit mask for RTC_TSR_TSR. */
158 #define BS_RTC_TSR_TSR (32U) /*!< Bit field size in bits for RTC_TSR_TSR. */
160 /*! @brief Read current value of the RTC_TSR_TSR field. */
161 #define BR_RTC_TSR_TSR(x) (HW_RTC_TSR(x).U)
163 /*! @brief Format value for bitfield RTC_TSR_TSR. */
164 #define BF_RTC_TSR_TSR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TSR_TSR) & BM_RTC_TSR_TSR)
166 /*! @brief Set the TSR field to a new value. */
167 #define BW_RTC_TSR_TSR(x, v) (HW_RTC_TSR_WR(x, v))
170 /*******************************************************************************
171 * HW_RTC_TPR - RTC Time Prescaler Register
172 ******************************************************************************/
175 * @brief HW_RTC_TPR - RTC Time Prescaler Register (RW)
177 * Reset value: 0x00000000U
179 typedef union _hw_rtc_tpr
182 struct _hw_rtc_tpr_bitfields
184 uint32_t TPR
: 16; /*!< [15:0] Time Prescaler Register */
185 uint32_t RESERVED0
: 16; /*!< [31:16] */
190 * @name Constants and macros for entire RTC_TPR register
193 #define HW_RTC_TPR_ADDR(x) ((x) + 0x4U)
195 #define HW_RTC_TPR(x) (*(__IO hw_rtc_tpr_t *) HW_RTC_TPR_ADDR(x))
196 #define HW_RTC_TPR_RD(x) (HW_RTC_TPR(x).U)
197 #define HW_RTC_TPR_WR(x, v) (HW_RTC_TPR(x).U = (v))
198 #define HW_RTC_TPR_SET(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) | (v)))
199 #define HW_RTC_TPR_CLR(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) & ~(v)))
200 #define HW_RTC_TPR_TOG(x, v) (HW_RTC_TPR_WR(x, HW_RTC_TPR_RD(x) ^ (v)))
204 * Constants & macros for individual RTC_TPR bitfields
208 * @name Register RTC_TPR, field TPR[15:0] (RW)
210 * When the time counter is enabled, the TPR is read only and increments every
211 * 32.768 kHz clock cycle. The time counter will read as zero when SR[TOF] or
212 * SR[TIF] are set. When the time counter is disabled, the TPR can be read or
213 * written. The TSR[TSR] increments when bit 14 of the TPR transitions from a logic one
217 #define BP_RTC_TPR_TPR (0U) /*!< Bit position for RTC_TPR_TPR. */
218 #define BM_RTC_TPR_TPR (0x0000FFFFU) /*!< Bit mask for RTC_TPR_TPR. */
219 #define BS_RTC_TPR_TPR (16U) /*!< Bit field size in bits for RTC_TPR_TPR. */
221 /*! @brief Read current value of the RTC_TPR_TPR field. */
222 #define BR_RTC_TPR_TPR(x) (HW_RTC_TPR(x).B.TPR)
224 /*! @brief Format value for bitfield RTC_TPR_TPR. */
225 #define BF_RTC_TPR_TPR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TPR_TPR) & BM_RTC_TPR_TPR)
227 /*! @brief Set the TPR field to a new value. */
228 #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)))
231 /*******************************************************************************
232 * HW_RTC_TAR - RTC Time Alarm Register
233 ******************************************************************************/
236 * @brief HW_RTC_TAR - RTC Time Alarm Register (RW)
238 * Reset value: 0x00000000U
240 typedef union _hw_rtc_tar
243 struct _hw_rtc_tar_bitfields
245 uint32_t TAR
: 32; /*!< [31:0] Time Alarm Register */
250 * @name Constants and macros for entire RTC_TAR register
253 #define HW_RTC_TAR_ADDR(x) ((x) + 0x8U)
255 #define HW_RTC_TAR(x) (*(__IO hw_rtc_tar_t *) HW_RTC_TAR_ADDR(x))
256 #define HW_RTC_TAR_RD(x) (HW_RTC_TAR(x).U)
257 #define HW_RTC_TAR_WR(x, v) (HW_RTC_TAR(x).U = (v))
258 #define HW_RTC_TAR_SET(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) | (v)))
259 #define HW_RTC_TAR_CLR(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) & ~(v)))
260 #define HW_RTC_TAR_TOG(x, v) (HW_RTC_TAR_WR(x, HW_RTC_TAR_RD(x) ^ (v)))
264 * Constants & macros for individual RTC_TAR bitfields
268 * @name Register RTC_TAR, field TAR[31:0] (RW)
270 * When the time counter is enabled, the SR[TAF] is set whenever the TAR[TAR]
271 * equals the TSR[TSR] and the TSR[TSR] increments. Writing to the TAR clears the
275 #define BP_RTC_TAR_TAR (0U) /*!< Bit position for RTC_TAR_TAR. */
276 #define BM_RTC_TAR_TAR (0xFFFFFFFFU) /*!< Bit mask for RTC_TAR_TAR. */
277 #define BS_RTC_TAR_TAR (32U) /*!< Bit field size in bits for RTC_TAR_TAR. */
279 /*! @brief Read current value of the RTC_TAR_TAR field. */
280 #define BR_RTC_TAR_TAR(x) (HW_RTC_TAR(x).U)
282 /*! @brief Format value for bitfield RTC_TAR_TAR. */
283 #define BF_RTC_TAR_TAR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TAR_TAR) & BM_RTC_TAR_TAR)
285 /*! @brief Set the TAR field to a new value. */
286 #define BW_RTC_TAR_TAR(x, v) (HW_RTC_TAR_WR(x, v))
289 /*******************************************************************************
290 * HW_RTC_TCR - RTC Time Compensation Register
291 ******************************************************************************/
294 * @brief HW_RTC_TCR - RTC Time Compensation Register (RW)
296 * Reset value: 0x00000000U
298 typedef union _hw_rtc_tcr
301 struct _hw_rtc_tcr_bitfields
303 uint32_t TCR
: 8; /*!< [7:0] Time Compensation Register */
304 uint32_t CIR
: 8; /*!< [15:8] Compensation Interval Register */
305 uint32_t TCV
: 8; /*!< [23:16] Time Compensation Value */
306 uint32_t CIC
: 8; /*!< [31:24] Compensation Interval Counter */
311 * @name Constants and macros for entire RTC_TCR register
314 #define HW_RTC_TCR_ADDR(x) ((x) + 0xCU)
316 #define HW_RTC_TCR(x) (*(__IO hw_rtc_tcr_t *) HW_RTC_TCR_ADDR(x))
317 #define HW_RTC_TCR_RD(x) (HW_RTC_TCR(x).U)
318 #define HW_RTC_TCR_WR(x, v) (HW_RTC_TCR(x).U = (v))
319 #define HW_RTC_TCR_SET(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) | (v)))
320 #define HW_RTC_TCR_CLR(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) & ~(v)))
321 #define HW_RTC_TCR_TOG(x, v) (HW_RTC_TCR_WR(x, HW_RTC_TCR_RD(x) ^ (v)))
325 * Constants & macros for individual RTC_TCR bitfields
329 * @name Register RTC_TCR, field TCR[7:0] (RW)
331 * Configures the number of 32.768 kHz clock cycles in each second. This
332 * register is double buffered and writes do not take affect until the end of the
333 * current compensation interval.
336 * - 10000000 - Time Prescaler Register overflows every 32896 clock cycles.
337 * - 11111111 - Time Prescaler Register overflows every 32769 clock cycles.
338 * - 0 - Time Prescaler Register overflows every 32768 clock cycles.
339 * - 1 - Time Prescaler Register overflows every 32767 clock cycles.
340 * - 1111111 - Time Prescaler Register overflows every 32641 clock cycles.
343 #define BP_RTC_TCR_TCR (0U) /*!< Bit position for RTC_TCR_TCR. */
344 #define BM_RTC_TCR_TCR (0x000000FFU) /*!< Bit mask for RTC_TCR_TCR. */
345 #define BS_RTC_TCR_TCR (8U) /*!< Bit field size in bits for RTC_TCR_TCR. */
347 /*! @brief Read current value of the RTC_TCR_TCR field. */
348 #define BR_RTC_TCR_TCR(x) (HW_RTC_TCR(x).B.TCR)
350 /*! @brief Format value for bitfield RTC_TCR_TCR. */
351 #define BF_RTC_TCR_TCR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TCR_TCR) & BM_RTC_TCR_TCR)
353 /*! @brief Set the TCR field to a new value. */
354 #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)))
358 * @name Register RTC_TCR, field CIR[15:8] (RW)
360 * Configures the compensation interval in seconds from 1 to 256 to control how
361 * frequently the TCR should adjust the number of 32.768 kHz cycles in each
362 * second. The value written should be one less than the number of seconds. For
363 * example, write zero to configure for a compensation interval of one second. This
364 * register is double buffered and writes do not take affect until the end of the
365 * current compensation interval.
368 #define BP_RTC_TCR_CIR (8U) /*!< Bit position for RTC_TCR_CIR. */
369 #define BM_RTC_TCR_CIR (0x0000FF00U) /*!< Bit mask for RTC_TCR_CIR. */
370 #define BS_RTC_TCR_CIR (8U) /*!< Bit field size in bits for RTC_TCR_CIR. */
372 /*! @brief Read current value of the RTC_TCR_CIR field. */
373 #define BR_RTC_TCR_CIR(x) (HW_RTC_TCR(x).B.CIR)
375 /*! @brief Format value for bitfield RTC_TCR_CIR. */
376 #define BF_RTC_TCR_CIR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_TCR_CIR) & BM_RTC_TCR_CIR)
378 /*! @brief Set the CIR field to a new value. */
379 #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)))
383 * @name Register RTC_TCR, field TCV[23:16] (RO)
385 * Current value used by the compensation logic for the present second interval.
386 * Updated once a second if the CIC equals 0 with the contents of the TCR field.
387 * If the CIC does not equal zero then it is loaded with zero (compensation is
388 * not enabled for that second increment).
391 #define BP_RTC_TCR_TCV (16U) /*!< Bit position for RTC_TCR_TCV. */
392 #define BM_RTC_TCR_TCV (0x00FF0000U) /*!< Bit mask for RTC_TCR_TCV. */
393 #define BS_RTC_TCR_TCV (8U) /*!< Bit field size in bits for RTC_TCR_TCV. */
395 /*! @brief Read current value of the RTC_TCR_TCV field. */
396 #define BR_RTC_TCR_TCV(x) (HW_RTC_TCR(x).B.TCV)
400 * @name Register RTC_TCR, field CIC[31:24] (RO)
402 * Current value of the compensation interval counter. If the compensation
403 * interval counter equals zero then it is loaded with the contents of the CIR. If the
404 * CIC does not equal zero then it is decremented once a second.
407 #define BP_RTC_TCR_CIC (24U) /*!< Bit position for RTC_TCR_CIC. */
408 #define BM_RTC_TCR_CIC (0xFF000000U) /*!< Bit mask for RTC_TCR_CIC. */
409 #define BS_RTC_TCR_CIC (8U) /*!< Bit field size in bits for RTC_TCR_CIC. */
411 /*! @brief Read current value of the RTC_TCR_CIC field. */
412 #define BR_RTC_TCR_CIC(x) (HW_RTC_TCR(x).B.CIC)
415 /*******************************************************************************
416 * HW_RTC_CR - RTC Control Register
417 ******************************************************************************/
420 * @brief HW_RTC_CR - RTC Control Register (RW)
422 * Reset value: 0x00000000U
424 typedef union _hw_rtc_cr
427 struct _hw_rtc_cr_bitfields
429 uint32_t SWR
: 1; /*!< [0] Software Reset */
430 uint32_t WPE
: 1; /*!< [1] Wakeup Pin Enable */
431 uint32_t SUP
: 1; /*!< [2] Supervisor Access */
432 uint32_t UM
: 1; /*!< [3] Update Mode */
433 uint32_t WPS
: 1; /*!< [4] Wakeup Pin Select */
434 uint32_t RESERVED0
: 3; /*!< [7:5] */
435 uint32_t OSCE
: 1; /*!< [8] Oscillator Enable */
436 uint32_t CLKO
: 1; /*!< [9] Clock Output */
437 uint32_t SC16P
: 1; /*!< [10] Oscillator 16pF Load Configure */
438 uint32_t SC8P
: 1; /*!< [11] Oscillator 8pF Load Configure */
439 uint32_t SC4P
: 1; /*!< [12] Oscillator 4pF Load Configure */
440 uint32_t SC2P
: 1; /*!< [13] Oscillator 2pF Load Configure */
441 uint32_t RESERVED1
: 18; /*!< [31:14] */
446 * @name Constants and macros for entire RTC_CR register
449 #define HW_RTC_CR_ADDR(x) ((x) + 0x10U)
451 #define HW_RTC_CR(x) (*(__IO hw_rtc_cr_t *) HW_RTC_CR_ADDR(x))
452 #define HW_RTC_CR_RD(x) (HW_RTC_CR(x).U)
453 #define HW_RTC_CR_WR(x, v) (HW_RTC_CR(x).U = (v))
454 #define HW_RTC_CR_SET(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) | (v)))
455 #define HW_RTC_CR_CLR(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) & ~(v)))
456 #define HW_RTC_CR_TOG(x, v) (HW_RTC_CR_WR(x, HW_RTC_CR_RD(x) ^ (v)))
460 * Constants & macros for individual RTC_CR bitfields
464 * @name Register RTC_CR, field SWR[0] (RW)
468 * - 1 - Resets all RTC registers except for the SWR bit and the RTC_WAR and
469 * RTC_RAR registers . The SWR bit is cleared by VBAT POR and by software
470 * explicitly clearing it.
473 #define BP_RTC_CR_SWR (0U) /*!< Bit position for RTC_CR_SWR. */
474 #define BM_RTC_CR_SWR (0x00000001U) /*!< Bit mask for RTC_CR_SWR. */
475 #define BS_RTC_CR_SWR (1U) /*!< Bit field size in bits for RTC_CR_SWR. */
477 /*! @brief Read current value of the RTC_CR_SWR field. */
478 #define BR_RTC_CR_SWR(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SWR))
480 /*! @brief Format value for bitfield RTC_CR_SWR. */
481 #define BF_RTC_CR_SWR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SWR) & BM_RTC_CR_SWR)
483 /*! @brief Set the SWR field to a new value. */
484 #define BW_RTC_CR_SWR(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SWR) = (v))
488 * @name Register RTC_CR, field WPE[1] (RW)
490 * The wakeup pin is optional and not available on all devices.
493 * - 0 - Wakeup pin is disabled.
494 * - 1 - Wakeup pin is enabled and wakeup pin asserts if the RTC interrupt
495 * asserts or the wakeup pin is turned on.
498 #define BP_RTC_CR_WPE (1U) /*!< Bit position for RTC_CR_WPE. */
499 #define BM_RTC_CR_WPE (0x00000002U) /*!< Bit mask for RTC_CR_WPE. */
500 #define BS_RTC_CR_WPE (1U) /*!< Bit field size in bits for RTC_CR_WPE. */
502 /*! @brief Read current value of the RTC_CR_WPE field. */
503 #define BR_RTC_CR_WPE(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPE))
505 /*! @brief Format value for bitfield RTC_CR_WPE. */
506 #define BF_RTC_CR_WPE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_WPE) & BM_RTC_CR_WPE)
508 /*! @brief Set the WPE field to a new value. */
509 #define BW_RTC_CR_WPE(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPE) = (v))
513 * @name Register RTC_CR, field SUP[2] (RW)
516 * - 0 - Non-supervisor mode write accesses are not supported and generate a bus
518 * - 1 - Non-supervisor mode write accesses are supported.
521 #define BP_RTC_CR_SUP (2U) /*!< Bit position for RTC_CR_SUP. */
522 #define BM_RTC_CR_SUP (0x00000004U) /*!< Bit mask for RTC_CR_SUP. */
523 #define BS_RTC_CR_SUP (1U) /*!< Bit field size in bits for RTC_CR_SUP. */
525 /*! @brief Read current value of the RTC_CR_SUP field. */
526 #define BR_RTC_CR_SUP(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SUP))
528 /*! @brief Format value for bitfield RTC_CR_SUP. */
529 #define BF_RTC_CR_SUP(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SUP) & BM_RTC_CR_SUP)
531 /*! @brief Set the SUP field to a new value. */
532 #define BW_RTC_CR_SUP(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SUP) = (v))
536 * @name Register RTC_CR, field UM[3] (RW)
538 * Allows SR[TCE] to be written even when the Status Register is locked. When
539 * set, the SR[TCE] can always be written if the SR[TIF] or SR[TOF] are set or if
540 * the SR[TCE] is clear.
543 * - 0 - Registers cannot be written when locked.
544 * - 1 - Registers can be written when locked under limited conditions.
547 #define BP_RTC_CR_UM (3U) /*!< Bit position for RTC_CR_UM. */
548 #define BM_RTC_CR_UM (0x00000008U) /*!< Bit mask for RTC_CR_UM. */
549 #define BS_RTC_CR_UM (1U) /*!< Bit field size in bits for RTC_CR_UM. */
551 /*! @brief Read current value of the RTC_CR_UM field. */
552 #define BR_RTC_CR_UM(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_UM))
554 /*! @brief Format value for bitfield RTC_CR_UM. */
555 #define BF_RTC_CR_UM(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_UM) & BM_RTC_CR_UM)
557 /*! @brief Set the UM field to a new value. */
558 #define BW_RTC_CR_UM(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_UM) = (v))
562 * @name Register RTC_CR, field WPS[4] (RW)
564 * The wakeup pin is optional and not available on all devices.
567 * - 0 - Wakeup pin asserts (active low, open drain) if the RTC interrupt
568 * asserts or the wakeup pin is turned on.
569 * - 1 - Wakeup pin instead outputs the RTC 32kHz clock, provided the wakeup pin
570 * is turned on and the 32kHz clock is output to other peripherals.
573 #define BP_RTC_CR_WPS (4U) /*!< Bit position for RTC_CR_WPS. */
574 #define BM_RTC_CR_WPS (0x00000010U) /*!< Bit mask for RTC_CR_WPS. */
575 #define BS_RTC_CR_WPS (1U) /*!< Bit field size in bits for RTC_CR_WPS. */
577 /*! @brief Read current value of the RTC_CR_WPS field. */
578 #define BR_RTC_CR_WPS(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPS))
580 /*! @brief Format value for bitfield RTC_CR_WPS. */
581 #define BF_RTC_CR_WPS(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_WPS) & BM_RTC_CR_WPS)
583 /*! @brief Set the WPS field to a new value. */
584 #define BW_RTC_CR_WPS(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_WPS) = (v))
588 * @name Register RTC_CR, field OSCE[8] (RW)
591 * - 0 - 32.768 kHz oscillator is disabled.
592 * - 1 - 32.768 kHz oscillator is enabled. After setting this bit, wait the
593 * oscillator startup time before enabling the time counter to allow the 32.768
594 * kHz clock time to stabilize.
597 #define BP_RTC_CR_OSCE (8U) /*!< Bit position for RTC_CR_OSCE. */
598 #define BM_RTC_CR_OSCE (0x00000100U) /*!< Bit mask for RTC_CR_OSCE. */
599 #define BS_RTC_CR_OSCE (1U) /*!< Bit field size in bits for RTC_CR_OSCE. */
601 /*! @brief Read current value of the RTC_CR_OSCE field. */
602 #define BR_RTC_CR_OSCE(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_OSCE))
604 /*! @brief Format value for bitfield RTC_CR_OSCE. */
605 #define BF_RTC_CR_OSCE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_OSCE) & BM_RTC_CR_OSCE)
607 /*! @brief Set the OSCE field to a new value. */
608 #define BW_RTC_CR_OSCE(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_OSCE) = (v))
612 * @name Register RTC_CR, field CLKO[9] (RW)
615 * - 0 - The 32 kHz clock is output to other peripherals.
616 * - 1 - The 32 kHz clock is not output to other peripherals.
619 #define BP_RTC_CR_CLKO (9U) /*!< Bit position for RTC_CR_CLKO. */
620 #define BM_RTC_CR_CLKO (0x00000200U) /*!< Bit mask for RTC_CR_CLKO. */
621 #define BS_RTC_CR_CLKO (1U) /*!< Bit field size in bits for RTC_CR_CLKO. */
623 /*! @brief Read current value of the RTC_CR_CLKO field. */
624 #define BR_RTC_CR_CLKO(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_CLKO))
626 /*! @brief Format value for bitfield RTC_CR_CLKO. */
627 #define BF_RTC_CR_CLKO(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_CLKO) & BM_RTC_CR_CLKO)
629 /*! @brief Set the CLKO field to a new value. */
630 #define BW_RTC_CR_CLKO(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_CLKO) = (v))
634 * @name Register RTC_CR, field SC16P[10] (RW)
637 * - 0 - Disable the load.
638 * - 1 - Enable the additional load.
641 #define BP_RTC_CR_SC16P (10U) /*!< Bit position for RTC_CR_SC16P. */
642 #define BM_RTC_CR_SC16P (0x00000400U) /*!< Bit mask for RTC_CR_SC16P. */
643 #define BS_RTC_CR_SC16P (1U) /*!< Bit field size in bits for RTC_CR_SC16P. */
645 /*! @brief Read current value of the RTC_CR_SC16P field. */
646 #define BR_RTC_CR_SC16P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC16P))
648 /*! @brief Format value for bitfield RTC_CR_SC16P. */
649 #define BF_RTC_CR_SC16P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC16P) & BM_RTC_CR_SC16P)
651 /*! @brief Set the SC16P field to a new value. */
652 #define BW_RTC_CR_SC16P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC16P) = (v))
656 * @name Register RTC_CR, field SC8P[11] (RW)
659 * - 0 - Disable the load.
660 * - 1 - Enable the additional load.
663 #define BP_RTC_CR_SC8P (11U) /*!< Bit position for RTC_CR_SC8P. */
664 #define BM_RTC_CR_SC8P (0x00000800U) /*!< Bit mask for RTC_CR_SC8P. */
665 #define BS_RTC_CR_SC8P (1U) /*!< Bit field size in bits for RTC_CR_SC8P. */
667 /*! @brief Read current value of the RTC_CR_SC8P field. */
668 #define BR_RTC_CR_SC8P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC8P))
670 /*! @brief Format value for bitfield RTC_CR_SC8P. */
671 #define BF_RTC_CR_SC8P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC8P) & BM_RTC_CR_SC8P)
673 /*! @brief Set the SC8P field to a new value. */
674 #define BW_RTC_CR_SC8P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC8P) = (v))
678 * @name Register RTC_CR, field SC4P[12] (RW)
681 * - 0 - Disable the load.
682 * - 1 - Enable the additional load.
685 #define BP_RTC_CR_SC4P (12U) /*!< Bit position for RTC_CR_SC4P. */
686 #define BM_RTC_CR_SC4P (0x00001000U) /*!< Bit mask for RTC_CR_SC4P. */
687 #define BS_RTC_CR_SC4P (1U) /*!< Bit field size in bits for RTC_CR_SC4P. */
689 /*! @brief Read current value of the RTC_CR_SC4P field. */
690 #define BR_RTC_CR_SC4P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC4P))
692 /*! @brief Format value for bitfield RTC_CR_SC4P. */
693 #define BF_RTC_CR_SC4P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC4P) & BM_RTC_CR_SC4P)
695 /*! @brief Set the SC4P field to a new value. */
696 #define BW_RTC_CR_SC4P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC4P) = (v))
700 * @name Register RTC_CR, field SC2P[13] (RW)
703 * - 0 - Disable the load.
704 * - 1 - Enable the additional load.
707 #define BP_RTC_CR_SC2P (13U) /*!< Bit position for RTC_CR_SC2P. */
708 #define BM_RTC_CR_SC2P (0x00002000U) /*!< Bit mask for RTC_CR_SC2P. */
709 #define BS_RTC_CR_SC2P (1U) /*!< Bit field size in bits for RTC_CR_SC2P. */
711 /*! @brief Read current value of the RTC_CR_SC2P field. */
712 #define BR_RTC_CR_SC2P(x) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC2P))
714 /*! @brief Format value for bitfield RTC_CR_SC2P. */
715 #define BF_RTC_CR_SC2P(v) ((uint32_t)((uint32_t)(v) << BP_RTC_CR_SC2P) & BM_RTC_CR_SC2P)
717 /*! @brief Set the SC2P field to a new value. */
718 #define BW_RTC_CR_SC2P(x, v) (BITBAND_ACCESS32(HW_RTC_CR_ADDR(x), BP_RTC_CR_SC2P) = (v))
721 /*******************************************************************************
722 * HW_RTC_SR - RTC Status Register
723 ******************************************************************************/
726 * @brief HW_RTC_SR - RTC Status Register (RW)
728 * Reset value: 0x00000001U
730 typedef union _hw_rtc_sr
733 struct _hw_rtc_sr_bitfields
735 uint32_t TIF
: 1; /*!< [0] Time Invalid Flag */
736 uint32_t TOF
: 1; /*!< [1] Time Overflow Flag */
737 uint32_t TAF
: 1; /*!< [2] Time Alarm Flag */
738 uint32_t RESERVED0
: 1; /*!< [3] */
739 uint32_t TCE
: 1; /*!< [4] Time Counter Enable */
740 uint32_t RESERVED1
: 27; /*!< [31:5] */
745 * @name Constants and macros for entire RTC_SR register
748 #define HW_RTC_SR_ADDR(x) ((x) + 0x14U)
750 #define HW_RTC_SR(x) (*(__IO hw_rtc_sr_t *) HW_RTC_SR_ADDR(x))
751 #define HW_RTC_SR_RD(x) (HW_RTC_SR(x).U)
752 #define HW_RTC_SR_WR(x, v) (HW_RTC_SR(x).U = (v))
753 #define HW_RTC_SR_SET(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) | (v)))
754 #define HW_RTC_SR_CLR(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) & ~(v)))
755 #define HW_RTC_SR_TOG(x, v) (HW_RTC_SR_WR(x, HW_RTC_SR_RD(x) ^ (v)))
759 * Constants & macros for individual RTC_SR bitfields
763 * @name Register RTC_SR, field TIF[0] (RO)
765 * The time invalid flag is set on VBAT POR or software reset. The TSR and TPR
766 * do not increment and read as zero when this bit is set. This bit is cleared by
767 * writing the TSR register when the time counter is disabled.
770 * - 0 - Time is valid.
771 * - 1 - Time is invalid and time counter is read as zero.
774 #define BP_RTC_SR_TIF (0U) /*!< Bit position for RTC_SR_TIF. */
775 #define BM_RTC_SR_TIF (0x00000001U) /*!< Bit mask for RTC_SR_TIF. */
776 #define BS_RTC_SR_TIF (1U) /*!< Bit field size in bits for RTC_SR_TIF. */
778 /*! @brief Read current value of the RTC_SR_TIF field. */
779 #define BR_RTC_SR_TIF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TIF))
783 * @name Register RTC_SR, field TOF[1] (RO)
785 * Time overflow flag is set when the time counter is enabled and overflows. The
786 * TSR and TPR do not increment and read as zero when this bit is set. This bit
787 * is cleared by writing the TSR register when the time counter is disabled.
790 * - 0 - Time overflow has not occurred.
791 * - 1 - Time overflow has occurred and time counter is read as zero.
794 #define BP_RTC_SR_TOF (1U) /*!< Bit position for RTC_SR_TOF. */
795 #define BM_RTC_SR_TOF (0x00000002U) /*!< Bit mask for RTC_SR_TOF. */
796 #define BS_RTC_SR_TOF (1U) /*!< Bit field size in bits for RTC_SR_TOF. */
798 /*! @brief Read current value of the RTC_SR_TOF field. */
799 #define BR_RTC_SR_TOF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TOF))
803 * @name Register RTC_SR, field TAF[2] (RO)
805 * Time alarm flag is set when the TAR[TAR] equals the TSR[TSR] and the TSR[TSR]
806 * increments. This bit is cleared by writing the TAR register.
809 * - 0 - Time alarm has not occurred.
810 * - 1 - Time alarm has occurred.
813 #define BP_RTC_SR_TAF (2U) /*!< Bit position for RTC_SR_TAF. */
814 #define BM_RTC_SR_TAF (0x00000004U) /*!< Bit mask for RTC_SR_TAF. */
815 #define BS_RTC_SR_TAF (1U) /*!< Bit field size in bits for RTC_SR_TAF. */
817 /*! @brief Read current value of the RTC_SR_TAF field. */
818 #define BR_RTC_SR_TAF(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TAF))
822 * @name Register RTC_SR, field TCE[4] (RW)
824 * When time counter is disabled the TSR register and TPR register are
825 * writeable, but do not increment. When time counter is enabled the TSR register and TPR
826 * register are not writeable, but increment.
829 * - 0 - Time counter is disabled.
830 * - 1 - Time counter is enabled.
833 #define BP_RTC_SR_TCE (4U) /*!< Bit position for RTC_SR_TCE. */
834 #define BM_RTC_SR_TCE (0x00000010U) /*!< Bit mask for RTC_SR_TCE. */
835 #define BS_RTC_SR_TCE (1U) /*!< Bit field size in bits for RTC_SR_TCE. */
837 /*! @brief Read current value of the RTC_SR_TCE field. */
838 #define BR_RTC_SR_TCE(x) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TCE))
840 /*! @brief Format value for bitfield RTC_SR_TCE. */
841 #define BF_RTC_SR_TCE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_SR_TCE) & BM_RTC_SR_TCE)
843 /*! @brief Set the TCE field to a new value. */
844 #define BW_RTC_SR_TCE(x, v) (BITBAND_ACCESS32(HW_RTC_SR_ADDR(x), BP_RTC_SR_TCE) = (v))
847 /*******************************************************************************
848 * HW_RTC_LR - RTC Lock Register
849 ******************************************************************************/
852 * @brief HW_RTC_LR - RTC Lock Register (RW)
854 * Reset value: 0x000000FFU
856 typedef union _hw_rtc_lr
859 struct _hw_rtc_lr_bitfields
861 uint32_t RESERVED0
: 3; /*!< [2:0] */
862 uint32_t TCL
: 1; /*!< [3] Time Compensation Lock */
863 uint32_t CRL
: 1; /*!< [4] Control Register Lock */
864 uint32_t SRL
: 1; /*!< [5] Status Register Lock */
865 uint32_t LRL
: 1; /*!< [6] Lock Register Lock */
866 uint32_t RESERVED1
: 25; /*!< [31:7] */
871 * @name Constants and macros for entire RTC_LR register
874 #define HW_RTC_LR_ADDR(x) ((x) + 0x18U)
876 #define HW_RTC_LR(x) (*(__IO hw_rtc_lr_t *) HW_RTC_LR_ADDR(x))
877 #define HW_RTC_LR_RD(x) (HW_RTC_LR(x).U)
878 #define HW_RTC_LR_WR(x, v) (HW_RTC_LR(x).U = (v))
879 #define HW_RTC_LR_SET(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) | (v)))
880 #define HW_RTC_LR_CLR(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) & ~(v)))
881 #define HW_RTC_LR_TOG(x, v) (HW_RTC_LR_WR(x, HW_RTC_LR_RD(x) ^ (v)))
885 * Constants & macros for individual RTC_LR bitfields
889 * @name Register RTC_LR, field TCL[3] (RW)
891 * After being cleared, this bit can be set only by VBAT POR or software reset.
894 * - 0 - Time Compensation Register is locked and writes are ignored.
895 * - 1 - Time Compensation Register is not locked and writes complete as normal.
898 #define BP_RTC_LR_TCL (3U) /*!< Bit position for RTC_LR_TCL. */
899 #define BM_RTC_LR_TCL (0x00000008U) /*!< Bit mask for RTC_LR_TCL. */
900 #define BS_RTC_LR_TCL (1U) /*!< Bit field size in bits for RTC_LR_TCL. */
902 /*! @brief Read current value of the RTC_LR_TCL field. */
903 #define BR_RTC_LR_TCL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_TCL))
905 /*! @brief Format value for bitfield RTC_LR_TCL. */
906 #define BF_RTC_LR_TCL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_TCL) & BM_RTC_LR_TCL)
908 /*! @brief Set the TCL field to a new value. */
909 #define BW_RTC_LR_TCL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_TCL) = (v))
913 * @name Register RTC_LR, field CRL[4] (RW)
915 * After being cleared, this bit can only be set by VBAT POR.
918 * - 0 - Control Register is locked and writes are ignored.
919 * - 1 - Control Register is not locked and writes complete as normal.
922 #define BP_RTC_LR_CRL (4U) /*!< Bit position for RTC_LR_CRL. */
923 #define BM_RTC_LR_CRL (0x00000010U) /*!< Bit mask for RTC_LR_CRL. */
924 #define BS_RTC_LR_CRL (1U) /*!< Bit field size in bits for RTC_LR_CRL. */
926 /*! @brief Read current value of the RTC_LR_CRL field. */
927 #define BR_RTC_LR_CRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_CRL))
929 /*! @brief Format value for bitfield RTC_LR_CRL. */
930 #define BF_RTC_LR_CRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_CRL) & BM_RTC_LR_CRL)
932 /*! @brief Set the CRL field to a new value. */
933 #define BW_RTC_LR_CRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_CRL) = (v))
937 * @name Register RTC_LR, field SRL[5] (RW)
939 * After being cleared, this bit can be set only by VBAT POR or software reset.
942 * - 0 - Status Register is locked and writes are ignored.
943 * - 1 - Status Register is not locked and writes complete as normal.
946 #define BP_RTC_LR_SRL (5U) /*!< Bit position for RTC_LR_SRL. */
947 #define BM_RTC_LR_SRL (0x00000020U) /*!< Bit mask for RTC_LR_SRL. */
948 #define BS_RTC_LR_SRL (1U) /*!< Bit field size in bits for RTC_LR_SRL. */
950 /*! @brief Read current value of the RTC_LR_SRL field. */
951 #define BR_RTC_LR_SRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_SRL))
953 /*! @brief Format value for bitfield RTC_LR_SRL. */
954 #define BF_RTC_LR_SRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_SRL) & BM_RTC_LR_SRL)
956 /*! @brief Set the SRL field to a new value. */
957 #define BW_RTC_LR_SRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_SRL) = (v))
961 * @name Register RTC_LR, field LRL[6] (RW)
963 * After being cleared, this bit can be set only by VBAT POR or software reset.
966 * - 0 - Lock Register is locked and writes are ignored.
967 * - 1 - Lock Register is not locked and writes complete as normal.
970 #define BP_RTC_LR_LRL (6U) /*!< Bit position for RTC_LR_LRL. */
971 #define BM_RTC_LR_LRL (0x00000040U) /*!< Bit mask for RTC_LR_LRL. */
972 #define BS_RTC_LR_LRL (1U) /*!< Bit field size in bits for RTC_LR_LRL. */
974 /*! @brief Read current value of the RTC_LR_LRL field. */
975 #define BR_RTC_LR_LRL(x) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_LRL))
977 /*! @brief Format value for bitfield RTC_LR_LRL. */
978 #define BF_RTC_LR_LRL(v) ((uint32_t)((uint32_t)(v) << BP_RTC_LR_LRL) & BM_RTC_LR_LRL)
980 /*! @brief Set the LRL field to a new value. */
981 #define BW_RTC_LR_LRL(x, v) (BITBAND_ACCESS32(HW_RTC_LR_ADDR(x), BP_RTC_LR_LRL) = (v))
984 /*******************************************************************************
985 * HW_RTC_IER - RTC Interrupt Enable Register
986 ******************************************************************************/
989 * @brief HW_RTC_IER - RTC Interrupt Enable Register (RW)
991 * Reset value: 0x00000007U
993 typedef union _hw_rtc_ier
996 struct _hw_rtc_ier_bitfields
998 uint32_t TIIE
: 1; /*!< [0] Time Invalid Interrupt Enable */
999 uint32_t TOIE
: 1; /*!< [1] Time Overflow Interrupt Enable */
1000 uint32_t TAIE
: 1; /*!< [2] Time Alarm Interrupt Enable */
1001 uint32_t RESERVED0
: 1; /*!< [3] */
1002 uint32_t TSIE
: 1; /*!< [4] Time Seconds Interrupt Enable */
1003 uint32_t RESERVED1
: 2; /*!< [6:5] */
1004 uint32_t WPON
: 1; /*!< [7] Wakeup Pin On */
1005 uint32_t RESERVED2
: 24; /*!< [31:8] */
1010 * @name Constants and macros for entire RTC_IER register
1013 #define HW_RTC_IER_ADDR(x) ((x) + 0x1CU)
1015 #define HW_RTC_IER(x) (*(__IO hw_rtc_ier_t *) HW_RTC_IER_ADDR(x))
1016 #define HW_RTC_IER_RD(x) (HW_RTC_IER(x).U)
1017 #define HW_RTC_IER_WR(x, v) (HW_RTC_IER(x).U = (v))
1018 #define HW_RTC_IER_SET(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) | (v)))
1019 #define HW_RTC_IER_CLR(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) & ~(v)))
1020 #define HW_RTC_IER_TOG(x, v) (HW_RTC_IER_WR(x, HW_RTC_IER_RD(x) ^ (v)))
1024 * Constants & macros for individual RTC_IER bitfields
1028 * @name Register RTC_IER, field TIIE[0] (RW)
1031 * - 0 - Time invalid flag does not generate an interrupt.
1032 * - 1 - Time invalid flag does generate an interrupt.
1035 #define BP_RTC_IER_TIIE (0U) /*!< Bit position for RTC_IER_TIIE. */
1036 #define BM_RTC_IER_TIIE (0x00000001U) /*!< Bit mask for RTC_IER_TIIE. */
1037 #define BS_RTC_IER_TIIE (1U) /*!< Bit field size in bits for RTC_IER_TIIE. */
1039 /*! @brief Read current value of the RTC_IER_TIIE field. */
1040 #define BR_RTC_IER_TIIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TIIE))
1042 /*! @brief Format value for bitfield RTC_IER_TIIE. */
1043 #define BF_RTC_IER_TIIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TIIE) & BM_RTC_IER_TIIE)
1045 /*! @brief Set the TIIE field to a new value. */
1046 #define BW_RTC_IER_TIIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TIIE) = (v))
1050 * @name Register RTC_IER, field TOIE[1] (RW)
1053 * - 0 - Time overflow flag does not generate an interrupt.
1054 * - 1 - Time overflow flag does generate an interrupt.
1057 #define BP_RTC_IER_TOIE (1U) /*!< Bit position for RTC_IER_TOIE. */
1058 #define BM_RTC_IER_TOIE (0x00000002U) /*!< Bit mask for RTC_IER_TOIE. */
1059 #define BS_RTC_IER_TOIE (1U) /*!< Bit field size in bits for RTC_IER_TOIE. */
1061 /*! @brief Read current value of the RTC_IER_TOIE field. */
1062 #define BR_RTC_IER_TOIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TOIE))
1064 /*! @brief Format value for bitfield RTC_IER_TOIE. */
1065 #define BF_RTC_IER_TOIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TOIE) & BM_RTC_IER_TOIE)
1067 /*! @brief Set the TOIE field to a new value. */
1068 #define BW_RTC_IER_TOIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TOIE) = (v))
1072 * @name Register RTC_IER, field TAIE[2] (RW)
1075 * - 0 - Time alarm flag does not generate an interrupt.
1076 * - 1 - Time alarm flag does generate an interrupt.
1079 #define BP_RTC_IER_TAIE (2U) /*!< Bit position for RTC_IER_TAIE. */
1080 #define BM_RTC_IER_TAIE (0x00000004U) /*!< Bit mask for RTC_IER_TAIE. */
1081 #define BS_RTC_IER_TAIE (1U) /*!< Bit field size in bits for RTC_IER_TAIE. */
1083 /*! @brief Read current value of the RTC_IER_TAIE field. */
1084 #define BR_RTC_IER_TAIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TAIE))
1086 /*! @brief Format value for bitfield RTC_IER_TAIE. */
1087 #define BF_RTC_IER_TAIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TAIE) & BM_RTC_IER_TAIE)
1089 /*! @brief Set the TAIE field to a new value. */
1090 #define BW_RTC_IER_TAIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TAIE) = (v))
1094 * @name Register RTC_IER, field TSIE[4] (RW)
1096 * The seconds interrupt is an edge-sensitive interrupt with a dedicated
1097 * interrupt vector. It is generated once a second and requires no software overhead
1098 * (there is no corresponding status flag to clear).
1101 * - 0 - Seconds interrupt is disabled.
1102 * - 1 - Seconds interrupt is enabled.
1105 #define BP_RTC_IER_TSIE (4U) /*!< Bit position for RTC_IER_TSIE. */
1106 #define BM_RTC_IER_TSIE (0x00000010U) /*!< Bit mask for RTC_IER_TSIE. */
1107 #define BS_RTC_IER_TSIE (1U) /*!< Bit field size in bits for RTC_IER_TSIE. */
1109 /*! @brief Read current value of the RTC_IER_TSIE field. */
1110 #define BR_RTC_IER_TSIE(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TSIE))
1112 /*! @brief Format value for bitfield RTC_IER_TSIE. */
1113 #define BF_RTC_IER_TSIE(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_TSIE) & BM_RTC_IER_TSIE)
1115 /*! @brief Set the TSIE field to a new value. */
1116 #define BW_RTC_IER_TSIE(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_TSIE) = (v))
1120 * @name Register RTC_IER, field WPON[7] (RW)
1122 * The wakeup pin is optional and not available on all devices. Whenever the
1123 * wakeup pin is enabled and this bit is set, the wakeup pin will assert.
1127 * - 1 - If the wakeup pin is enabled, then the wakeup pin will assert.
1130 #define BP_RTC_IER_WPON (7U) /*!< Bit position for RTC_IER_WPON. */
1131 #define BM_RTC_IER_WPON (0x00000080U) /*!< Bit mask for RTC_IER_WPON. */
1132 #define BS_RTC_IER_WPON (1U) /*!< Bit field size in bits for RTC_IER_WPON. */
1134 /*! @brief Read current value of the RTC_IER_WPON field. */
1135 #define BR_RTC_IER_WPON(x) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_WPON))
1137 /*! @brief Format value for bitfield RTC_IER_WPON. */
1138 #define BF_RTC_IER_WPON(v) ((uint32_t)((uint32_t)(v) << BP_RTC_IER_WPON) & BM_RTC_IER_WPON)
1140 /*! @brief Set the WPON field to a new value. */
1141 #define BW_RTC_IER_WPON(x, v) (BITBAND_ACCESS32(HW_RTC_IER_ADDR(x), BP_RTC_IER_WPON) = (v))
1144 /*******************************************************************************
1145 * HW_RTC_WAR - RTC Write Access Register
1146 ******************************************************************************/
1149 * @brief HW_RTC_WAR - RTC Write Access Register (RW)
1151 * Reset value: 0x000000FFU
1153 typedef union _hw_rtc_war
1156 struct _hw_rtc_war_bitfields
1158 uint32_t TSRW
: 1; /*!< [0] Time Seconds Register Write */
1159 uint32_t TPRW
: 1; /*!< [1] Time Prescaler Register Write */
1160 uint32_t TARW
: 1; /*!< [2] Time Alarm Register Write */
1161 uint32_t TCRW
: 1; /*!< [3] Time Compensation Register Write */
1162 uint32_t CRW
: 1; /*!< [4] Control Register Write */
1163 uint32_t SRW
: 1; /*!< [5] Status Register Write */
1164 uint32_t LRW
: 1; /*!< [6] Lock Register Write */
1165 uint32_t IERW
: 1; /*!< [7] Interrupt Enable Register Write */
1166 uint32_t RESERVED0
: 24; /*!< [31:8] */
1171 * @name Constants and macros for entire RTC_WAR register
1174 #define HW_RTC_WAR_ADDR(x) ((x) + 0x800U)
1176 #define HW_RTC_WAR(x) (*(__IO hw_rtc_war_t *) HW_RTC_WAR_ADDR(x))
1177 #define HW_RTC_WAR_RD(x) (HW_RTC_WAR(x).U)
1178 #define HW_RTC_WAR_WR(x, v) (HW_RTC_WAR(x).U = (v))
1179 #define HW_RTC_WAR_SET(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) | (v)))
1180 #define HW_RTC_WAR_CLR(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) & ~(v)))
1181 #define HW_RTC_WAR_TOG(x, v) (HW_RTC_WAR_WR(x, HW_RTC_WAR_RD(x) ^ (v)))
1185 * Constants & macros for individual RTC_WAR bitfields
1189 * @name Register RTC_WAR, field TSRW[0] (RW)
1191 * After being cleared, this bit is set only by system reset. It is not affected
1192 * by VBAT POR or software reset.
1195 * - 0 - Writes to the Time Seconds Register are ignored.
1196 * - 1 - Writes to the Time Seconds Register complete as normal.
1199 #define BP_RTC_WAR_TSRW (0U) /*!< Bit position for RTC_WAR_TSRW. */
1200 #define BM_RTC_WAR_TSRW (0x00000001U) /*!< Bit mask for RTC_WAR_TSRW. */
1201 #define BS_RTC_WAR_TSRW (1U) /*!< Bit field size in bits for RTC_WAR_TSRW. */
1203 /*! @brief Read current value of the RTC_WAR_TSRW field. */
1204 #define BR_RTC_WAR_TSRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TSRW))
1206 /*! @brief Format value for bitfield RTC_WAR_TSRW. */
1207 #define BF_RTC_WAR_TSRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TSRW) & BM_RTC_WAR_TSRW)
1209 /*! @brief Set the TSRW field to a new value. */
1210 #define BW_RTC_WAR_TSRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TSRW) = (v))
1214 * @name Register RTC_WAR, field TPRW[1] (RW)
1216 * After being cleared, this bit is set only by system reset. It is not affected
1217 * by VBAT POR or software reset.
1220 * - 0 - Writes to the Time Prescaler Register are ignored.
1221 * - 1 - Writes to the Time Prescaler Register complete as normal.
1224 #define BP_RTC_WAR_TPRW (1U) /*!< Bit position for RTC_WAR_TPRW. */
1225 #define BM_RTC_WAR_TPRW (0x00000002U) /*!< Bit mask for RTC_WAR_TPRW. */
1226 #define BS_RTC_WAR_TPRW (1U) /*!< Bit field size in bits for RTC_WAR_TPRW. */
1228 /*! @brief Read current value of the RTC_WAR_TPRW field. */
1229 #define BR_RTC_WAR_TPRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TPRW))
1231 /*! @brief Format value for bitfield RTC_WAR_TPRW. */
1232 #define BF_RTC_WAR_TPRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TPRW) & BM_RTC_WAR_TPRW)
1234 /*! @brief Set the TPRW field to a new value. */
1235 #define BW_RTC_WAR_TPRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TPRW) = (v))
1239 * @name Register RTC_WAR, field TARW[2] (RW)
1241 * After being cleared, this bit is set only by system reset. It is not affected
1242 * by VBAT POR or software reset.
1245 * - 0 - Writes to the Time Alarm Register are ignored.
1246 * - 1 - Writes to the Time Alarm Register complete as normal.
1249 #define BP_RTC_WAR_TARW (2U) /*!< Bit position for RTC_WAR_TARW. */
1250 #define BM_RTC_WAR_TARW (0x00000004U) /*!< Bit mask for RTC_WAR_TARW. */
1251 #define BS_RTC_WAR_TARW (1U) /*!< Bit field size in bits for RTC_WAR_TARW. */
1253 /*! @brief Read current value of the RTC_WAR_TARW field. */
1254 #define BR_RTC_WAR_TARW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TARW))
1256 /*! @brief Format value for bitfield RTC_WAR_TARW. */
1257 #define BF_RTC_WAR_TARW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TARW) & BM_RTC_WAR_TARW)
1259 /*! @brief Set the TARW field to a new value. */
1260 #define BW_RTC_WAR_TARW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TARW) = (v))
1264 * @name Register RTC_WAR, field TCRW[3] (RW)
1266 * After being cleared, this bit is set only by system reset. It is not affected
1267 * by VBAT POR or software reset.
1270 * - 0 - Writes to the Time Compensation Register are ignored.
1271 * - 1 - Writes to the Time Compensation Register complete as normal.
1274 #define BP_RTC_WAR_TCRW (3U) /*!< Bit position for RTC_WAR_TCRW. */
1275 #define BM_RTC_WAR_TCRW (0x00000008U) /*!< Bit mask for RTC_WAR_TCRW. */
1276 #define BS_RTC_WAR_TCRW (1U) /*!< Bit field size in bits for RTC_WAR_TCRW. */
1278 /*! @brief Read current value of the RTC_WAR_TCRW field. */
1279 #define BR_RTC_WAR_TCRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TCRW))
1281 /*! @brief Format value for bitfield RTC_WAR_TCRW. */
1282 #define BF_RTC_WAR_TCRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_TCRW) & BM_RTC_WAR_TCRW)
1284 /*! @brief Set the TCRW field to a new value. */
1285 #define BW_RTC_WAR_TCRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_TCRW) = (v))
1289 * @name Register RTC_WAR, field CRW[4] (RW)
1291 * After being cleared, this bit is set only by system reset. It is not affected
1292 * by VBAT POR or software reset.
1295 * - 0 - Writes to the Control Register are ignored.
1296 * - 1 - Writes to the Control Register complete as normal.
1299 #define BP_RTC_WAR_CRW (4U) /*!< Bit position for RTC_WAR_CRW. */
1300 #define BM_RTC_WAR_CRW (0x00000010U) /*!< Bit mask for RTC_WAR_CRW. */
1301 #define BS_RTC_WAR_CRW (1U) /*!< Bit field size in bits for RTC_WAR_CRW. */
1303 /*! @brief Read current value of the RTC_WAR_CRW field. */
1304 #define BR_RTC_WAR_CRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_CRW))
1306 /*! @brief Format value for bitfield RTC_WAR_CRW. */
1307 #define BF_RTC_WAR_CRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_CRW) & BM_RTC_WAR_CRW)
1309 /*! @brief Set the CRW field to a new value. */
1310 #define BW_RTC_WAR_CRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_CRW) = (v))
1314 * @name Register RTC_WAR, field SRW[5] (RW)
1316 * After being cleared, this bit is set only by system reset. It is not affected
1317 * by VBAT POR or software reset.
1320 * - 0 - Writes to the Status Register are ignored.
1321 * - 1 - Writes to the Status Register complete as normal.
1324 #define BP_RTC_WAR_SRW (5U) /*!< Bit position for RTC_WAR_SRW. */
1325 #define BM_RTC_WAR_SRW (0x00000020U) /*!< Bit mask for RTC_WAR_SRW. */
1326 #define BS_RTC_WAR_SRW (1U) /*!< Bit field size in bits for RTC_WAR_SRW. */
1328 /*! @brief Read current value of the RTC_WAR_SRW field. */
1329 #define BR_RTC_WAR_SRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_SRW))
1331 /*! @brief Format value for bitfield RTC_WAR_SRW. */
1332 #define BF_RTC_WAR_SRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_SRW) & BM_RTC_WAR_SRW)
1334 /*! @brief Set the SRW field to a new value. */
1335 #define BW_RTC_WAR_SRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_SRW) = (v))
1339 * @name Register RTC_WAR, field LRW[6] (RW)
1341 * After being cleared, this bit is set only by system reset. It is not affected
1342 * by VBAT POR or software reset.
1345 * - 0 - Writes to the Lock Register are ignored.
1346 * - 1 - Writes to the Lock Register complete as normal.
1349 #define BP_RTC_WAR_LRW (6U) /*!< Bit position for RTC_WAR_LRW. */
1350 #define BM_RTC_WAR_LRW (0x00000040U) /*!< Bit mask for RTC_WAR_LRW. */
1351 #define BS_RTC_WAR_LRW (1U) /*!< Bit field size in bits for RTC_WAR_LRW. */
1353 /*! @brief Read current value of the RTC_WAR_LRW field. */
1354 #define BR_RTC_WAR_LRW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_LRW))
1356 /*! @brief Format value for bitfield RTC_WAR_LRW. */
1357 #define BF_RTC_WAR_LRW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_LRW) & BM_RTC_WAR_LRW)
1359 /*! @brief Set the LRW field to a new value. */
1360 #define BW_RTC_WAR_LRW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_LRW) = (v))
1364 * @name Register RTC_WAR, field IERW[7] (RW)
1366 * After being cleared, this bit is set only by system reset. It is not affected
1367 * by VBAT POR or software reset.
1370 * - 0 - Writes to the Interupt Enable Register are ignored.
1371 * - 1 - Writes to the Interrupt Enable Register complete as normal.
1374 #define BP_RTC_WAR_IERW (7U) /*!< Bit position for RTC_WAR_IERW. */
1375 #define BM_RTC_WAR_IERW (0x00000080U) /*!< Bit mask for RTC_WAR_IERW. */
1376 #define BS_RTC_WAR_IERW (1U) /*!< Bit field size in bits for RTC_WAR_IERW. */
1378 /*! @brief Read current value of the RTC_WAR_IERW field. */
1379 #define BR_RTC_WAR_IERW(x) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_IERW))
1381 /*! @brief Format value for bitfield RTC_WAR_IERW. */
1382 #define BF_RTC_WAR_IERW(v) ((uint32_t)((uint32_t)(v) << BP_RTC_WAR_IERW) & BM_RTC_WAR_IERW)
1384 /*! @brief Set the IERW field to a new value. */
1385 #define BW_RTC_WAR_IERW(x, v) (BITBAND_ACCESS32(HW_RTC_WAR_ADDR(x), BP_RTC_WAR_IERW) = (v))
1388 /*******************************************************************************
1389 * HW_RTC_RAR - RTC Read Access Register
1390 ******************************************************************************/
1393 * @brief HW_RTC_RAR - RTC Read Access Register (RW)
1395 * Reset value: 0x000000FFU
1397 typedef union _hw_rtc_rar
1400 struct _hw_rtc_rar_bitfields
1402 uint32_t TSRR
: 1; /*!< [0] Time Seconds Register Read */
1403 uint32_t TPRR
: 1; /*!< [1] Time Prescaler Register Read */
1404 uint32_t TARR
: 1; /*!< [2] Time Alarm Register Read */
1405 uint32_t TCRR
: 1; /*!< [3] Time Compensation Register Read */
1406 uint32_t CRR
: 1; /*!< [4] Control Register Read */
1407 uint32_t SRR
: 1; /*!< [5] Status Register Read */
1408 uint32_t LRR
: 1; /*!< [6] Lock Register Read */
1409 uint32_t IERR
: 1; /*!< [7] Interrupt Enable Register Read */
1410 uint32_t RESERVED0
: 24; /*!< [31:8] */
1415 * @name Constants and macros for entire RTC_RAR register
1418 #define HW_RTC_RAR_ADDR(x) ((x) + 0x804U)
1420 #define HW_RTC_RAR(x) (*(__IO hw_rtc_rar_t *) HW_RTC_RAR_ADDR(x))
1421 #define HW_RTC_RAR_RD(x) (HW_RTC_RAR(x).U)
1422 #define HW_RTC_RAR_WR(x, v) (HW_RTC_RAR(x).U = (v))
1423 #define HW_RTC_RAR_SET(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) | (v)))
1424 #define HW_RTC_RAR_CLR(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) & ~(v)))
1425 #define HW_RTC_RAR_TOG(x, v) (HW_RTC_RAR_WR(x, HW_RTC_RAR_RD(x) ^ (v)))
1429 * Constants & macros for individual RTC_RAR bitfields
1433 * @name Register RTC_RAR, field TSRR[0] (RW)
1435 * After being cleared, this bit is set only by system reset. It is not affected
1436 * by VBAT POR or software reset.
1439 * - 0 - Reads to the Time Seconds Register are ignored.
1440 * - 1 - Reads to the Time Seconds Register complete as normal.
1443 #define BP_RTC_RAR_TSRR (0U) /*!< Bit position for RTC_RAR_TSRR. */
1444 #define BM_RTC_RAR_TSRR (0x00000001U) /*!< Bit mask for RTC_RAR_TSRR. */
1445 #define BS_RTC_RAR_TSRR (1U) /*!< Bit field size in bits for RTC_RAR_TSRR. */
1447 /*! @brief Read current value of the RTC_RAR_TSRR field. */
1448 #define BR_RTC_RAR_TSRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TSRR))
1450 /*! @brief Format value for bitfield RTC_RAR_TSRR. */
1451 #define BF_RTC_RAR_TSRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TSRR) & BM_RTC_RAR_TSRR)
1453 /*! @brief Set the TSRR field to a new value. */
1454 #define BW_RTC_RAR_TSRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TSRR) = (v))
1458 * @name Register RTC_RAR, field TPRR[1] (RW)
1460 * After being cleared, this bit is set only by system reset. It is not affected
1461 * by VBAT POR or software reset.
1464 * - 0 - Reads to the Time Pprescaler Register are ignored.
1465 * - 1 - Reads to the Time Prescaler Register complete as normal.
1468 #define BP_RTC_RAR_TPRR (1U) /*!< Bit position for RTC_RAR_TPRR. */
1469 #define BM_RTC_RAR_TPRR (0x00000002U) /*!< Bit mask for RTC_RAR_TPRR. */
1470 #define BS_RTC_RAR_TPRR (1U) /*!< Bit field size in bits for RTC_RAR_TPRR. */
1472 /*! @brief Read current value of the RTC_RAR_TPRR field. */
1473 #define BR_RTC_RAR_TPRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TPRR))
1475 /*! @brief Format value for bitfield RTC_RAR_TPRR. */
1476 #define BF_RTC_RAR_TPRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TPRR) & BM_RTC_RAR_TPRR)
1478 /*! @brief Set the TPRR field to a new value. */
1479 #define BW_RTC_RAR_TPRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TPRR) = (v))
1483 * @name Register RTC_RAR, field TARR[2] (RW)
1485 * After being cleared, this bit is set only by system reset. It is not affected
1486 * by VBAT POR or software reset.
1489 * - 0 - Reads to the Time Alarm Register are ignored.
1490 * - 1 - Reads to the Time Alarm Register complete as normal.
1493 #define BP_RTC_RAR_TARR (2U) /*!< Bit position for RTC_RAR_TARR. */
1494 #define BM_RTC_RAR_TARR (0x00000004U) /*!< Bit mask for RTC_RAR_TARR. */
1495 #define BS_RTC_RAR_TARR (1U) /*!< Bit field size in bits for RTC_RAR_TARR. */
1497 /*! @brief Read current value of the RTC_RAR_TARR field. */
1498 #define BR_RTC_RAR_TARR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TARR))
1500 /*! @brief Format value for bitfield RTC_RAR_TARR. */
1501 #define BF_RTC_RAR_TARR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TARR) & BM_RTC_RAR_TARR)
1503 /*! @brief Set the TARR field to a new value. */
1504 #define BW_RTC_RAR_TARR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TARR) = (v))
1508 * @name Register RTC_RAR, field TCRR[3] (RW)
1510 * After being cleared, this bit is set only by system reset. It is not affected
1511 * by VBAT POR or software reset.
1514 * - 0 - Reads to the Time Compensation Register are ignored.
1515 * - 1 - Reads to the Time Compensation Register complete as normal.
1518 #define BP_RTC_RAR_TCRR (3U) /*!< Bit position for RTC_RAR_TCRR. */
1519 #define BM_RTC_RAR_TCRR (0x00000008U) /*!< Bit mask for RTC_RAR_TCRR. */
1520 #define BS_RTC_RAR_TCRR (1U) /*!< Bit field size in bits for RTC_RAR_TCRR. */
1522 /*! @brief Read current value of the RTC_RAR_TCRR field. */
1523 #define BR_RTC_RAR_TCRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TCRR))
1525 /*! @brief Format value for bitfield RTC_RAR_TCRR. */
1526 #define BF_RTC_RAR_TCRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_TCRR) & BM_RTC_RAR_TCRR)
1528 /*! @brief Set the TCRR field to a new value. */
1529 #define BW_RTC_RAR_TCRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_TCRR) = (v))
1533 * @name Register RTC_RAR, field CRR[4] (RW)
1535 * After being cleared, this bit is set only by system reset. It is not affected
1536 * by VBAT POR or software reset.
1539 * - 0 - Reads to the Control Register are ignored.
1540 * - 1 - Reads to the Control Register complete as normal.
1543 #define BP_RTC_RAR_CRR (4U) /*!< Bit position for RTC_RAR_CRR. */
1544 #define BM_RTC_RAR_CRR (0x00000010U) /*!< Bit mask for RTC_RAR_CRR. */
1545 #define BS_RTC_RAR_CRR (1U) /*!< Bit field size in bits for RTC_RAR_CRR. */
1547 /*! @brief Read current value of the RTC_RAR_CRR field. */
1548 #define BR_RTC_RAR_CRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_CRR))
1550 /*! @brief Format value for bitfield RTC_RAR_CRR. */
1551 #define BF_RTC_RAR_CRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_CRR) & BM_RTC_RAR_CRR)
1553 /*! @brief Set the CRR field to a new value. */
1554 #define BW_RTC_RAR_CRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_CRR) = (v))
1558 * @name Register RTC_RAR, field SRR[5] (RW)
1560 * After being cleared, this bit is set only by system reset. It is not affected
1561 * by VBAT POR or software reset.
1564 * - 0 - Reads to the Status Register are ignored.
1565 * - 1 - Reads to the Status Register complete as normal.
1568 #define BP_RTC_RAR_SRR (5U) /*!< Bit position for RTC_RAR_SRR. */
1569 #define BM_RTC_RAR_SRR (0x00000020U) /*!< Bit mask for RTC_RAR_SRR. */
1570 #define BS_RTC_RAR_SRR (1U) /*!< Bit field size in bits for RTC_RAR_SRR. */
1572 /*! @brief Read current value of the RTC_RAR_SRR field. */
1573 #define BR_RTC_RAR_SRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_SRR))
1575 /*! @brief Format value for bitfield RTC_RAR_SRR. */
1576 #define BF_RTC_RAR_SRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_SRR) & BM_RTC_RAR_SRR)
1578 /*! @brief Set the SRR field to a new value. */
1579 #define BW_RTC_RAR_SRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_SRR) = (v))
1583 * @name Register RTC_RAR, field LRR[6] (RW)
1585 * After being cleared, this bit is set only by system reset. It is not affected
1586 * by VBAT POR or software reset.
1589 * - 0 - Reads to the Lock Register are ignored.
1590 * - 1 - Reads to the Lock Register complete as normal.
1593 #define BP_RTC_RAR_LRR (6U) /*!< Bit position for RTC_RAR_LRR. */
1594 #define BM_RTC_RAR_LRR (0x00000040U) /*!< Bit mask for RTC_RAR_LRR. */
1595 #define BS_RTC_RAR_LRR (1U) /*!< Bit field size in bits for RTC_RAR_LRR. */
1597 /*! @brief Read current value of the RTC_RAR_LRR field. */
1598 #define BR_RTC_RAR_LRR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_LRR))
1600 /*! @brief Format value for bitfield RTC_RAR_LRR. */
1601 #define BF_RTC_RAR_LRR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_LRR) & BM_RTC_RAR_LRR)
1603 /*! @brief Set the LRR field to a new value. */
1604 #define BW_RTC_RAR_LRR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_LRR) = (v))
1608 * @name Register RTC_RAR, field IERR[7] (RW)
1610 * After being cleared, this bit is set only by system reset. It is not affected
1611 * by VBAT POR or software reset.
1614 * - 0 - Reads to the Interrupt Enable Register are ignored.
1615 * - 1 - Reads to the Interrupt Enable Register complete as normal.
1618 #define BP_RTC_RAR_IERR (7U) /*!< Bit position for RTC_RAR_IERR. */
1619 #define BM_RTC_RAR_IERR (0x00000080U) /*!< Bit mask for RTC_RAR_IERR. */
1620 #define BS_RTC_RAR_IERR (1U) /*!< Bit field size in bits for RTC_RAR_IERR. */
1622 /*! @brief Read current value of the RTC_RAR_IERR field. */
1623 #define BR_RTC_RAR_IERR(x) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_IERR))
1625 /*! @brief Format value for bitfield RTC_RAR_IERR. */
1626 #define BF_RTC_RAR_IERR(v) ((uint32_t)((uint32_t)(v) << BP_RTC_RAR_IERR) & BM_RTC_RAR_IERR)
1628 /*! @brief Set the IERR field to a new value. */
1629 #define BW_RTC_RAR_IERR(x, v) (BITBAND_ACCESS32(HW_RTC_RAR_ADDR(x), BP_RTC_RAR_IERR) = (v))
1632 /*******************************************************************************
1633 * hw_rtc_t - module struct
1634 ******************************************************************************/
1636 * @brief All RTC module registers.
1639 typedef struct _hw_rtc
1641 __IO hw_rtc_tsr_t TSR
; /*!< [0x0] RTC Time Seconds Register */
1642 __IO hw_rtc_tpr_t TPR
; /*!< [0x4] RTC Time Prescaler Register */
1643 __IO hw_rtc_tar_t TAR
; /*!< [0x8] RTC Time Alarm Register */
1644 __IO hw_rtc_tcr_t TCR
; /*!< [0xC] RTC Time Compensation Register */
1645 __IO hw_rtc_cr_t CR
; /*!< [0x10] RTC Control Register */
1646 __IO hw_rtc_sr_t SR
; /*!< [0x14] RTC Status Register */
1647 __IO hw_rtc_lr_t LR
; /*!< [0x18] RTC Lock Register */
1648 __IO hw_rtc_ier_t IER
; /*!< [0x1C] RTC Interrupt Enable Register */
1649 uint8_t _reserved0
[2016];
1650 __IO hw_rtc_war_t WAR
; /*!< [0x800] RTC Write Access Register */
1651 __IO hw_rtc_rar_t RAR
; /*!< [0x804] RTC Read Access Register */
1655 /*! @brief Macro to access all RTC registers. */
1656 /*! @param x RTC module instance base address. */
1657 /*! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
1658 * use the '&' operator, like <code>&HW_RTC(RTC_BASE)</code>. */
1659 #define HW_RTC(x) (*(hw_rtc_t *)(x))
1661 #endif /* __HW_RTC_REGISTERS_H__ */