at32f415_ertc.h 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  1. /**
  2. **************************************************************************
  3. * @file at32f415_ertc.h
  4. * @version v2.0.5
  5. * @date 2022-05-20
  6. * @brief at32f415 ertc header file
  7. **************************************************************************
  8. * Copyright notice & Disclaimer
  9. *
  10. * The software Board Support Package (BSP) that is made available to
  11. * download from Artery official website is the copyrighted work of Artery.
  12. * Artery authorizes customers to use, copy, and distribute the BSP
  13. * software and its related documentation for the purpose of design and
  14. * development in conjunction with Artery microcontrollers. Use of the
  15. * software is governed by this copyright notice and the following disclaimer.
  16. *
  17. * THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
  18. * GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
  19. * TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
  20. * STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
  21. * INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
  23. *
  24. **************************************************************************
  25. */
  26. /* Define to prevent recursive inclusion -------------------------------------*/
  27. #ifndef __AT32F415_ERTC_H
  28. #define __AT32F415_ERTC_H
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. /* Includes ------------------------------------------------------------------*/
  33. #include "at32f415.h"
  34. /** @addtogroup AT32F415_periph_driver
  35. * @{
  36. */
  37. /** @addtogroup ERTC
  38. * @{
  39. */
  40. /** @defgroup ERTC_interrupts_definition
  41. * @brief ertc interrupt
  42. * @{
  43. */
  44. #define ERTC_TP_INT ((uint32_t)0x00000004) /*!< ertc tamper interrupt */
  45. #define ERTC_ALA_INT ((uint32_t)0x00001000) /*!< ertc alarm a interrupt */
  46. #define ERTC_ALB_INT ((uint32_t)0x00002000) /*!< ertc alarm b interrupt */
  47. #define ERTC_WAT_INT ((uint32_t)0x00004000) /*!< ertc wakeup timer interrupt */
  48. #define ERTC_TS_INT ((uint32_t)0x00008000) /*!< ertc timestamp interrupt */
  49. /**
  50. * @}
  51. */
  52. /** @defgroup ERTC_flags_definition
  53. * @brief ertc flag
  54. * @{
  55. */
  56. #define ERTC_ALAWF_FLAG ((uint32_t)0x00000001) /*!< ertc alarm a register allows write flag */
  57. #define ERTC_ALBWF_FLAG ((uint32_t)0x00000002) /*!< ertc alarm b register allows write flag */
  58. #define ERTC_WATWF_FLAG ((uint32_t)0x00000004) /*!< ertc wakeup timer register allows write flag */
  59. #define ERTC_TADJF_FLAG ((uint32_t)0x00000008) /*!< ertc time adjustment flag */
  60. #define ERTC_INITF_FLAG ((uint32_t)0x00000010) /*!< ertc calendar initialization flag */
  61. #define ERTC_UPDF_FLAG ((uint32_t)0x00000020) /*!< ertc calendar update flag */
  62. #define ERTC_IMF_FLAG ((uint32_t)0x00000040) /*!< ertc enter initialization mode flag */
  63. #define ERTC_ALAF_FLAG ((uint32_t)0x00000100) /*!< ertc alarm clock a flag */
  64. #define ERTC_ALBF_FLAG ((uint32_t)0x00000200) /*!< ertc alarm clock b flag */
  65. #define ERTC_WATF_FLAG ((uint32_t)0x00000400) /*!< ertc wakeup timer flag */
  66. #define ERTC_TSF_FLAG ((uint32_t)0x00000800) /*!< ertc timestamp flag */
  67. #define ERTC_TSOF_FLAG ((uint32_t)0x00001000) /*!< ertc timestamp overflow flag */
  68. #define ERTC_TP1F_FLAG ((uint32_t)0x00002000) /*!< ertc tamper detection 1 flag */
  69. #define ERTC_CALUPDF_FLAG ((uint32_t)0x00010000) /*!< ertc calibration value update completed flag */
  70. /**
  71. * @brief ertc alarm mask
  72. */
  73. #define ERTC_ALARM_MASK_NONE ((uint32_t)0x00000000) /*!< ertc alarm match all */
  74. #define ERTC_ALARM_MASK_SEC ((uint32_t)0x00000080) /*!< ertc alarm don't match seconds */
  75. #define ERTC_ALARM_MASK_MIN ((uint32_t)0x00008000) /*!< ertc alarm don't match minute */
  76. #define ERTC_ALARM_MASK_HOUR ((uint32_t)0x00800000) /*!< ertc alarm don't match hour */
  77. #define ERTC_ALARM_MASK_DATE_WEEK ((uint32_t)0x80000000) /*!< ertc alarm don't match date or week */
  78. #define ERTC_ALARM_MASK_ALL ((uint32_t)0x80808080) /*!< ertc alarm don't match all */
  79. /**
  80. * @}
  81. */
  82. /** @defgroup ERTC_exported_types
  83. * @{
  84. */
  85. /**
  86. * @brief ertc hour mode
  87. */
  88. typedef enum
  89. {
  90. ERTC_HOUR_MODE_24 = 0x00, /*!< 24-hour format */
  91. ERTC_HOUR_MODE_12 = 0x01 /*!< 12-hour format */
  92. } ertc_hour_mode_set_type;
  93. /**
  94. * @brief ertc 12-hour format am/pm
  95. */
  96. typedef enum
  97. {
  98. ERTC_24H = 0x00, /*!< 24-hour format */
  99. ERTC_AM = 0x00, /*!< 12-hour format, ante meridiem */
  100. ERTC_PM = 0x01 /*!< 12-hour format, meridiem */
  101. } ertc_am_pm_type;
  102. /**
  103. * @brief ertc week or date select
  104. */
  105. typedef enum
  106. {
  107. ERTC_SLECT_DATE = 0x00, /*!< slect date mode */
  108. ERTC_SLECT_WEEK = 0x01 /*!< slect week mode */
  109. } ertc_week_date_select_type;
  110. /**
  111. * @brief ertc alarm x select
  112. */
  113. typedef enum
  114. {
  115. ERTC_ALA = 0x00, /*!< select alarm a */
  116. ERTC_ALB = 0x01 /*!< select alarm b */
  117. } ertc_alarm_type;
  118. /**
  119. * @brief ertc alarm sub second mask
  120. */
  121. typedef enum
  122. {
  123. ERTC_ALARM_SBS_MASK_ALL = 0x00, /*!< do not match the sub-second */
  124. ERTC_ALARM_SBS_MASK_14_1 = 0x01, /*!< only compare bit [0] */
  125. ERTC_ALARM_SBS_MASK_14_2 = 0x02, /*!< only compare bit [1:0] */
  126. ERTC_ALARM_SBS_MASK_14_3 = 0x03, /*!< only compare bit [2:0] */
  127. ERTC_ALARM_SBS_MASK_14_4 = 0x04, /*!< only compare bit [3:0] */
  128. ERTC_ALARM_SBS_MASK_14_5 = 0x05, /*!< only compare bit [4:0] */
  129. ERTC_ALARM_SBS_MASK_14_6 = 0x06, /*!< only compare bit [5:0] */
  130. ERTC_ALARM_SBS_MASK_14_7 = 0x07, /*!< only compare bit [6:0] */
  131. ERTC_ALARM_SBS_MASK_14_8 = 0x08, /*!< only compare bit [7:0] */
  132. ERTC_ALARM_SBS_MASK_14_9 = 0x09, /*!< only compare bit [8:0] */
  133. ERTC_ALARM_SBS_MASK_14_10 = 0x0A, /*!< only compare bit [9:0] */
  134. ERTC_ALARM_SBS_MASK_14_11 = 0x0B, /*!< only compare bit [10:0] */
  135. ERTC_ALARM_SBS_MASK_14_12 = 0x0C, /*!< only compare bit [11:0] */
  136. ERTC_ALARM_SBS_MASK_14_13 = 0x0D, /*!< only compare bit [12:0] */
  137. ERTC_ALARM_SBS_MASK_14 = 0x0E, /*!< only compare bit [13:0] */
  138. ERTC_ALARM_SBS_MASK_NONE = 0x0F /*!< compare bit [14:0] */
  139. } ertc_alarm_sbs_mask_type;
  140. /**
  141. * @brief ertc wakeup timer clock select
  142. */
  143. typedef enum
  144. {
  145. ERTC_WAT_CLK_ERTCCLK_DIV16 = 0x00, /*!< the wake up timer clock is ERTC_CLK / 16 */
  146. ERTC_WAT_CLK_ERTCCLK_DIV8 = 0x01, /*!< the wake up timer clock is ERTC_CLK / 8 */
  147. ERTC_WAT_CLK_ERTCCLK_DIV4 = 0x02, /*!< the wake up timer clock is ERTC_CLK / 4 */
  148. ERTC_WAT_CLK_ERTCCLK_DIV2 = 0x03, /*!< the wake up timer clock is ERTC_CLK / 2 */
  149. ERTC_WAT_CLK_CK_A_16BITS = 0x04, /*!< the wake up timer clock is CK_A, wakeup counter = ERTC_WAT */
  150. ERTC_WAT_CLK_CK_A_17BITS = 0x06 /*!< the wake up timer clock is CK_A, wakeup counter = ERTC_WAT + 65535 */
  151. } ertc_wakeup_clock_type;
  152. /**
  153. * @brief ertc smooth calibration period
  154. */
  155. typedef enum
  156. {
  157. ERTC_SMOOTH_CAL_PERIOD_32 = 0x00, /*!< 32 second calibration period */
  158. ERTC_SMOOTH_CAL_PERIOD_16 = 0x01, /*!< 16 second calibration period */
  159. ERTC_SMOOTH_CAL_PERIOD_8 = 0x02 /*!< 8 second calibration period */
  160. } ertc_smooth_cal_period_type;
  161. /**
  162. * @brief ertc smooth calibration clock add mode
  163. */
  164. typedef enum
  165. {
  166. ERTC_SMOOTH_CAL_CLK_ADD_0 = 0x00, /*!< do not increase clock */
  167. ERTC_SMOOTH_CAL_CLK_ADD_512 = 0x01 /*!< add 512 clocks */
  168. } ertc_smooth_cal_clk_add_type;
  169. /**
  170. * @brief ertc calibration direction mode
  171. */
  172. typedef enum
  173. {
  174. ERTC_CAL_DIR_POSITIVE = 0x00, /*!< positive calibration */
  175. ERTC_CAL_DIR_NEGATIVE = 0x01 /*!< negative calibration */
  176. } ertc_cal_direction_type;
  177. /**
  178. * @brief ertc calibration output mode
  179. */
  180. typedef enum
  181. {
  182. ERTC_CAL_OUTPUT_512HZ = 0x00, /*!< output 512 hz */
  183. ERTC_CAL_OUTPUT_1HZ = 0x01 /*!< output 1 hz */
  184. } ertc_cal_output_select_type;
  185. /**
  186. * @brief time adjust add mode
  187. */
  188. typedef enum
  189. {
  190. ERTC_TIME_ADD_NONE = 0x00, /*!< none operation */
  191. ERTC_TIME_ADD_1S = 0x01 /*!< add 1 second */
  192. } ertc_time_adjust_type;
  193. /**
  194. * @brief ertc daylight saving time hour adjustment mode
  195. */
  196. typedef enum
  197. {
  198. ERTC_DST_ADD_1H = 0x00, /*!< add 1 hour */
  199. ERTC_DST_DEC_1H = 0x01 /*!< dec 1 hour */
  200. } ertc_dst_operation_type;
  201. /**
  202. * @brief ertc daylight saving time store operation mode
  203. */
  204. typedef enum
  205. {
  206. ERTC_DST_SAVE_0 = 0x00, /*!< set the bpr register value to 0 */
  207. ERTC_DST_SAVE_1 = 0x01 /*!< set the bpr register value to 1 */
  208. } ertc_dst_save_type;
  209. /**
  210. * @brief output source
  211. */
  212. typedef enum
  213. {
  214. ERTC_OUTPUT_DISABLE = 0x00, /*!< diable output */
  215. ERTC_OUTPUT_ALARM_A = 0x01, /*!< output alarm a event */
  216. ERTC_OUTPUT_ALARM_B = 0x02, /*!< output alarm b event */
  217. ERTC_OUTPUT_WAKEUP = 0x03 /*!< output wakeup event */
  218. } ertc_output_source_type;
  219. /**
  220. * @brief output polarity
  221. */
  222. typedef enum
  223. {
  224. ERTC_OUTPUT_POLARITY_HIGH = 0x00, /*!< when the event occurs, the output is high */
  225. ERTC_OUTPUT_POLARITY_LOW = 0x01 /*!< when the event occurs, the output is low */
  226. } ertc_output_polarity_type;
  227. /**
  228. * @brief output type
  229. */
  230. typedef enum
  231. {
  232. ERTC_OUTPUT_TYPE_OPEN_DRAIN = 0x00, /*!< open drain output */
  233. ERTC_OUTPUT_TYPE_PUSH_PULL = 0x01 /*!< push pull output */
  234. } ertc_output_type;
  235. /**
  236. * @brief timestamp/ tamper detection pin selection
  237. */
  238. typedef enum
  239. {
  240. ERTC_PIN_PC13 = 0x00, /*!< pc13 is used as timestamp detection pin */
  241. ERTC_PIN_PA0 = 0x01 /*!< pa0 is used as timestamp detection pin */
  242. } ertc_pin_select_type;
  243. /**
  244. * @brief ertc timestamp valid edge
  245. */
  246. typedef enum
  247. {
  248. ERTC_TIMESTAMP_EDGE_RISING = 0x00, /*!< rising edge trigger */
  249. ERTC_TIMESTAMP_EDGE_FALLING = 0x01 /*!< falling edge trigger */
  250. } ertc_timestamp_valid_edge_type;
  251. /**
  252. * @brief ertc tamper x select
  253. */
  254. typedef enum
  255. {
  256. ERTC_TAMPER_1 = 0x00, /*!< tamper 1 */
  257. } ertc_tamper_select_type;
  258. /**
  259. * @brief tamper detection pre-charge time
  260. */
  261. typedef enum
  262. {
  263. ERTC_TAMPER_PR_1_ERTCCLK = 0x00, /*!< pre-charge time is 1 ERTC_CLK */
  264. ERTC_TAMPER_PR_2_ERTCCLK = 0x01, /*!< pre-charge time is 2 ERTC_CLK */
  265. ERTC_TAMPER_PR_4_ERTCCLK = 0x02, /*!< pre-charge time is 4 ERTC_CLK */
  266. ERTC_TAMPER_PR_8_ERTCCLK = 0x03 /*!< pre-charge time is 8 ERTC_CLK */
  267. } ertc_tamper_precharge_type;
  268. /**
  269. * @brief ertc tamper filter
  270. */
  271. typedef enum
  272. {
  273. ERTC_TAMPER_FILTER_DISABLE = 0x00, /*!< disable filter function */
  274. ERTC_TAMPER_FILTER_2 = 0x01, /*!< 2 consecutive samples arw valid, effective tamper event */
  275. ERTC_TAMPER_FILTER_4 = 0x02, /*!< 4 consecutive samples arw valid, effective tamper event */
  276. ERTC_TAMPER_FILTER_8 = 0x03 /*!< 8 consecutive samples arw valid, effective tamper event */
  277. } ertc_tamper_filter_type;
  278. /**
  279. * @brief ertc tamper detection frequency
  280. */
  281. typedef enum
  282. {
  283. ERTC_TAMPER_FREQ_DIV_32768 = 0x00, /*!< ERTC_CLK / 32768 */
  284. ERTC_TAMPER_FREQ_DIV_16384 = 0x01, /*!< ERTC_CLK / 16384 */
  285. ERTC_TAMPER_FREQ_DIV_8192 = 0x02, /*!< ERTC_CLK / 8192 */
  286. ERTC_TAMPER_FREQ_DIV_4096 = 0x03, /*!< ERTC_CLK / 4096 */
  287. ERTC_TAMPER_FREQ_DIV_2048 = 0x04, /*!< ERTC_CLK / 2048 */
  288. ERTC_TAMPER_FREQ_DIV_1024 = 0x05, /*!< ERTC_CLK / 1024 */
  289. ERTC_TAMPER_FREQ_DIV_512 = 0x06, /*!< ERTC_CLK / 512 */
  290. ERTC_TAMPER_FREQ_DIV_256 = 0x07 /*!< ERTC_CLK / 256 */
  291. } ertc_tamper_detect_freq_type;
  292. /**
  293. * @brief ertc tamper valid edge
  294. */
  295. typedef enum
  296. {
  297. ERTC_TAMPER_EDGE_RISING = 0x00, /*!< rising gedge */
  298. ERTC_TAMPER_EDGE_FALLING = 0x01, /*!< falling gedge */
  299. ERTC_TAMPER_EDGE_LOW = 0x00, /*!< low level */
  300. ERTC_TAMPER_EDGE_HIGH = 0x01 /*!< high level */
  301. } ertc_tamper_valid_edge_type;
  302. /**
  303. * @brief ertc bpr register
  304. */
  305. typedef enum
  306. {
  307. ERTC_DT1 = 0, /*!< bpr data register 0 */
  308. ERTC_DT2 = 1, /*!< bpr data register 1 */
  309. ERTC_DT3 = 2, /*!< bpr data register 2 */
  310. ERTC_DT4 = 3, /*!< bpr data register 3 */
  311. ERTC_DT5 = 4, /*!< bpr data register 4 */
  312. ERTC_DT6 = 5, /*!< bpr data register 5 */
  313. ERTC_DT7 = 6, /*!< bpr data register 6 */
  314. ERTC_DT8 = 7, /*!< bpr data register 7 */
  315. ERTC_DT9 = 8, /*!< bpr data register 8 */
  316. ERTC_DT10 = 9, /*!< bpr data register 9 */
  317. ERTC_DT11 = 10, /*!< bpr data register 10 */
  318. ERTC_DT12 = 11, /*!< bpr data register 11 */
  319. ERTC_DT13 = 12, /*!< bpr data register 12 */
  320. ERTC_DT14 = 13, /*!< bpr data register 13 */
  321. ERTC_DT15 = 14, /*!< bpr data register 14 */
  322. ERTC_DT16 = 15, /*!< bpr data register 15 */
  323. ERTC_DT17 = 16, /*!< bpr data register 16 */
  324. ERTC_DT18 = 17, /*!< bpr data register 17 */
  325. ERTC_DT19 = 18, /*!< bpr data register 18 */
  326. ERTC_DT20 = 19 /*!< bpr data register 19 */
  327. } ertc_dt_type;
  328. /**
  329. * @brief ertc time
  330. */
  331. typedef struct
  332. {
  333. uint8_t year; /*!< year */
  334. uint8_t month; /*!< month */
  335. uint8_t day; /*!< date */
  336. uint8_t hour; /*!< hour */
  337. uint8_t min; /*!< minute */
  338. uint8_t sec; /*!< second */
  339. uint8_t week; /*!< week */
  340. ertc_am_pm_type ampm; /*!< ante meridiem / post meridiem */
  341. } ertc_time_type;
  342. /**
  343. * @brief ertc alarm
  344. */
  345. typedef struct
  346. {
  347. uint8_t day; /*!< date */
  348. uint8_t hour; /*!< hour */
  349. uint8_t min; /*!< minute */
  350. uint8_t sec; /*!< second */
  351. ertc_am_pm_type ampm; /*!< ante meridiem / post meridiem */
  352. uint32_t mask; /*!< alarm mask*/
  353. uint8_t week_date_sel; /*!< week or date mode */
  354. uint8_t week; /*!< week */
  355. } ertc_alarm_value_type;
  356. /**
  357. * @brief ertc time reg union
  358. */
  359. typedef union
  360. {
  361. __IO uint32_t time;
  362. struct
  363. {
  364. __IO uint32_t s : 7; /* [6:0] */
  365. __IO uint32_t reserved1 : 1; /* [7] */
  366. __IO uint32_t m : 7; /* [14:8] */
  367. __IO uint32_t reserved2 : 1; /* [15] */
  368. __IO uint32_t h : 6; /* [21:16] */
  369. __IO uint32_t ampm : 1; /* [22] */
  370. __IO uint32_t reserved3 : 9; /* [31:23] */
  371. } time_bit;
  372. } ertc_reg_time_type;
  373. /**
  374. * @brief ertc date reg union
  375. */
  376. typedef union
  377. {
  378. __IO uint32_t date;
  379. struct
  380. {
  381. __IO uint32_t d :6; /* [5:0] */
  382. __IO uint32_t reserved1 :2; /* [7:6] */
  383. __IO uint32_t m :5; /* [12:8] */
  384. __IO uint32_t wk :3; /* [15:13] */
  385. __IO uint32_t y :8; /* [23:16] */
  386. __IO uint32_t reserved2 :8; /* [31:24] */
  387. } date_bit;
  388. } ertc_reg_date_type;
  389. /**
  390. * @brief ertc alarm reg union
  391. */
  392. typedef union
  393. {
  394. __IO uint32_t ala;
  395. struct
  396. {
  397. __IO uint32_t s :7; /* [6:0] */
  398. __IO uint32_t mask1 :1; /* [7] */
  399. __IO uint32_t m :7; /* [14:8] */
  400. __IO uint32_t mask2 :1; /* [15] */
  401. __IO uint32_t h :6; /* [21:16] */
  402. __IO uint32_t ampm :1; /* [22] */
  403. __IO uint32_t mask3 :1; /* [23] */
  404. __IO uint32_t d :6; /* [29:24] */
  405. __IO uint32_t wksel :1; /* [30] */
  406. __IO uint32_t mask4 :1; /* [31] */
  407. } ala_bit;
  408. } ertc_reg_alarm_type;
  409. /**
  410. * @brief ertc scal reg union
  411. */
  412. typedef union
  413. {
  414. __IO uint32_t scal;
  415. struct
  416. {
  417. __IO uint32_t dec :9; /* [8:0] */
  418. __IO uint32_t reserved1 :4; /* [12:9] */
  419. __IO uint32_t cal16 :1; /* [13] */
  420. __IO uint32_t cal8 :1; /* [14] */
  421. __IO uint32_t add :1; /* [15] */
  422. __IO uint32_t reserved2 :16;/* [31:16] */
  423. } scal_bit;
  424. } ertc_reg_scal_type;
  425. /**
  426. * @brief ertc tadj reg union
  427. */
  428. typedef union
  429. {
  430. __IO uint32_t tadj;
  431. struct
  432. {
  433. __IO uint32_t decsbs :15;/* [14:0] */
  434. __IO uint32_t reserved1 :16;/* [30:15] */
  435. __IO uint32_t add1s :1; /* [31] */
  436. } tadj_bit;
  437. } ertc_reg_tadj_type;
  438. /**
  439. * @brief ertc tstm reg union
  440. */
  441. typedef union
  442. {
  443. __IO uint32_t tstm;
  444. struct
  445. {
  446. __IO uint32_t s :7; /* [6:0] */
  447. __IO uint32_t reserved1 :1; /* [7] */
  448. __IO uint32_t m :7; /* [14:8] */
  449. __IO uint32_t reserved2 :1; /* [15] */
  450. __IO uint32_t h :6; /* [21:16] */
  451. __IO uint32_t ampm :1; /* [22] */
  452. __IO uint32_t reserved3 :9; /* [31:23] */
  453. } tstm_bit;
  454. } ertc_reg_tstm_type;
  455. /**
  456. * @brief ertc tsdt register, offset:0x34
  457. */
  458. typedef union
  459. {
  460. __IO uint32_t tsdt;
  461. struct
  462. {
  463. __IO uint32_t d :6; /* [5:0] */
  464. __IO uint32_t reserved1 :2; /* [7:6] */
  465. __IO uint32_t m :5; /* [12:8] */
  466. __IO uint32_t wk :3; /* [15:13] */
  467. __IO uint32_t reserved2 :16;/* [31:16] */
  468. } tsdt_bit;
  469. } ertc_reg_tsdt_type;
  470. /**
  471. * @brief type define ertc register all
  472. */
  473. typedef struct
  474. {
  475. /**
  476. * @brief ertc time register, offset:0x00
  477. */
  478. union
  479. {
  480. __IO uint32_t time;
  481. struct
  482. {
  483. __IO uint32_t s : 7; /* [6:0] */
  484. __IO uint32_t reserved1 : 1; /* [7] */
  485. __IO uint32_t m : 7; /* [14:8] */
  486. __IO uint32_t reserved2 : 1; /* [15] */
  487. __IO uint32_t h : 6; /* [21:16] */
  488. __IO uint32_t ampm : 1; /* [22] */
  489. __IO uint32_t reserved3 : 9; /* [31:23] */
  490. } time_bit;
  491. };
  492. /**
  493. * @brief ertc date register, offset:0x04
  494. */
  495. union
  496. {
  497. __IO uint32_t date;
  498. struct
  499. {
  500. __IO uint32_t d :6; /* [5:0] */
  501. __IO uint32_t reserved1 :2; /* [7:6] */
  502. __IO uint32_t m :5; /* [12:8] */
  503. __IO uint32_t wk :3; /* [15:13] */
  504. __IO uint32_t y :8; /* [23:16] */
  505. __IO uint32_t reserved2 :8; /* [31:24] */
  506. } date_bit;
  507. };
  508. /**
  509. * @brief ertc ctrl register, offset:0x08
  510. */
  511. union
  512. {
  513. __IO uint32_t ctrl;
  514. struct
  515. {
  516. __IO uint32_t watclk :3; /* [2:0] */
  517. __IO uint32_t tsedg :1; /* [3] */
  518. __IO uint32_t rcden :1; /* [4] */
  519. __IO uint32_t dren :1; /* [5] */
  520. __IO uint32_t hm :1; /* [6] */
  521. __IO uint32_t ccalen :1; /* [7] */
  522. __IO uint32_t alaen :1; /* [8] */
  523. __IO uint32_t alben :1; /* [9] */
  524. __IO uint32_t waten :1; /* [10] */
  525. __IO uint32_t tsen :1; /* [11] */
  526. __IO uint32_t alaien :1; /* [12] */
  527. __IO uint32_t albien :1; /* [13] */
  528. __IO uint32_t watien :1; /* [14] */
  529. __IO uint32_t tsien :1; /* [15] */
  530. __IO uint32_t add1h :1; /* [16] */
  531. __IO uint32_t dec1h :1; /* [17] */
  532. __IO uint32_t bpr :1; /* [18] */
  533. __IO uint32_t calosel :1; /* [19] */
  534. __IO uint32_t outp :1; /* [20] */
  535. __IO uint32_t outsel :2; /* [22:21] */
  536. __IO uint32_t caloen :1; /* [23] */
  537. __IO uint32_t reserved1 :8; /* [31:24] */
  538. } ctrl_bit;
  539. };
  540. /**
  541. * @brief ertc sts register, offset:0x0C
  542. */
  543. union
  544. {
  545. __IO uint32_t sts;
  546. struct
  547. {
  548. __IO uint32_t alawf :1; /* [0] */
  549. __IO uint32_t albwf :1; /* [1] */
  550. __IO uint32_t watwf :1; /* [2] */
  551. __IO uint32_t tadjf :1; /* [3] */
  552. __IO uint32_t initf :1; /* [4] */
  553. __IO uint32_t updf :1; /* [5] */
  554. __IO uint32_t imf :1; /* [6] */
  555. __IO uint32_t imen :1; /* [7] */
  556. __IO uint32_t alaf :1; /* [8] */
  557. __IO uint32_t albf :1; /* [9] */
  558. __IO uint32_t watf :1; /* [10] */
  559. __IO uint32_t tsf :1; /* [11] */
  560. __IO uint32_t tsof :1; /* [12] */
  561. __IO uint32_t tp1f :1; /* [13] */
  562. __IO uint32_t reserved1 :1; /* [14] */
  563. __IO uint32_t reserved2 :1; /* [15] */
  564. __IO uint32_t calupdf :1; /* [16] */
  565. __IO uint32_t reserved3 :15;/* [31:17] */
  566. } sts_bit;
  567. };
  568. /**
  569. * @brief ertc div register, offset:0x10
  570. */
  571. union
  572. {
  573. __IO uint32_t div;
  574. struct
  575. {
  576. __IO uint32_t divb :15;/* [14:0] */
  577. __IO uint32_t reserved1 :1; /* [15] */
  578. __IO uint32_t diva :7; /* [22:16] */
  579. __IO uint32_t reserved2 :9; /* [31:23] */
  580. } div_bit;
  581. };
  582. /**
  583. * @brief ertc wat register, offset:0x14
  584. */
  585. union
  586. {
  587. __IO uint32_t wat;
  588. struct
  589. {
  590. __IO uint32_t val :16;/* [15:0] */
  591. __IO uint32_t reserved1 :16;/* [31:16] */
  592. } wat_bit;
  593. };
  594. /**
  595. * @brief ertc ccal register, offset:0x18
  596. */
  597. union
  598. {
  599. __IO uint32_t ccal;
  600. struct
  601. {
  602. __IO uint32_t calval :5; /* [4:0] */
  603. __IO uint32_t reserved1 :2; /* [6:5] */
  604. __IO uint32_t caldir :1; /* [7] */
  605. __IO uint32_t reserved2 :24;/* [31:8] */
  606. } ccal_bit;
  607. };
  608. /**
  609. * @brief ertc ala register, offset:0x1C
  610. */
  611. union
  612. {
  613. __IO uint32_t ala;
  614. struct
  615. {
  616. __IO uint32_t s :7; /* [6:0] */
  617. __IO uint32_t mask1 :1; /* [7] */
  618. __IO uint32_t m :7; /* [14:8] */
  619. __IO uint32_t mask2 :1; /* [15] */
  620. __IO uint32_t h :6; /* [21:16] */
  621. __IO uint32_t ampm :1; /* [22] */
  622. __IO uint32_t mask3 :1; /* [23] */
  623. __IO uint32_t d :6; /* [29:24] */
  624. __IO uint32_t wksel :1; /* [30] */
  625. __IO uint32_t mask4 :1; /* [31] */
  626. } ala_bit;
  627. };
  628. /**
  629. * @brief ertc alb register, offset:0x20
  630. */
  631. union
  632. {
  633. __IO uint32_t alb;
  634. struct
  635. {
  636. __IO uint32_t s :7; /* [6:0] */
  637. __IO uint32_t mask1 :1; /* [7] */
  638. __IO uint32_t m :7; /* [14:8] */
  639. __IO uint32_t mask2 :1; /* [15] */
  640. __IO uint32_t h :6; /* [21:16] */
  641. __IO uint32_t ampm :1; /* [22] */
  642. __IO uint32_t mask3 :1; /* [23] */
  643. __IO uint32_t d :6; /* [29:24] */
  644. __IO uint32_t wksel :1; /* [30] */
  645. __IO uint32_t mask4 :1; /* [31] */
  646. } alb_bit;
  647. };
  648. /**
  649. * @brief ertc wp register, offset:0x24
  650. */
  651. union
  652. {
  653. __IO uint32_t wp;
  654. struct
  655. {
  656. __IO uint32_t cmd :8; /* [7:0] */
  657. __IO uint32_t reserved1 :24;/* [31:8] */
  658. } wp_bit;
  659. };
  660. /**
  661. * @brief ertc sbs register, offset:0x28
  662. */
  663. union
  664. {
  665. __IO uint32_t sbs;
  666. struct
  667. {
  668. __IO uint32_t sbs :16;/* [15:0] */
  669. __IO uint32_t reserved1 :16;/* [31:16] */
  670. } sbs_bit;
  671. };
  672. /**
  673. * @brief ertc tadj register, offset:0x2C
  674. */
  675. union
  676. {
  677. __IO uint32_t tadj;
  678. struct
  679. {
  680. __IO uint32_t decsbs :15;/* [14:0] */
  681. __IO uint32_t reserved1 :16;/* [30:15] */
  682. __IO uint32_t add1s :1; /* [31] */
  683. } tadj_bit;
  684. };
  685. /**
  686. * @brief ertc tstm register, offset:0x30
  687. */
  688. union
  689. {
  690. __IO uint32_t tstm;
  691. struct
  692. {
  693. __IO uint32_t s :7; /* [6:0] */
  694. __IO uint32_t reserved1 :1; /* [7] */
  695. __IO uint32_t m :7; /* [14:8] */
  696. __IO uint32_t reserved2 :1; /* [15] */
  697. __IO uint32_t h :6; /* [21:16] */
  698. __IO uint32_t ampm :1; /* [22] */
  699. __IO uint32_t reserved3 :9; /* [31:23] */
  700. } tstm_bit;
  701. };
  702. /**
  703. * @brief ertc tsdt register, offset:0x34
  704. */
  705. union
  706. {
  707. __IO uint32_t tsdt;
  708. struct
  709. {
  710. __IO uint32_t d :6; /* [5:0] */
  711. __IO uint32_t reserved1 :2; /* [7:6] */
  712. __IO uint32_t m :5; /* [12:8] */
  713. __IO uint32_t wk :3; /* [15:13] */
  714. __IO uint32_t reserved2 :16;/* [31:16] */
  715. } tsdt_bit;
  716. };
  717. /**
  718. * @brief ertc tssbs register, offset:0x38
  719. */
  720. union
  721. {
  722. __IO uint32_t tssbs;
  723. struct
  724. {
  725. __IO uint32_t sbs :16;/* [15:0] */
  726. __IO uint32_t reserved1 :16;/* [31:16] */
  727. } tssbs_bit;
  728. };
  729. /**
  730. * @brief ertc scal register, offset:0x3C
  731. */
  732. union
  733. {
  734. __IO uint32_t scal;
  735. struct
  736. {
  737. __IO uint32_t dec :9; /* [8:0] */
  738. __IO uint32_t reserved1 :4; /* [12:9] */
  739. __IO uint32_t cal16 :1; /* [13] */
  740. __IO uint32_t cal8 :1; /* [14] */
  741. __IO uint32_t add :1; /* [15] */
  742. __IO uint32_t reserved2 :16;/* [31:16] */
  743. } scal_bit;
  744. };
  745. /**
  746. * @brief ertc tamp register, offset:0x40
  747. */
  748. union
  749. {
  750. __IO uint32_t tamp;
  751. struct
  752. {
  753. __IO uint32_t tp1en :1; /* [0] */
  754. __IO uint32_t tp1edg :1; /* [1] */
  755. __IO uint32_t tpien :1; /* [2] */
  756. __IO uint32_t reserved1 :1; /* [3] */
  757. __IO uint32_t reserved2 :1; /* [4] */
  758. __IO uint32_t reserved3 :2; /* [6:5] */
  759. __IO uint32_t tptsen :1; /* [7] */
  760. __IO uint32_t tpfreq :3; /* [10:8] */
  761. __IO uint32_t tpflt :2; /* [12:11] */
  762. __IO uint32_t tppr :2; /* [14:13] */
  763. __IO uint32_t tppu :1; /* [15] */
  764. __IO uint32_t reserved4 :1; /* [16] */
  765. __IO uint32_t reserved5 :1; /* [17] */
  766. __IO uint32_t outtype :1; /* [18] */
  767. __IO uint32_t reserved6 :13;/* [31:19] */
  768. } tamp_bit;
  769. };
  770. /**
  771. * @brief ertc alasbs register, offset:0x44
  772. */
  773. union
  774. {
  775. __IO uint32_t alasbs;
  776. struct
  777. {
  778. __IO uint32_t sbs :15;/* [14:0] */
  779. __IO uint32_t reserved1 :9; /* [23:15] */
  780. __IO uint32_t sbsmsk :4; /* [27:24] */
  781. __IO uint32_t reserved2 :4; /* [31:28] */
  782. } alasbs_bit;
  783. };
  784. /**
  785. * @brief ertc albsbs register, offset:0x48
  786. */
  787. union
  788. {
  789. __IO uint32_t albsbs;
  790. struct
  791. {
  792. __IO uint32_t sbs :15;/* [14:0] */
  793. __IO uint32_t reserved1 :9; /* [23:15] */
  794. __IO uint32_t sbsmsk :4; /* [27:24] */
  795. __IO uint32_t reserved2 :4; /* [31:28] */
  796. } albsbs_bit;
  797. };
  798. /**
  799. * @brief reserved register, offset:0x4c
  800. */
  801. __IO uint32_t reserved1;
  802. /**
  803. * @brief ertc dt1 register, offset:0x50
  804. */
  805. union
  806. {
  807. __IO uint32_t dt1;
  808. struct
  809. {
  810. __IO uint32_t dt :32;/* [31:0] */
  811. } dt1_bit;
  812. };
  813. /**
  814. * @brief ertc dt2 register, offset:0x54
  815. */
  816. union
  817. {
  818. __IO uint32_t dt2;
  819. struct
  820. {
  821. __IO uint32_t dt :32;/* [31:0] */
  822. } dt2_bit;
  823. };
  824. /**
  825. * @brief ertc dt3 register, offset:0x58
  826. */
  827. union
  828. {
  829. __IO uint32_t dt3;
  830. struct
  831. {
  832. __IO uint32_t dt :32;/* [31:0] */
  833. } dt3_bit;
  834. };
  835. /**
  836. * @brief ertc dt4 register, offset:0x5C
  837. */
  838. union
  839. {
  840. __IO uint32_t dt4;
  841. struct
  842. {
  843. __IO uint32_t dt :32;/* [31:0] */
  844. } dt4_bit;
  845. };
  846. /**
  847. * @brief ertc dt5 register, offset:0x60
  848. */
  849. union
  850. {
  851. __IO uint32_t dt5;
  852. struct
  853. {
  854. __IO uint32_t dt :32;/* [31:0] */
  855. } dt5_bit;
  856. };
  857. /**
  858. * @brief ertc dt6 register, offset:0x64
  859. */
  860. union
  861. {
  862. __IO uint32_t dt6;
  863. struct
  864. {
  865. __IO uint32_t dt :32;/* [31:0] */
  866. } dt6_bit;
  867. };
  868. /**
  869. * @brief ertc dt7 register, offset:0x68
  870. */
  871. union
  872. {
  873. __IO uint32_t dt7;
  874. struct
  875. {
  876. __IO uint32_t dt :32;/* [31:0] */
  877. } dt7_bit;
  878. };
  879. /**
  880. * @brief ertc dt8 register, offset:0x6C
  881. */
  882. union
  883. {
  884. __IO uint32_t dt8;
  885. struct
  886. {
  887. __IO uint32_t dt :32;/* [31:0] */
  888. } dt8_bit;
  889. };
  890. /**
  891. * @brief ertc dt9 register, offset:0x70
  892. */
  893. union
  894. {
  895. __IO uint32_t dt9;
  896. struct
  897. {
  898. __IO uint32_t dt :32;/* [31:0] */
  899. } dt9_bit;
  900. };
  901. /**
  902. * @brief ertc dt10 register, offset:0x74
  903. */
  904. union
  905. {
  906. __IO uint32_t dt10;
  907. struct
  908. {
  909. __IO uint32_t dt :32;/* [31:0] */
  910. } dt10_bit;
  911. };
  912. /**
  913. * @brief ertc dt11 register, offset:0x78
  914. */
  915. union
  916. {
  917. __IO uint32_t dt11;
  918. struct
  919. {
  920. __IO uint32_t dt :32;/* [31:0] */
  921. } dt11_bit;
  922. };
  923. /**
  924. * @brief ertc dt12 register, offset:0x7C
  925. */
  926. union
  927. {
  928. __IO uint32_t dt12;
  929. struct
  930. {
  931. __IO uint32_t dt :32;/* [31:0] */
  932. } dt12_bit;
  933. };
  934. /**
  935. * @brief ertc dt13 register, offset:0x80
  936. */
  937. union
  938. {
  939. __IO uint32_t dt13;
  940. struct
  941. {
  942. __IO uint32_t dt :32;/* [31:0] */
  943. } dt13_bit;
  944. };
  945. /**
  946. * @brief ertc dt14 register, offset:0x84
  947. */
  948. union
  949. {
  950. __IO uint32_t dt14;
  951. struct
  952. {
  953. __IO uint32_t dt :32;/* [31:0] */
  954. } dt14_bit;
  955. };
  956. /**
  957. * @brief ertc dt15 register, offset:0x88
  958. */
  959. union
  960. {
  961. __IO uint32_t dt15;
  962. struct
  963. {
  964. __IO uint32_t dt :32;/* [31:0] */
  965. } dt15_bit;
  966. };
  967. /**
  968. * @brief ertc dt16 register, offset:0x8C
  969. */
  970. union
  971. {
  972. __IO uint32_t dt16;
  973. struct
  974. {
  975. __IO uint32_t dt :32;/* [31:0] */
  976. } dt16_bit;
  977. };
  978. /**
  979. * @brief ertc dt17 register, offset:0x90
  980. */
  981. union
  982. {
  983. __IO uint32_t dt17;
  984. struct
  985. {
  986. __IO uint32_t dt :32;/* [31:0] */
  987. } dt17_bit;
  988. };
  989. /**
  990. * @brief ertc dt18 register, offset:0x94
  991. */
  992. union
  993. {
  994. __IO uint32_t dt18;
  995. struct
  996. {
  997. __IO uint32_t dt :32;/* [31:0] */
  998. } dt18_bit;
  999. };
  1000. /**
  1001. * @brief ertc dt19 register, offset:0x98
  1002. */
  1003. union
  1004. {
  1005. __IO uint32_t dt19;
  1006. struct
  1007. {
  1008. __IO uint32_t dt :32;/* [31:0] */
  1009. } dt19_bit;
  1010. };
  1011. /**
  1012. * @brief ertc dt20 register, offset:0x9C
  1013. */
  1014. union
  1015. {
  1016. __IO uint32_t dt20;
  1017. struct
  1018. {
  1019. __IO uint32_t dt :32;/* [31:0] */
  1020. } dt20_bit;
  1021. };
  1022. } ertc_type;
  1023. /**
  1024. * @}
  1025. */
  1026. #define ERTC ((ertc_type *) ERTC_BASE)
  1027. /** @defgroup ERTC_exported_functions
  1028. * @{
  1029. */
  1030. uint8_t ertc_num_to_bcd(uint8_t num);
  1031. uint8_t ertc_bcd_to_num(uint8_t bcd);
  1032. void ertc_write_protect_enable(void);
  1033. void ertc_write_protect_disable(void);
  1034. error_status ertc_wait_update(void);
  1035. error_status ertc_wait_flag(uint32_t flag, flag_status status);
  1036. error_status ertc_init_mode_enter(void);
  1037. void ertc_init_mode_exit(void);
  1038. error_status ertc_reset(void);
  1039. error_status ertc_divider_set(uint16_t div_a, uint16_t div_b);
  1040. error_status ertc_hour_mode_set(ertc_hour_mode_set_type mode);
  1041. error_status ertc_date_set(uint8_t year, uint8_t month, uint8_t date, uint8_t week);
  1042. error_status ertc_time_set(uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm);
  1043. void ertc_calendar_get(ertc_time_type* time);
  1044. uint32_t ertc_sub_second_get(void);
  1045. void ertc_alarm_mask_set(ertc_alarm_type alarm_x, uint32_t mask);
  1046. void ertc_alarm_week_date_select(ertc_alarm_type alarm_x, ertc_week_date_select_type wk);
  1047. void ertc_alarm_set(ertc_alarm_type alarm_x, uint8_t week_date, uint8_t hour, uint8_t min, uint8_t sec, ertc_am_pm_type ampm);
  1048. void ertc_alarm_sub_second_set(ertc_alarm_type alarm_x, uint32_t value, ertc_alarm_sbs_mask_type mask);
  1049. error_status ertc_alarm_enable(ertc_alarm_type alarm_x, confirm_state new_state);
  1050. void ertc_alarm_get(ertc_alarm_type alarm_x, ertc_alarm_value_type* alarm);
  1051. uint32_t ertc_alarm_sub_second_get(ertc_alarm_type alarm_x);
  1052. void ertc_wakeup_clock_set(ertc_wakeup_clock_type clock);
  1053. void ertc_wakeup_counter_set(uint32_t counter);
  1054. uint16_t ertc_wakeup_counter_get(void);
  1055. error_status ertc_wakeup_enable(confirm_state new_state);
  1056. error_status ertc_smooth_calibration_config(ertc_smooth_cal_period_type period, ertc_smooth_cal_clk_add_type clk_add, uint32_t clk_dec);
  1057. error_status ertc_coarse_calibration_set(ertc_cal_direction_type dir, uint32_t value);
  1058. error_status ertc_coarse_calibration_enable(confirm_state new_state);
  1059. void ertc_cal_output_select(ertc_cal_output_select_type output);
  1060. void ertc_cal_output_enable(confirm_state new_state);
  1061. error_status ertc_time_adjust(ertc_time_adjust_type add1s, uint32_t decsbs);
  1062. void ertc_daylight_set(ertc_dst_operation_type operation, ertc_dst_save_type save);
  1063. uint8_t ertc_daylight_bpr_get(void);
  1064. error_status ertc_refer_clock_detect_enable(confirm_state new_state);
  1065. void ertc_direct_read_enable(confirm_state new_state);
  1066. void ertc_output_set(ertc_output_source_type source, ertc_output_polarity_type polarity, ertc_output_type type);
  1067. void ertc_timestamp_valid_edge_set(ertc_timestamp_valid_edge_type edge);
  1068. void ertc_timestamp_enable(confirm_state new_state);
  1069. void ertc_timestamp_get(ertc_time_type* time);
  1070. uint32_t ertc_timestamp_sub_second_get(void);
  1071. void ertc_tamper_pull_up_enable(confirm_state new_state);
  1072. void ertc_tamper_precharge_set(ertc_tamper_precharge_type precharge);
  1073. void ertc_tamper_filter_set(ertc_tamper_filter_type filter);
  1074. void ertc_tamper_detect_freq_set(ertc_tamper_detect_freq_type freq);
  1075. void ertc_tamper_valid_edge_set(ertc_tamper_select_type tamper_x, ertc_tamper_valid_edge_type trigger);
  1076. void ertc_tamper_timestamp_enable(confirm_state new_state);
  1077. void ertc_tamper_enable(ertc_tamper_select_type tamper_x, confirm_state new_state);
  1078. void ertc_interrupt_enable(uint32_t source, confirm_state new_state);
  1079. flag_status ertc_interrupt_get(uint32_t source);
  1080. flag_status ertc_flag_get(uint32_t flag);
  1081. void ertc_flag_clear(uint32_t flag);
  1082. void ertc_bpr_data_write(ertc_dt_type dt, uint32_t data);
  1083. uint32_t ertc_bpr_data_read(ertc_dt_type dt);
  1084. /**
  1085. * @}
  1086. */
  1087. /**
  1088. * @}
  1089. */
  1090. /**
  1091. * @}
  1092. */
  1093. #ifdef __cplusplus
  1094. }
  1095. #endif
  1096. #endif