at32f423_ertc.h 36 KB

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