1 /***************************************************************************//**
2 * \file cyip_backup.h
3 *
4 * \brief
5 * BACKUP IP definitions
6 *
7 ********************************************************************************
8 * \copyright
9 * (c) (2016-2023), Cypress Semiconductor Corporation (an Infineon company) or
10 * an affiliate of Cypress Semiconductor Corporation.
11 *
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License");
15 * you may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 *     http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 *******************************************************************************/
26 
27 #ifndef _CYIP_BACKUP_H_
28 #define _CYIP_BACKUP_H_
29 
30 #include "cyip_headers.h"
31 
32 /*******************************************************************************
33 *                                    BACKUP
34 *******************************************************************************/
35 
36 #define BACKUP_SECTION_SIZE                     0x00010000UL
37 
38 /**
39   * \brief SRSS Backup Domain (BACKUP)
40   */
41 typedef struct {
42   __IOM uint32_t CTL;                           /*!< 0x00000000 Control */
43    __IM uint32_t RESERVED;
44   __IOM uint32_t RTC_RW;                        /*!< 0x00000008 RTC Read Write register */
45   __IOM uint32_t CAL_CTL;                       /*!< 0x0000000C Oscillator calibration for absolute frequency */
46    __IM uint32_t STATUS;                        /*!< 0x00000010 Status */
47   __IOM uint32_t RTC_TIME;                      /*!< 0x00000014 Calendar Seconds, Minutes, Hours, Day of Week */
48   __IOM uint32_t RTC_DATE;                      /*!< 0x00000018 Calendar Day of Month, Month,  Year */
49   __IOM uint32_t ALM1_TIME;                     /*!< 0x0000001C Alarm 1 Seconds, Minute, Hours, Day of Week */
50   __IOM uint32_t ALM1_DATE;                     /*!< 0x00000020 Alarm 1 Day of Month, Month */
51   __IOM uint32_t ALM2_TIME;                     /*!< 0x00000024 Alarm 2 Seconds, Minute, Hours, Day of Week */
52   __IOM uint32_t ALM2_DATE;                     /*!< 0x00000028 Alarm 2 Day of Month, Month */
53   __IOM uint32_t INTR;                          /*!< 0x0000002C Interrupt request register */
54   __IOM uint32_t INTR_SET;                      /*!< 0x00000030 Interrupt set request register */
55   __IOM uint32_t INTR_MASK;                     /*!< 0x00000034 Interrupt mask register */
56    __IM uint32_t INTR_MASKED;                   /*!< 0x00000038 Interrupt masked request register */
57    __IM uint32_t OSCCNT;                        /*!< 0x0000003C 32kHz oscillator counter */
58    __IM uint32_t TICKS;                         /*!< 0x00000040 128Hz tick counter */
59   __IOM uint32_t PMIC_CTL;                      /*!< 0x00000044 PMIC control register */
60   __IOM uint32_t RESET;                         /*!< 0x00000048 Backup reset register */
61    __IM uint32_t RESERVED1[1005];
62   __IOM uint32_t BREG[64];                      /*!< 0x00001000 Backup register region */
63    __IM uint32_t RESERVED2[15232];
64   __IOM uint32_t TRIM;                          /*!< 0x0000FF00 Trim Register */
65 } BACKUP_V1_Type;                               /*!< Size = 65284 (0xFF04) */
66 
67 
68 /* BACKUP.CTL */
69 #define BACKUP_CTL_WCO_EN_Pos                   3UL
70 #define BACKUP_CTL_WCO_EN_Msk                   0x8UL
71 #define BACKUP_CTL_CLK_SEL_Pos                  8UL
72 #define BACKUP_CTL_CLK_SEL_Msk                  0x300UL
73 #define BACKUP_CTL_PRESCALER_Pos                12UL
74 #define BACKUP_CTL_PRESCALER_Msk                0x3000UL
75 #define BACKUP_CTL_WCO_BYPASS_Pos               16UL
76 #define BACKUP_CTL_WCO_BYPASS_Msk               0x10000UL
77 #define BACKUP_CTL_VDDBAK_CTL_Pos               17UL
78 #define BACKUP_CTL_VDDBAK_CTL_Msk               0x60000UL
79 #define BACKUP_CTL_VBACKUP_MEAS_Pos             19UL
80 #define BACKUP_CTL_VBACKUP_MEAS_Msk             0x80000UL
81 #define BACKUP_CTL_EN_CHARGE_KEY_Pos            24UL
82 #define BACKUP_CTL_EN_CHARGE_KEY_Msk            0xFF000000UL
83 /* BACKUP.RTC_RW */
84 #define BACKUP_RTC_RW_READ_Pos                  0UL
85 #define BACKUP_RTC_RW_READ_Msk                  0x1UL
86 #define BACKUP_RTC_RW_WRITE_Pos                 1UL
87 #define BACKUP_RTC_RW_WRITE_Msk                 0x2UL
88 /* BACKUP.CAL_CTL */
89 #define BACKUP_CAL_CTL_CALIB_VAL_Pos            0UL
90 #define BACKUP_CAL_CTL_CALIB_VAL_Msk            0x3FUL
91 #define BACKUP_CAL_CTL_CALIB_SIGN_Pos           6UL
92 #define BACKUP_CAL_CTL_CALIB_SIGN_Msk           0x40UL
93 #define BACKUP_CAL_CTL_CAL_OUT_Pos              31UL
94 #define BACKUP_CAL_CTL_CAL_OUT_Msk              0x80000000UL
95 /* BACKUP.STATUS */
96 #define BACKUP_STATUS_RTC_BUSY_Pos              0UL
97 #define BACKUP_STATUS_RTC_BUSY_Msk              0x1UL
98 #define BACKUP_STATUS_WCO_OK_Pos                2UL
99 #define BACKUP_STATUS_WCO_OK_Msk                0x4UL
100 /* BACKUP.RTC_TIME */
101 #define BACKUP_RTC_TIME_RTC_SEC_Pos             0UL
102 #define BACKUP_RTC_TIME_RTC_SEC_Msk             0x7FUL
103 #define BACKUP_RTC_TIME_RTC_MIN_Pos             8UL
104 #define BACKUP_RTC_TIME_RTC_MIN_Msk             0x7F00UL
105 #define BACKUP_RTC_TIME_RTC_HOUR_Pos            16UL
106 #define BACKUP_RTC_TIME_RTC_HOUR_Msk            0x3F0000UL
107 #define BACKUP_RTC_TIME_CTRL_12HR_Pos           22UL
108 #define BACKUP_RTC_TIME_CTRL_12HR_Msk           0x400000UL
109 #define BACKUP_RTC_TIME_RTC_DAY_Pos             24UL
110 #define BACKUP_RTC_TIME_RTC_DAY_Msk             0x7000000UL
111 /* BACKUP.RTC_DATE */
112 #define BACKUP_RTC_DATE_RTC_DATE_Pos            0UL
113 #define BACKUP_RTC_DATE_RTC_DATE_Msk            0x3FUL
114 #define BACKUP_RTC_DATE_RTC_MON_Pos             8UL
115 #define BACKUP_RTC_DATE_RTC_MON_Msk             0x1F00UL
116 #define BACKUP_RTC_DATE_RTC_YEAR_Pos            16UL
117 #define BACKUP_RTC_DATE_RTC_YEAR_Msk            0xFF0000UL
118 /* BACKUP.ALM1_TIME */
119 #define BACKUP_ALM1_TIME_ALM_SEC_Pos            0UL
120 #define BACKUP_ALM1_TIME_ALM_SEC_Msk            0x7FUL
121 #define BACKUP_ALM1_TIME_ALM_SEC_EN_Pos         7UL
122 #define BACKUP_ALM1_TIME_ALM_SEC_EN_Msk         0x80UL
123 #define BACKUP_ALM1_TIME_ALM_MIN_Pos            8UL
124 #define BACKUP_ALM1_TIME_ALM_MIN_Msk            0x7F00UL
125 #define BACKUP_ALM1_TIME_ALM_MIN_EN_Pos         15UL
126 #define BACKUP_ALM1_TIME_ALM_MIN_EN_Msk         0x8000UL
127 #define BACKUP_ALM1_TIME_ALM_HOUR_Pos           16UL
128 #define BACKUP_ALM1_TIME_ALM_HOUR_Msk           0x3F0000UL
129 #define BACKUP_ALM1_TIME_ALM_HOUR_EN_Pos        23UL
130 #define BACKUP_ALM1_TIME_ALM_HOUR_EN_Msk        0x800000UL
131 #define BACKUP_ALM1_TIME_ALM_DAY_Pos            24UL
132 #define BACKUP_ALM1_TIME_ALM_DAY_Msk            0x7000000UL
133 #define BACKUP_ALM1_TIME_ALM_DAY_EN_Pos         31UL
134 #define BACKUP_ALM1_TIME_ALM_DAY_EN_Msk         0x80000000UL
135 /* BACKUP.ALM1_DATE */
136 #define BACKUP_ALM1_DATE_ALM_DATE_Pos           0UL
137 #define BACKUP_ALM1_DATE_ALM_DATE_Msk           0x3FUL
138 #define BACKUP_ALM1_DATE_ALM_DATE_EN_Pos        7UL
139 #define BACKUP_ALM1_DATE_ALM_DATE_EN_Msk        0x80UL
140 #define BACKUP_ALM1_DATE_ALM_MON_Pos            8UL
141 #define BACKUP_ALM1_DATE_ALM_MON_Msk            0x1F00UL
142 #define BACKUP_ALM1_DATE_ALM_MON_EN_Pos         15UL
143 #define BACKUP_ALM1_DATE_ALM_MON_EN_Msk         0x8000UL
144 #define BACKUP_ALM1_DATE_ALM_EN_Pos             31UL
145 #define BACKUP_ALM1_DATE_ALM_EN_Msk             0x80000000UL
146 /* BACKUP.ALM2_TIME */
147 #define BACKUP_ALM2_TIME_ALM_SEC_Pos            0UL
148 #define BACKUP_ALM2_TIME_ALM_SEC_Msk            0x7FUL
149 #define BACKUP_ALM2_TIME_ALM_SEC_EN_Pos         7UL
150 #define BACKUP_ALM2_TIME_ALM_SEC_EN_Msk         0x80UL
151 #define BACKUP_ALM2_TIME_ALM_MIN_Pos            8UL
152 #define BACKUP_ALM2_TIME_ALM_MIN_Msk            0x7F00UL
153 #define BACKUP_ALM2_TIME_ALM_MIN_EN_Pos         15UL
154 #define BACKUP_ALM2_TIME_ALM_MIN_EN_Msk         0x8000UL
155 #define BACKUP_ALM2_TIME_ALM_HOUR_Pos           16UL
156 #define BACKUP_ALM2_TIME_ALM_HOUR_Msk           0x3F0000UL
157 #define BACKUP_ALM2_TIME_ALM_HOUR_EN_Pos        23UL
158 #define BACKUP_ALM2_TIME_ALM_HOUR_EN_Msk        0x800000UL
159 #define BACKUP_ALM2_TIME_ALM_DAY_Pos            24UL
160 #define BACKUP_ALM2_TIME_ALM_DAY_Msk            0x7000000UL
161 #define BACKUP_ALM2_TIME_ALM_DAY_EN_Pos         31UL
162 #define BACKUP_ALM2_TIME_ALM_DAY_EN_Msk         0x80000000UL
163 /* BACKUP.ALM2_DATE */
164 #define BACKUP_ALM2_DATE_ALM_DATE_Pos           0UL
165 #define BACKUP_ALM2_DATE_ALM_DATE_Msk           0x3FUL
166 #define BACKUP_ALM2_DATE_ALM_DATE_EN_Pos        7UL
167 #define BACKUP_ALM2_DATE_ALM_DATE_EN_Msk        0x80UL
168 #define BACKUP_ALM2_DATE_ALM_MON_Pos            8UL
169 #define BACKUP_ALM2_DATE_ALM_MON_Msk            0x1F00UL
170 #define BACKUP_ALM2_DATE_ALM_MON_EN_Pos         15UL
171 #define BACKUP_ALM2_DATE_ALM_MON_EN_Msk         0x8000UL
172 #define BACKUP_ALM2_DATE_ALM_EN_Pos             31UL
173 #define BACKUP_ALM2_DATE_ALM_EN_Msk             0x80000000UL
174 /* BACKUP.INTR */
175 #define BACKUP_INTR_ALARM1_Pos                  0UL
176 #define BACKUP_INTR_ALARM1_Msk                  0x1UL
177 #define BACKUP_INTR_ALARM2_Pos                  1UL
178 #define BACKUP_INTR_ALARM2_Msk                  0x2UL
179 #define BACKUP_INTR_CENTURY_Pos                 2UL
180 #define BACKUP_INTR_CENTURY_Msk                 0x4UL
181 /* BACKUP.INTR_SET */
182 #define BACKUP_INTR_SET_ALARM1_Pos              0UL
183 #define BACKUP_INTR_SET_ALARM1_Msk              0x1UL
184 #define BACKUP_INTR_SET_ALARM2_Pos              1UL
185 #define BACKUP_INTR_SET_ALARM2_Msk              0x2UL
186 #define BACKUP_INTR_SET_CENTURY_Pos             2UL
187 #define BACKUP_INTR_SET_CENTURY_Msk             0x4UL
188 /* BACKUP.INTR_MASK */
189 #define BACKUP_INTR_MASK_ALARM1_Pos             0UL
190 #define BACKUP_INTR_MASK_ALARM1_Msk             0x1UL
191 #define BACKUP_INTR_MASK_ALARM2_Pos             1UL
192 #define BACKUP_INTR_MASK_ALARM2_Msk             0x2UL
193 #define BACKUP_INTR_MASK_CENTURY_Pos            2UL
194 #define BACKUP_INTR_MASK_CENTURY_Msk            0x4UL
195 /* BACKUP.INTR_MASKED */
196 #define BACKUP_INTR_MASKED_ALARM1_Pos           0UL
197 #define BACKUP_INTR_MASKED_ALARM1_Msk           0x1UL
198 #define BACKUP_INTR_MASKED_ALARM2_Pos           1UL
199 #define BACKUP_INTR_MASKED_ALARM2_Msk           0x2UL
200 #define BACKUP_INTR_MASKED_CENTURY_Pos          2UL
201 #define BACKUP_INTR_MASKED_CENTURY_Msk          0x4UL
202 /* BACKUP.OSCCNT */
203 #define BACKUP_OSCCNT_CNT32KHZ_Pos              0UL
204 #define BACKUP_OSCCNT_CNT32KHZ_Msk              0xFFUL
205 /* BACKUP.TICKS */
206 #define BACKUP_TICKS_CNT128HZ_Pos               0UL
207 #define BACKUP_TICKS_CNT128HZ_Msk               0x3FUL
208 /* BACKUP.PMIC_CTL */
209 #define BACKUP_PMIC_CTL_UNLOCK_Pos              8UL
210 #define BACKUP_PMIC_CTL_UNLOCK_Msk              0xFF00UL
211 #define BACKUP_PMIC_CTL_POLARITY_Pos            16UL
212 #define BACKUP_PMIC_CTL_POLARITY_Msk            0x10000UL
213 #define BACKUP_PMIC_CTL_PMIC_EN_OUTEN_Pos       29UL
214 #define BACKUP_PMIC_CTL_PMIC_EN_OUTEN_Msk       0x20000000UL
215 #define BACKUP_PMIC_CTL_PMIC_ALWAYSEN_Pos       30UL
216 #define BACKUP_PMIC_CTL_PMIC_ALWAYSEN_Msk       0x40000000UL
217 #define BACKUP_PMIC_CTL_PMIC_EN_Pos             31UL
218 #define BACKUP_PMIC_CTL_PMIC_EN_Msk             0x80000000UL
219 /* BACKUP.RESET */
220 #define BACKUP_RESET_RESET_Pos                  31UL
221 #define BACKUP_RESET_RESET_Msk                  0x80000000UL
222 /* BACKUP.BREG */
223 #define BACKUP_BREG_BREG_Pos                    0UL
224 #define BACKUP_BREG_BREG_Msk                    0xFFFFFFFFUL
225 /* BACKUP.TRIM */
226 #define BACKUP_TRIM_TRIM_Pos                    0UL
227 #define BACKUP_TRIM_TRIM_Msk                    0x3FUL
228 
229 
230 #endif /* _CYIP_BACKUP_H_ */
231 
232 
233 /* [] END OF FILE */
234