rtc_cntl_struct.h 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef _SOC_RTC_CNTL_STRUCT_H_
  7. #define _SOC_RTC_CNTL_STRUCT_H_
  8. #include <stdint.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef volatile struct rtc_cntl_dev_s {
  13. union {
  14. struct {
  15. uint32_t sw_stall_appcpu_c0 : 2; /*{reg_sw_stall_appcpu_c1[5:0], reg_sw_stall_appcpu_c0[1:0]} == 0x86 will stall APP CPU*/
  16. uint32_t sw_stall_procpu_c0 : 2; /*{reg_sw_stall_procpu_c1[5:0], reg_sw_stall_procpu_c0[1:0]} == 0x86 will stall PRO CPU*/
  17. uint32_t sw_appcpu_rst : 1; /*APP CPU SW reset*/
  18. uint32_t sw_procpu_rst : 1; /*PRO CPU SW reset*/
  19. uint32_t bb_i2c_force_pd : 1; /*BB_I2C force power down*/
  20. uint32_t bb_i2c_force_pu : 1; /*BB_I2C force power up*/
  21. uint32_t bbpll_i2c_force_pd : 1; /*BB_PLL _I2C force power down*/
  22. uint32_t bbpll_i2c_force_pu : 1; /*BB_PLL_I2C force power up*/
  23. uint32_t bbpll_force_pd : 1; /*BB_PLL force power down*/
  24. uint32_t bbpll_force_pu : 1; /*BB_PLL force power up*/
  25. uint32_t xtl_force_pd : 1; /*crystall force power down*/
  26. uint32_t xtl_force_pu : 1; /*crystall force power up*/
  27. uint32_t xtl_en_wait : 4; /*wait bias_sleep and current source wakeup*/
  28. uint32_t reserved18 : 5;
  29. uint32_t xtl_force_iso : 1;
  30. uint32_t pll_force_iso : 1;
  31. uint32_t analog_force_iso : 1;
  32. uint32_t xtl_force_noiso : 1;
  33. uint32_t pll_force_noiso : 1;
  34. uint32_t analog_force_noiso : 1;
  35. uint32_t dg_wrap_force_rst : 1; /*digital wrap force reset in deep sleep*/
  36. uint32_t dg_wrap_force_norst : 1; /*digital core force no reset in deep sleep*/
  37. uint32_t sw_sys_rst : 1; /*SW system reset*/
  38. };
  39. uint32_t val;
  40. } options0;
  41. uint32_t slp_timer0;
  42. union {
  43. struct {
  44. uint32_t slp_val_hi : 16; /*RTC sleep timer high 16 bits*/
  45. uint32_t main_timer_alarm_en : 1; /*timer alarm enable bit*/
  46. uint32_t reserved17 : 15;
  47. };
  48. uint32_t val;
  49. } slp_timer1;
  50. union {
  51. struct {
  52. uint32_t reserved0 : 27;
  53. uint32_t timer_sys_stall : 1; /*Enable to record system stall time*/
  54. uint32_t timer_xtl_off : 1; /*Enable to record 40M XTAL OFF time*/
  55. uint32_t timer_sys_rst : 1; /*enable to record system reset time*/
  56. uint32_t reserved30 : 1;
  57. uint32_t update : 1; /*Set 1: to update register with RTC timer*/
  58. };
  59. uint32_t val;
  60. } time_update;
  61. uint32_t time_low0;
  62. union {
  63. struct {
  64. uint32_t rtc_timer_value0_high : 16; /*RTC timer high 16 bits*/
  65. uint32_t reserved16 : 16;
  66. };
  67. uint32_t val;
  68. } time_high0;
  69. union {
  70. struct {
  71. uint32_t rtc_sw_cpu_int : 1; /*rtc software interrupt to main cpu*/
  72. uint32_t rtc_slp_reject_cause_clr : 1; /*clear rtc sleep reject cause*/
  73. uint32_t reserved2 : 20;
  74. uint32_t apb2rtc_bridge_sel : 1; /*1: APB to RTC using bridge*/
  75. uint32_t reserved23 : 5;
  76. uint32_t sdio_active_ind : 1; /*SDIO active indication*/
  77. uint32_t slp_wakeup : 1; /*leep wakeup bit*/
  78. uint32_t slp_reject : 1; /*leep reject bit*/
  79. uint32_t sleep_en : 1; /*sleep enable bit*/
  80. };
  81. uint32_t val;
  82. } state0;
  83. union {
  84. struct {
  85. uint32_t cpu_stall_en : 1; /*CPU stall enable bit*/
  86. uint32_t cpu_stall_wait : 5; /*CPU stall wait cycles in fast_clk_rtc*/
  87. uint32_t ck8m_wait : 8; /*CK8M wait cycles in slow_clk_rtc*/
  88. uint32_t xtl_buf_wait : 10; /*XTAL wait cycles in slow_clk_rtc*/
  89. uint32_t pll_buf_wait : 8; /*PLL wait cycles in slow_clk_rtc*/
  90. };
  91. uint32_t val;
  92. } timer1;
  93. union {
  94. struct {
  95. uint32_t reserved0 : 15;
  96. uint32_t ulpcp_touch_start_wait : 9; /*wait cycles in slow_clk_rtc before ULP-coprocessor / touch controller start to work*/
  97. uint32_t min_time_ck8m_off : 8; /*minimal cycles in slow_clk_rtc for CK8M in power down state*/
  98. };
  99. uint32_t val;
  100. } timer2;
  101. union {
  102. struct {
  103. uint32_t wifi_wait_timer : 9;
  104. uint32_t wifi_powerup_timer : 7;
  105. uint32_t bt_wait_timer : 9;
  106. uint32_t bt_powerup_timer : 7;
  107. };
  108. uint32_t val;
  109. } timer3;
  110. union {
  111. struct {
  112. uint32_t rtc_wait_timer : 9;
  113. uint32_t rtc_powerup_timer : 7;
  114. uint32_t dg_wrap_wait_timer : 9;
  115. uint32_t dg_wrap_powerup_timer : 7;
  116. };
  117. uint32_t val;
  118. } timer4;
  119. union {
  120. struct {
  121. uint32_t reserved0 : 8;
  122. uint32_t min_slp_val : 8; /*minimal sleep cycles in slow_clk_rtc*/
  123. uint32_t reserved16 : 16;
  124. };
  125. uint32_t val;
  126. } timer5;
  127. union {
  128. struct {
  129. uint32_t cpu_top_wait_timer : 9;
  130. uint32_t cpu_top_powerup_timer : 7;
  131. uint32_t dg_peri_wait_timer : 9;
  132. uint32_t dg_peri_powerup_timer : 7;
  133. };
  134. uint32_t val;
  135. } timer6;
  136. union {
  137. struct {
  138. uint32_t reserved0 : 18;
  139. uint32_t i2c_reset_por_force_pd : 1;
  140. uint32_t i2c_reset_por_force_pu : 1;
  141. uint32_t glitch_rst_en : 1;
  142. uint32_t reserved21 : 1; /*PLLA force power down*/
  143. uint32_t sar_i2c_pu : 1; /*PLLA force power up*/
  144. uint32_t analog_top_iso_sleep : 1; /*PLLA force power down*/
  145. uint32_t analog_top_iso_monitor : 1; /*PLLA force power up*/
  146. uint32_t bbpll_cal_slp_start : 1; /*start BBPLL calibration during sleep*/
  147. uint32_t pvtmon_pu : 1; /*1: PVTMON power up*/
  148. uint32_t txrf_i2c_pu : 1; /*1: TXRF_I2C power up*/
  149. uint32_t rfrx_pbus_pu : 1; /*1: RFRX_PBUS power up*/
  150. uint32_t reserved29 : 1;
  151. uint32_t ckgen_i2c_pu : 1; /*1: CKGEN_I2C power up*/
  152. uint32_t pll_i2c_pu : 1;
  153. };
  154. uint32_t val;
  155. } ana_conf;
  156. union {
  157. struct {
  158. uint32_t reset_cause_procpu : 6; /*reset cause of PRO CPU*/
  159. uint32_t reset_cause_appcpu : 6; /*reset cause of APP CPU*/
  160. uint32_t appcpu_stat_vector_sel : 1; /*APP CPU state vector sel*/
  161. uint32_t procpu_stat_vector_sel : 1; /*PRO CPU state vector sel*/
  162. uint32_t reset_flag_procpu : 1; /*PRO CPU reset_flag*/
  163. uint32_t reset_flag_appcpu : 1; /*APP CPU reset flag*/
  164. uint32_t reset_flag_procpu_clr : 1; /*clear PRO CPU reset_flag*/
  165. uint32_t reset_flag_appcpu_clr : 1; /*clear APP CPU reset flag*/
  166. uint32_t appcpu_ocd_halt_on_reset : 1; /*APPCPU OcdHaltOnReset*/
  167. uint32_t procpu_ocd_halt_on_reset : 1; /*PROCPU OcdHaltOnReset*/
  168. uint32_t reset_flag_jtag_procpu : 1;
  169. uint32_t reset_flag_jtag_appcpu : 1;
  170. uint32_t reset_flag_jtag_procpu_clr : 1;
  171. uint32_t reset_flag_jtag_appcpu_clr : 1;
  172. uint32_t rtc_app_dreset_mask : 1;
  173. uint32_t rtc_pro_dreset_mask : 1;
  174. uint32_t reserved26 : 6;
  175. };
  176. uint32_t val;
  177. } reset_state;
  178. union {
  179. struct {
  180. uint32_t reserved0 : 15;
  181. uint32_t rtc_wakeup_ena : 17; /*wakeup enable bitmap*/
  182. };
  183. uint32_t val;
  184. } wakeup_state;
  185. union {
  186. struct {
  187. uint32_t slp_wakeup : 1; /*enable sleep wakeup interrupt*/
  188. uint32_t slp_reject : 1; /*enable sleep reject interrupt*/
  189. uint32_t sdio_idle : 1; /*enable SDIO idle interrupt*/
  190. uint32_t rtc_wdt : 1; /*enable RTC WDT interrupt*/
  191. uint32_t rtc_touch_scan_done : 1; /*enable touch scan done interrupt*/
  192. uint32_t rtc_ulp_cp : 1; /*enable ULP-coprocessor interrupt*/
  193. uint32_t rtc_touch_done : 1; /*enable touch done interrupt*/
  194. uint32_t rtc_touch_active : 1; /*enable touch active interrupt*/
  195. uint32_t rtc_touch_inactive : 1; /*enable touch inactive interrupt*/
  196. uint32_t rtc_brown_out : 1; /*enable brown out interrupt*/
  197. uint32_t rtc_main_timer : 1; /*enable RTC main timer interrupt*/
  198. uint32_t rtc_saradc1 : 1; /*enable saradc1 interrupt*/
  199. uint32_t rtc_tsens : 1; /*enable tsens interrupt*/
  200. uint32_t rtc_cocpu : 1; /*enable riscV cocpu interrupt*/
  201. uint32_t rtc_saradc2 : 1; /*enable saradc2 interrupt*/
  202. uint32_t rtc_swd : 1; /*enable super watch dog interrupt*/
  203. uint32_t rtc_xtal32k_dead : 1; /*enable xtal32k_dead interrupt*/
  204. uint32_t rtc_cocpu_trap : 1; /*enable cocpu trap interrupt*/
  205. uint32_t rtc_touch_timeout : 1; /*enable touch timeout interrupt*/
  206. uint32_t rtc_glitch_det : 1; /*enbale gitch det interrupt*/
  207. uint32_t rtc_touch_approach_loop_done : 1;
  208. uint32_t reserved21 : 11;
  209. };
  210. uint32_t val;
  211. } int_ena;
  212. union {
  213. struct {
  214. uint32_t slp_wakeup : 1; /*sleep wakeup interrupt raw*/
  215. uint32_t slp_reject : 1; /*sleep reject interrupt raw*/
  216. uint32_t sdio_idle : 1; /*SDIO idle interrupt raw*/
  217. uint32_t rtc_wdt : 1; /*RTC WDT interrupt raw*/
  218. uint32_t rtc_touch_scan_done : 1;
  219. uint32_t rtc_ulp_cp : 1; /*ULP-coprocessor interrupt raw*/
  220. uint32_t rtc_touch_done : 1; /*touch interrupt raw*/
  221. uint32_t rtc_touch_active : 1; /*touch active interrupt raw*/
  222. uint32_t rtc_touch_inactive : 1; /*touch inactive interrupt raw*/
  223. uint32_t rtc_brown_out : 1; /*brown out interrupt raw*/
  224. uint32_t rtc_main_timer : 1; /*RTC main timer interrupt raw*/
  225. uint32_t rtc_saradc1 : 1; /*saradc1 interrupt raw*/
  226. uint32_t rtc_tsens : 1; /*tsens interrupt raw*/
  227. uint32_t rtc_cocpu : 1; /*riscV cocpu interrupt raw*/
  228. uint32_t rtc_saradc2 : 1; /*saradc2 interrupt raw*/
  229. uint32_t rtc_swd : 1; /*super watch dog interrupt raw*/
  230. uint32_t rtc_xtal32k_dead : 1; /*xtal32k dead detection interrupt raw*/
  231. uint32_t rtc_cocpu_trap : 1; /*cocpu trap interrupt raw*/
  232. uint32_t rtc_touch_timeout : 1; /*touch timeout interrupt raw*/
  233. uint32_t rtc_glitch_det : 1; /*glitch_det_interrupt_raw*/
  234. uint32_t rtc_touch_approach_loop_done : 1;
  235. uint32_t reserved21 : 11;
  236. };
  237. uint32_t val;
  238. } int_raw;
  239. union {
  240. struct {
  241. uint32_t slp_wakeup : 1; /*sleep wakeup interrupt state*/
  242. uint32_t slp_reject : 1; /*sleep reject interrupt state*/
  243. uint32_t sdio_idle : 1; /*SDIO idle interrupt state*/
  244. uint32_t rtc_wdt : 1; /*RTC WDT interrupt state*/
  245. uint32_t rtc_touch_scan_done : 1;
  246. uint32_t rtc_ulp_cp : 1; /*ULP-coprocessor interrupt state*/
  247. uint32_t rtc_touch_done : 1; /*touch done interrupt state*/
  248. uint32_t rtc_touch_active : 1; /*touch active interrupt state*/
  249. uint32_t rtc_touch_inactive : 1; /*touch inactive interrupt state*/
  250. uint32_t rtc_brown_out : 1; /*brown out interrupt state*/
  251. uint32_t rtc_main_timer : 1; /*RTC main timer interrupt state*/
  252. uint32_t rtc_saradc1 : 1; /*saradc1 interrupt state*/
  253. uint32_t rtc_tsens : 1; /*tsens interrupt state*/
  254. uint32_t rtc_cocpu : 1; /*riscV cocpu interrupt state*/
  255. uint32_t rtc_saradc2 : 1; /*saradc2 interrupt state*/
  256. uint32_t rtc_swd : 1; /*super watch dog interrupt state*/
  257. uint32_t rtc_xtal32k_dead : 1; /*xtal32k dead detection interrupt state*/
  258. uint32_t rtc_cocpu_trap : 1; /*cocpu trap interrupt state*/
  259. uint32_t rtc_touch_timeout : 1; /*Touch timeout interrupt state*/
  260. uint32_t rtc_glitch_det : 1; /*glitch_det_interrupt state*/
  261. uint32_t rtc_touch_approach_loop_done : 1;
  262. uint32_t reserved21 : 11;
  263. };
  264. uint32_t val;
  265. } int_st;
  266. union {
  267. struct {
  268. uint32_t slp_wakeup : 1; /*Clear sleep wakeup interrupt state*/
  269. uint32_t slp_reject : 1; /*Clear sleep reject interrupt state*/
  270. uint32_t sdio_idle : 1; /*Clear SDIO idle interrupt state*/
  271. uint32_t rtc_wdt : 1; /*Clear RTC WDT interrupt state*/
  272. uint32_t rtc_touch_scan_done : 1;
  273. uint32_t rtc_ulp_cp : 1; /*Clear ULP-coprocessor interrupt state*/
  274. uint32_t rtc_touch_done : 1; /*Clear touch done interrupt state*/
  275. uint32_t rtc_touch_active : 1; /*Clear touch active interrupt state*/
  276. uint32_t rtc_touch_inactive : 1; /*Clear touch inactive interrupt state*/
  277. uint32_t rtc_brown_out : 1; /*Clear brown out interrupt state*/
  278. uint32_t rtc_main_timer : 1; /*Clear RTC main timer interrupt state*/
  279. uint32_t rtc_saradc1 : 1; /*Clear saradc1 interrupt state*/
  280. uint32_t rtc_tsens : 1; /*Clear tsens interrupt state*/
  281. uint32_t rtc_cocpu : 1; /*Clear riscV cocpu interrupt state*/
  282. uint32_t rtc_saradc2 : 1; /*Clear saradc2 interrupt state*/
  283. uint32_t rtc_swd : 1; /*Clear super watch dog interrupt state*/
  284. uint32_t rtc_xtal32k_dead : 1; /*Clear RTC WDT interrupt state*/
  285. uint32_t rtc_cocpu_trap : 1; /*Clear cocpu trap interrupt state*/
  286. uint32_t rtc_touch_timeout : 1; /*Clear touch timeout interrupt state*/
  287. uint32_t rtc_glitch_det : 1; /*Clear glitch det interrupt state*/
  288. uint32_t rtc_touch_approach_loop_done : 1;
  289. uint32_t reserved21 : 11;
  290. };
  291. uint32_t val;
  292. } int_clr;
  293. uint32_t store[4];
  294. union {
  295. struct {
  296. uint32_t xtal32k_wdt_en : 1; /*xtal 32k watch dog enable*/
  297. uint32_t xtal32k_wdt_clk_fo : 1; /*xtal 32k watch dog clock force on*/
  298. uint32_t xtal32k_wdt_reset : 1; /*xtal 32k watch dog sw reset*/
  299. uint32_t xtal32k_ext_clk_fo : 1; /*xtal 32k external xtal clock force on*/
  300. uint32_t xtal32k_auto_backup : 1; /*xtal 32k switch to back up clock when xtal is dead*/
  301. uint32_t xtal32k_auto_restart : 1; /*xtal 32k restart xtal when xtal is dead*/
  302. uint32_t xtal32k_auto_return : 1; /*xtal 32k switch back xtal when xtal is restarted*/
  303. uint32_t xtal32k_xpd_force : 1; /*Xtal 32k xpd control by sw or fsm*/
  304. uint32_t enckinit_xtal_32k : 1; /*apply an internal clock to help xtal 32k to start*/
  305. uint32_t dbuf_xtal_32k : 1; /*0: single-end buffer 1: differential buffer*/
  306. uint32_t dgm_xtal_32k : 3; /*xtal_32k gm control*/
  307. uint32_t dres_xtal_32k : 3; /*DRES_XTAL_32K*/
  308. uint32_t xpd_xtal_32k : 1; /*XPD_XTAL_32K*/
  309. uint32_t dac_xtal_32k : 3; /*DAC_XTAL_32K*/
  310. uint32_t rtc_wdt_state : 3; /*state of 32k_wdt*/
  311. uint32_t rtc_xtal32k_gpio_sel : 1; /*XTAL_32K sel. 0: external XTAL_32K*/
  312. uint32_t reserved24 : 6;
  313. uint32_t ctr_lv : 1; /*0: power down XTAL at high level*/
  314. uint32_t ctr_en : 1;
  315. };
  316. uint32_t val;
  317. } ext_xtl_conf;
  318. union {
  319. struct {
  320. uint32_t reserved0 : 29;
  321. uint32_t gpio_wakeup_filter : 1; /*enable filter for gpio wakeup event*/
  322. uint32_t ext_wakeup0_lv : 1; /*0: external wakeup at low level*/
  323. uint32_t ext_wakeup1_lv : 1;
  324. };
  325. uint32_t val;
  326. } ext_wakeup_conf;
  327. union {
  328. struct {
  329. uint32_t reserved0 : 12;
  330. uint32_t rtc_sleep_reject_ena : 18; /*sleep reject enable*/
  331. uint32_t light_slp_reject_en : 1; /*enable reject for light sleep*/
  332. uint32_t deep_slp_reject_en : 1; /*enable reject for deep sleep*/
  333. };
  334. uint32_t val;
  335. } slp_reject_conf;
  336. union {
  337. struct {
  338. uint32_t reserved0 : 29;
  339. uint32_t cpusel_conf : 1; /*CPU sel option*/
  340. uint32_t cpuperiod_sel : 2;
  341. };
  342. uint32_t val;
  343. } cpu_period_conf;
  344. union {
  345. struct {
  346. uint32_t reserved0 : 22;
  347. uint32_t sdio_act_dnum : 10;
  348. };
  349. uint32_t val;
  350. } sdio_act_conf;
  351. union {
  352. struct {
  353. uint32_t reserved0 : 1;
  354. uint32_t efuse_clk_force_gating : 1;
  355. uint32_t efuse_clk_force_nogating : 1;
  356. uint32_t ck8m_div_sel_vld : 1; /*used to sync reg_ck8m_div_sel bus. Clear vld before set reg_ck8m_div_sel*/
  357. uint32_t ck8m_div : 2; /*CK8M_D256_OUT divider. 00: div128*/
  358. uint32_t enb_ck8m : 1; /*disable CK8M and CK8M_D256_OUT*/
  359. uint32_t enb_ck8m_div : 1; /*1: CK8M_D256_OUT is actually CK8M*/
  360. uint32_t dig_xtal32k_en : 1; /*enable CK_XTAL_32K for digital core (no relationship with RTC core)*/
  361. uint32_t dig_clk8m_d256_en : 1; /*enable CK8M_D256_OUT for digital core (no relationship with RTC core)*/
  362. uint32_t dig_clk8m_en : 1; /*enable CK8M for digital core (no relationship with RTC core)*/
  363. uint32_t reserved11 : 1;
  364. uint32_t ck8m_div_sel : 3; /*divider = reg_ck8m_div_sel + 1*/
  365. uint32_t xtal_force_nogating : 1; /*XTAL force no gating during sleep*/
  366. uint32_t ck8m_force_nogating : 1; /*CK8M force no gating during sleep*/
  367. uint32_t ck8m_dfreq : 8; /*CK8M_DFREQ*/
  368. uint32_t ck8m_force_pd : 1; /*CK8M force power down*/
  369. uint32_t ck8m_force_pu : 1; /*CK8M force power up*/
  370. uint32_t xtal_global_force_gating : 1;
  371. uint32_t xtal_global_force_nogating : 1;
  372. uint32_t fast_clk_rtc_sel : 1; /*fast_clk_rtc sel. 0: XTAL div 2*/
  373. uint32_t ana_clk_rtc_sel : 2;
  374. };
  375. uint32_t val;
  376. } clk_conf;
  377. union {
  378. struct {
  379. uint32_t reserved0 : 22;
  380. uint32_t rtc_ana_clk_div_vld : 1; /*used to sync div bus. clear vld before set reg_rtc_ana_clk_div*/
  381. uint32_t rtc_ana_clk_div : 8;
  382. uint32_t slow_clk_next_edge : 1;
  383. };
  384. uint32_t val;
  385. } slow_clk_conf;
  386. union {
  387. struct {
  388. uint32_t sdio_timer_target : 8; /*timer count to apply reg_sdio_dcap after sdio power on*/
  389. uint32_t reserved8 : 1;
  390. uint32_t sdio_dthdrv : 2; /*Tieh = 1 mode drive ability. Initially set to 0 to limit charge current*/
  391. uint32_t sdio_dcap : 2; /*ability to prevent LDO from overshoot*/
  392. uint32_t sdio_initi : 2; /*add resistor from ldo output to ground. 0: no res*/
  393. uint32_t sdio_en_initi : 1; /*0 to set init[1:0]=0*/
  394. uint32_t sdio_dcurlim : 3; /*tune current limit threshold when tieh = 0. About 800mA/(8+d)*/
  395. uint32_t sdio_modecurlim : 1; /*select current limit mode*/
  396. uint32_t sdio_encurlim : 1; /*enable current limit*/
  397. uint32_t sdio_pd_en : 1; /*power down SDIO_REG in sleep. Only active when reg_sdio_force = 0*/
  398. uint32_t sdio_force : 1; /*1: use SW option to control SDIO_REG*/
  399. uint32_t sdio_tieh : 1; /*SW option for SDIO_TIEH. Only active when reg_sdio_force = 1*/
  400. uint32_t reg1p8_ready : 1; /*read only register for REG1P8_READY*/
  401. uint32_t drefl_sdio : 2; /*SW option for DREFL_SDIO. Only active when reg_sdio_force = 1*/
  402. uint32_t drefm_sdio : 2; /*SW option for DREFM_SDIO. Only active when reg_sdio_force = 1*/
  403. uint32_t drefh_sdio : 2; /*SW option for DREFH_SDIO. Only active when reg_sdio_force = 1*/
  404. uint32_t xpd_sdio : 1;
  405. };
  406. uint32_t val;
  407. } sdio_conf;
  408. union {
  409. struct {
  410. uint32_t reserved0 : 10;
  411. uint32_t bias_buf_idle : 1;
  412. uint32_t bias_buf_wake : 1;
  413. uint32_t bias_buf_deep_slp : 1;
  414. uint32_t bias_buf_monitor : 1;
  415. uint32_t pd_cur_deep_slp : 1; /*xpd cur when rtc in sleep_state*/
  416. uint32_t pd_cur_monitor : 1; /*xpd cur when rtc in monitor state*/
  417. uint32_t bias_sleep_deep_slp : 1; /*bias_sleep when rtc in sleep_state*/
  418. uint32_t bias_sleep_monitor : 1; /*bias_sleep when rtc in monitor state*/
  419. uint32_t dbg_atten_deep_slp : 4; /*DBG_ATTEN when rtc in sleep state*/
  420. uint32_t dbg_atten_monitor : 4; /*DBG_ATTEN when rtc in monitor state*/
  421. uint32_t dbg_atten_wakeup : 4;
  422. uint32_t reserved30 : 2;
  423. };
  424. uint32_t val;
  425. } bias_conf;
  426. union {
  427. struct {
  428. uint32_t reserved0 : 7;
  429. uint32_t dig_cal_en : 1;
  430. uint32_t reserved8 : 6;
  431. uint32_t sck_dcap : 8; /*SCK_DCAP*/
  432. uint32_t reserved22 : 6;
  433. uint32_t rtc_dboost_force_pd : 1; /*RTC_DBOOST force power down*/
  434. uint32_t rtc_dboost_force_pu : 1; /*RTC_DBOOST force power up*/
  435. uint32_t rtculator_force_pd : 1; /*RTC_REG force power down (for RTC_REG power down means decrease the voltage to 0.8v or lower )*/
  436. uint32_t rtculator_force_pu : 1;
  437. };
  438. uint32_t val;
  439. } rtc;
  440. union {
  441. struct {
  442. uint32_t rtc_fastmem_force_noiso : 1; /*Fast RTC memory force no ISO*/
  443. uint32_t rtc_fastmem_force_iso : 1; /*Fast RTC memory force ISO*/
  444. uint32_t rtc_slowmem_force_noiso : 1; /*RTC memory force no ISO*/
  445. uint32_t rtc_slowmem_force_iso : 1; /*RTC memory force ISO*/
  446. uint32_t rtc_force_iso : 1; /*rtc_peri force ISO*/
  447. uint32_t rtc_force_noiso : 1; /*rtc_peri force no ISO*/
  448. uint32_t rtc_fastmem_folw_cpu : 1; /*1: Fast RTC memory PD following CPU*/
  449. uint32_t fastmem_force_lpd : 1; /*Fast RTC memory force PD*/
  450. uint32_t fastmem_force_lpu : 1; /*Fast RTC memory force no PD*/
  451. uint32_t rtc_slowmem_folw_cpu : 1; /*1: RTC memory PD following CPU*/
  452. uint32_t rtc_slowmem_force_lpd : 1; /*RTC memory force PD*/
  453. uint32_t rtc_slowmem_force_lpu : 1; /*RTC memory force no PD*/
  454. uint32_t reserved12 : 6; /*enable power down RTC memory in sleep*/
  455. uint32_t rtc_force_pd : 1; /*rtc_peri force power down*/
  456. uint32_t rtc_force_pu : 1; /*rtc_peri force power up*/
  457. uint32_t rtc_pd_en : 1; /*enable power down rtc_peri in sleep */
  458. uint32_t rtc_pad_force_hold : 1; /*rtc pad force hold*/
  459. uint32_t reserved22 : 10;
  460. };
  461. uint32_t val;
  462. } pwc;
  463. union {
  464. struct {
  465. uint32_t rtculator_drv_b_monitor : 6;
  466. uint32_t rtculator_drv_b_slp : 6;
  467. uint32_t dg_vdd_drv_b_slp : 8;
  468. uint32_t dg_vdd_drv_b_monitor : 8;
  469. uint32_t reserved28 : 4;
  470. };
  471. uint32_t val;
  472. } regulator_drv_ctrl;
  473. union {
  474. struct {
  475. uint32_t reserved0 : 3;
  476. uint32_t lslp_mem_force_pd : 1; /*memories in digital core force PD in sleep*/
  477. uint32_t lslp_mem_force_pu : 1; /*memories in digital core force no PD in sleep*/
  478. uint32_t reserved5 : 6; /*internal SRAM 1 force power up*/
  479. uint32_t bt_force_pd : 1; /*internal SRAM 2 force power down*/
  480. uint32_t bt_force_pu : 1; /*internal SRAM 2 force power up*/
  481. uint32_t dg_peri_force_pd : 1; /*internal SRAM 3 force power down*/
  482. uint32_t dg_peri_force_pu : 1; /*internal SRAM 3 force power up*/
  483. uint32_t reserved15 : 2; /*internal SRAM 4 force power up*/
  484. uint32_t wifi_force_pd : 1; /*wifi force power down*/
  485. uint32_t wifi_force_pu : 1; /*wifi force power up*/
  486. uint32_t dg_wrap_force_pd : 1; /*digital core force power down*/
  487. uint32_t dg_wrap_force_pu : 1; /*digital core force power up*/
  488. uint32_t cpu_top_force_pd : 1; /*digital dcdc force power down*/
  489. uint32_t cpu_top_force_pu : 1; /*digital dcdc force power up*/
  490. uint32_t reserved23 : 4; /*enable power down internal SRAM 1 in sleep*/
  491. uint32_t bt_pd_en : 1; /*enable power down internal SRAM 2 in sleep*/
  492. uint32_t dg_peri_pd_en : 1; /*enable power down internal SRAM 3 in sleep*/
  493. uint32_t cpu_top_pd_en : 1; /*enable power down internal SRAM 4 in sleep*/
  494. uint32_t wifi_pd_en : 1; /*enable power down wifi in sleep*/
  495. uint32_t dg_wrap_pd_en : 1;
  496. };
  497. uint32_t val;
  498. } dig_pwc;
  499. union {
  500. struct {
  501. uint32_t reserved0 : 7;
  502. uint32_t dig_iso_force_off : 1;
  503. uint32_t dig_iso_force_on : 1;
  504. uint32_t dg_pad_autohold : 1; /*read only register to indicate digital pad auto-hold status*/
  505. uint32_t clr_dg_pad_autohold : 1; /*wtite only register to clear digital pad auto-hold*/
  506. uint32_t dg_pad_autohold_en : 1; /*digital pad enable auto-hold*/
  507. uint32_t dg_pad_force_noiso : 1; /*digital pad force no ISO*/
  508. uint32_t dg_pad_force_iso : 1; /*digital pad force ISO*/
  509. uint32_t dg_pad_force_unhold : 1; /*digital pad force un-hold*/
  510. uint32_t dg_pad_force_hold : 1; /*digital pad force hold*/
  511. uint32_t reserved16 : 6; /*internal SRAM 1 force no ISO*/
  512. uint32_t bt_force_iso : 1; /*internal SRAM 2 force ISO*/
  513. uint32_t bt_force_noiso : 1; /*internal SRAM 2 force no ISO*/
  514. uint32_t dg_peri_force_iso : 1; /*internal SRAM 3 force ISO*/
  515. uint32_t dg_peri_force_noiso : 1; /*internal SRAM 3 force no ISO*/
  516. uint32_t cpu_top_force_iso : 1; /*internal SRAM 4 force ISO*/
  517. uint32_t cpu_top_force_noiso : 1; /*internal SRAM 4 force no ISO*/
  518. uint32_t wifi_force_iso : 1; /*wifi force ISO*/
  519. uint32_t wifi_force_noiso : 1; /*wifi force no ISO*/
  520. uint32_t dg_wrap_force_iso : 1; /*digital core force ISO*/
  521. uint32_t dg_wrap_force_noiso : 1;
  522. };
  523. uint32_t val;
  524. } dig_iso;
  525. union {
  526. struct {
  527. uint32_t chip_reset_width : 8; /*chip reset siginal pulse width*/
  528. uint32_t chip_reset_en : 1; /*wdt reset whole chip enable*/
  529. uint32_t pause_in_slp : 1; /*pause WDT in sleep*/
  530. uint32_t appcpu_reset_en : 1; /*enable WDT reset APP CPU*/
  531. uint32_t procpu_reset_en : 1; /*enable WDT reset PRO CPU*/
  532. uint32_t flashboot_mod_en : 1; /*enable WDT in flash boot*/
  533. uint32_t sys_reset_length : 3; /*system reset counter length*/
  534. uint32_t cpu_reset_length : 3; /*CPU reset counter length*/
  535. uint32_t stg3 : 3; /*1: interrupt stage en*/
  536. uint32_t stg2 : 3; /*1: interrupt stage en*/
  537. uint32_t stg1 : 3; /*1: interrupt stage en*/
  538. uint32_t stg0 : 3; /*1: interrupt stage en*/
  539. uint32_t en : 1;
  540. };
  541. uint32_t val;
  542. } wdt_config0;
  543. uint32_t wdt_config1;
  544. uint32_t wdt_config2;
  545. uint32_t wdt_config3;
  546. uint32_t wdt_config4;
  547. union {
  548. struct {
  549. uint32_t reserved0 : 31;
  550. uint32_t feed : 1;
  551. };
  552. uint32_t val;
  553. } wdt_feed;
  554. uint32_t wdt_wprotect;
  555. union {
  556. struct {
  557. uint32_t swd_reset_flag : 1; /*swd reset flag*/
  558. uint32_t swd_feed_int : 1; /*swd interrupt for feeding*/
  559. uint32_t reserved2 : 15;
  560. uint32_t swd_bypass_rst : 1;
  561. uint32_t swd_signal_width : 10; /*adjust signal width send to swd*/
  562. uint32_t swd_rst_flag_clr : 1; /*reset swd reset flag*/
  563. uint32_t swd_feed : 1; /*Sw feed swd*/
  564. uint32_t swd_disable : 1; /*disabel SWD*/
  565. uint32_t swd_auto_feed_en : 1; /*automatically feed swd when int comes*/
  566. };
  567. uint32_t val;
  568. } swd_conf;
  569. uint32_t swd_wprotect;
  570. union {
  571. struct {
  572. uint32_t reserved0 : 20;
  573. uint32_t appcpu_c1 : 6; /*{reg_sw_stall_appcpu_c1[5:0]*/
  574. uint32_t procpu_c1 : 6;
  575. };
  576. uint32_t val;
  577. } sw_cpu_stall;
  578. uint32_t store4;
  579. uint32_t store5;
  580. uint32_t store6;
  581. uint32_t store7;
  582. union {
  583. struct {
  584. uint32_t xpd_rom0 : 1; /*rom0 power down*/
  585. uint32_t reserved1 : 1;
  586. uint32_t xpd_dig_dcdc : 1; /*External DCDC power down*/
  587. uint32_t rtc_peri_iso : 1; /*rtc peripheral iso*/
  588. uint32_t xpd_rtc_peri : 1; /*rtc peripheral power down */
  589. uint32_t wifi_iso : 1; /*wifi iso*/
  590. uint32_t xpd_wifi : 1; /*wifi wrap power down*/
  591. uint32_t dig_iso : 1; /*digital wrap iso*/
  592. uint32_t xpd_dig : 1; /*digital wrap power down*/
  593. uint32_t rtc_touch_state_start : 1; /*touch should start to work*/
  594. uint32_t rtc_touch_state_switch : 1; /*touch is about to working. Switch rtc main state*/
  595. uint32_t rtc_touch_state_slp : 1; /*touch is in sleep state*/
  596. uint32_t rtc_touch_state_done : 1; /*touch is done*/
  597. uint32_t rtc_cocpu_state_start : 1; /*ulp/cocpu should start to work*/
  598. uint32_t rtc_cocpu_state_switch : 1; /*ulp/cocpu is about to working. Switch rtc main state*/
  599. uint32_t rtc_cocpu_state_slp : 1; /*ulp/cocpu is in sleep state*/
  600. uint32_t rtc_cocpu_state_done : 1; /*ulp/cocpu is done*/
  601. uint32_t rtc_main_state_xtal_iso : 1; /*no use any more*/
  602. uint32_t rtc_main_state_pll_on : 1; /*rtc main state machine is in states that pll should be running*/
  603. uint32_t rtc_rdy_for_wakeup : 1; /*rtc is ready to receive wake up trigger from wake up source*/
  604. uint32_t rtc_main_state_wait_end : 1; /*rtc main state machine has been waited for some cycles*/
  605. uint32_t rtc_in_wakeup_state : 1; /*rtc main state machine is in the states of wakeup process*/
  606. uint32_t rtc_in_low_power_state : 1; /*rtc main state machine is in the states of low power*/
  607. uint32_t rtc_main_state_in_wait_8m : 1; /*rtc main state machine is in wait 8m state*/
  608. uint32_t rtc_main_state_in_wait_pll : 1; /*rtc main state machine is in wait pll state*/
  609. uint32_t rtc_main_state_in_wait_xtl : 1; /*rtc main state machine is in wait xtal state*/
  610. uint32_t rtc_main_state_in_slp : 1; /*rtc main state machine is in sleep state*/
  611. uint32_t rtc_main_state_in_idle : 1; /*rtc main state machine is in idle state*/
  612. uint32_t rtc_main_state : 4; /*rtc main state machine status*/
  613. };
  614. uint32_t val;
  615. } low_power_st;
  616. uint32_t diag0;
  617. union {
  618. struct {
  619. uint32_t touch_pad0_hold : 1;
  620. uint32_t touch_pad1_hold : 1;
  621. uint32_t touch_pad2_hold : 1;
  622. uint32_t touch_pad3_hold : 1;
  623. uint32_t touch_pad4_hold : 1;
  624. uint32_t touch_pad5_hold : 1;
  625. uint32_t touch_pad6_hold : 1;
  626. uint32_t touch_pad7_hold : 1;
  627. uint32_t touch_pad8_hold : 1;
  628. uint32_t touch_pad9_hold : 1;
  629. uint32_t touch_pad10_hold : 1;
  630. uint32_t touch_pad11_hold : 1;
  631. uint32_t touch_pad12_hold : 1;
  632. uint32_t touch_pad13_hold : 1;
  633. uint32_t touch_pad14_hold : 1;
  634. uint32_t x32p_hold : 1;
  635. uint32_t x32n_hold : 1;
  636. uint32_t pdac1_hold : 1;
  637. uint32_t pdac2_hold : 1;
  638. uint32_t rtc_pad19_hold : 1;
  639. uint32_t rtc_pad20_hold : 1;
  640. uint32_t rtc_pad21_hold : 1;
  641. uint32_t reserved22 : 10;
  642. };
  643. uint32_t val;
  644. } pad_hold;
  645. uint32_t dig_pad_hold;
  646. union {
  647. struct {
  648. uint32_t ext_wakeup1_sel : 22; /*Bitmap to select RTC pads for ext wakeup1*/
  649. uint32_t ext_wakeup1_status_clr : 1; /*clear ext wakeup1 status*/
  650. uint32_t reserved23 : 9;
  651. };
  652. uint32_t val;
  653. } ext_wakeup1;
  654. union {
  655. struct {
  656. uint32_t ext_wakeup1_status : 22; /*ext wakeup1 status*/
  657. uint32_t reserved22 : 10;
  658. };
  659. uint32_t val;
  660. } ext_wakeup1_status;
  661. union {
  662. struct {
  663. uint32_t reserved0 : 4;
  664. uint32_t int_wait : 10; /*brown out interrupt wait cycles*/
  665. uint32_t close_flash_ena : 1; /*enable close flash when brown out happens*/
  666. uint32_t pd_rf_ena : 1; /*enable power down RF when brown out happens*/
  667. uint32_t rst_wait : 10; /*brown out reset wait cycles*/
  668. uint32_t rst_ena : 1; /*enable brown out reset*/
  669. uint32_t rst_sel : 1; /*1: 4-pos reset*/
  670. uint32_t ana_rst_en : 1;
  671. uint32_t cnt_clr : 1; /*clear brown out counter*/
  672. uint32_t ena : 1; /*enable brown out*/
  673. uint32_t det : 1;
  674. };
  675. uint32_t val;
  676. } brown_out;
  677. uint32_t time_low1;
  678. union {
  679. struct {
  680. uint32_t rtc_timer_value1_high : 16; /*RTC timer high 16 bits*/
  681. uint32_t reserved16 : 16;
  682. };
  683. uint32_t val;
  684. } time_high1;
  685. uint32_t xtal32k_clk_factor;
  686. union {
  687. struct {
  688. uint32_t xtal32k_return_wait : 4; /*cycles to wait to return noral xtal 32k*/
  689. uint32_t xtal32k_restart_wait : 16; /*cycles to wait to repower on xtal 32k*/
  690. uint32_t xtal32k_wdt_timeout : 8; /*If no clock detected for this amount of time*/
  691. uint32_t xtal32k_stable_thres : 4; /*if restarted xtal32k period is smaller than this*/
  692. };
  693. uint32_t val;
  694. } xtal32k_conf;
  695. union {
  696. struct {
  697. uint32_t ulp_cp_pc_init : 11; /*ULP-coprocessor PC initial address*/
  698. uint32_t reserved11 : 18;
  699. uint32_t ulp_cp_gpio_wakeup_ena : 1; /*ULP-coprocessor wakeup by GPIO enable*/
  700. uint32_t ulp_cp_gpio_wakeup_clr : 1; /*ULP-coprocessor wakeup by GPIO state clear*/
  701. uint32_t ulp_cp_slp_timer_en : 1; /*ULP-coprocessor timer enable bit*/
  702. };
  703. uint32_t val;
  704. } ulp_cp_timer;
  705. union {
  706. struct {
  707. uint32_t ulp_cp_mem_addr_init : 11;
  708. uint32_t ulp_cp_mem_addr_size : 11;
  709. uint32_t ulp_cp_mem_offst_clr : 1;
  710. uint32_t reserved23 : 5;
  711. uint32_t ulp_cp_clk_fo : 1; /*ulp coprocessor clk force on*/
  712. uint32_t ulp_cp_reset : 1; /*ulp coprocessor clk software reset*/
  713. uint32_t ulp_cp_force_start_top : 1; /*1: ULP-coprocessor is started by SW*/
  714. uint32_t ulp_cp_start_top : 1; /*Write 1 to start ULP-coprocessor*/
  715. };
  716. uint32_t val;
  717. } ulp_cp_ctrl;
  718. union {
  719. struct {
  720. uint32_t cocpu_clk_fo : 1; /*cocpu clk force on*/
  721. uint32_t cocpu_start_2_reset_dis : 6; /*time from start cocpu to pull down reset*/
  722. uint32_t cocpu_start_2_intr_en : 6; /*time from start cocpu to give start interrupt*/
  723. uint32_t cocpu_shut : 1; /*to shut cocpu*/
  724. uint32_t cocpu_shut_2_clk_dis : 8; /*time from shut cocpu to disable clk*/
  725. uint32_t cocpu_shut_reset_en : 1; /*to reset cocpu*/
  726. uint32_t cocpu_sel : 1; /*1: old ULP 0: new riscV*/
  727. uint32_t cocpu_done_force : 1; /*1: select riscv done 0: select ulp done*/
  728. uint32_t cocpu_done : 1; /*done signal used by riscv to control timer. */
  729. uint32_t cocpu_sw_int_trigger : 1; /*trigger cocpu register interrupt*/
  730. uint32_t cocpu_clkgate_en : 1;
  731. uint32_t reserved28 : 4;
  732. };
  733. uint32_t val;
  734. } cocpu_ctrl;
  735. union {
  736. struct {
  737. uint32_t touch_sleep_cycles : 16; /*sleep cycles for timer*/
  738. uint32_t touch_meas_num : 16; /*the meas length (in 8MHz)*/
  739. };
  740. uint32_t val;
  741. } touch_ctrl1;
  742. union {
  743. struct {
  744. uint32_t reserved0 : 2;
  745. uint32_t touch_drange : 2; /*TOUCH_DRANGE*/
  746. uint32_t touch_drefl : 2; /*TOUCH_DREFL*/
  747. uint32_t touch_drefh : 2; /*TOUCH_DREFH*/
  748. uint32_t touch_xpd_bias : 1; /*TOUCH_XPD_BIAS*/
  749. uint32_t touch_refc : 3; /*TOUCH pad0 reference cap*/
  750. uint32_t touch_dbias : 1; /*1:use self bias 0:use bandgap bias*/
  751. uint32_t touch_slp_timer_en : 1; /*touch timer enable bit*/
  752. uint32_t touch_start_fsm_en : 1; /*1: TOUCH_START & TOUCH_XPD is controlled by touch fsm*/
  753. uint32_t touch_start_en : 1; /*1: start touch fsm*/
  754. uint32_t touch_start_force : 1; /*1: to start touch fsm by SW*/
  755. uint32_t touch_xpd_wait : 8; /*the waiting cycles (in 8MHz) between TOUCH_START and TOUCH_XPD*/
  756. uint32_t touch_slp_cyc_div : 2; /*when a touch pad is active*/
  757. uint32_t touch_timer_force_done : 2; /*force touch timer done*/
  758. uint32_t touch_reset : 1; /*reset upgrade touch*/
  759. uint32_t touch_clk_fo : 1; /*touch clock force on*/
  760. uint32_t touch_clkgate_en : 1; /*touch clock enable*/
  761. };
  762. uint32_t val;
  763. } touch_ctrl2;
  764. union {
  765. struct {
  766. uint32_t touch_denoise_res : 2; /*De-noise resolution: 12/10/8/4 bit*/
  767. uint32_t touch_denoise_en : 1; /*touch pad0 will be used to de-noise*/
  768. uint32_t reserved3 : 5;
  769. uint32_t touch_inactive_connection : 1; /*inactive touch pads connect to 1: gnd 0: HighZ*/
  770. uint32_t touch_shield_pad_en : 1; /*touch pad14 will be used as shield*/
  771. uint32_t touch_scan_pad_map : 15; /*touch scan mode pad enable map*/
  772. uint32_t touch_bufdrv : 3; /*touch7 buffer driver strength*/
  773. uint32_t touch_out_ring : 4; /*select out ring pad*/
  774. };
  775. uint32_t val;
  776. } touch_scan_ctrl;
  777. union {
  778. struct {
  779. uint32_t touch_slp_th : 22; /*the threshold for sleep touch pad*/
  780. uint32_t reserved22 : 4;
  781. uint32_t touch_slp_approach_en : 1; /*sleep pad approach function enable*/
  782. uint32_t touch_slp_pad : 5; /* */
  783. };
  784. uint32_t val;
  785. } touch_slp_thres;
  786. union {
  787. struct {
  788. uint32_t reserved0 : 23;
  789. uint32_t touch_slp_channel_clr : 1; /*clear touch slp channel*/
  790. uint32_t touch_approach_meas_time : 8; /*approach pads total meas times*/
  791. };
  792. uint32_t val;
  793. } touch_approach;
  794. union {
  795. struct {
  796. uint32_t reserved0 : 7;
  797. uint32_t touch_bypass_neg_noise_thres : 1;
  798. uint32_t touch_bypass_noise_thres : 1;
  799. uint32_t touch_smooth_lvl : 2;
  800. uint32_t touch_jitter_step : 4; /*touch jitter step*/
  801. uint32_t config1: 4;
  802. uint32_t config2: 2;
  803. uint32_t touch_noise_thres : 2;
  804. uint32_t config3: 2;
  805. uint32_t touch_debounce : 3; /*debounce counter*/
  806. uint32_t touch_filter_mode : 3; /*0: IIR ? 1: IIR ? 2: IIR 1/8 3: Jitter*/
  807. uint32_t touch_filter_en : 1; /*touch filter enable*/
  808. };
  809. uint32_t val;
  810. } touch_filter_ctrl;
  811. union {
  812. struct {
  813. uint32_t usb_vrefh : 2;
  814. uint32_t usb_vrefl : 2;
  815. uint32_t usb_vref_override : 1;
  816. uint32_t usb_pad_pull_override : 1;
  817. uint32_t usb_dp_pullup : 1;
  818. uint32_t usb_dp_pulldown : 1;
  819. uint32_t usb_dm_pullup : 1;
  820. uint32_t usb_dm_pulldown : 1;
  821. uint32_t usb_pullup_value : 1;
  822. uint32_t usb_pad_enable_override : 1;
  823. uint32_t usb_pad_enable : 1;
  824. uint32_t usb_txm : 1;
  825. uint32_t usb_txp : 1;
  826. uint32_t usb_tx_en : 1;
  827. uint32_t usb_tx_en_override : 1;
  828. uint32_t usb_reset_disable : 1;
  829. uint32_t io_mux_reset_disable : 1;
  830. uint32_t sw_usb_phy_sel : 1;
  831. uint32_t sw_hw_usb_phy_sel : 1;
  832. uint32_t reserved21 : 11;
  833. };
  834. uint32_t val;
  835. } usb_conf;
  836. union {
  837. struct {
  838. uint32_t touch_timeout_num : 22;
  839. uint32_t touch_timeout_en : 1;
  840. uint32_t reserved23 : 9;
  841. };
  842. uint32_t val;
  843. } touch_timeout_ctrl;
  844. union {
  845. struct {
  846. uint32_t reject_cause : 18; /*sleep reject cause*/
  847. uint32_t reserved18 : 14;
  848. };
  849. uint32_t val;
  850. } slp_reject_cause;
  851. union {
  852. struct {
  853. uint32_t force_download_boot : 1;
  854. uint32_t reserved1 : 31;
  855. };
  856. uint32_t val;
  857. } option1;
  858. union {
  859. struct {
  860. uint32_t wakeup_cause : 17; /*sleep wakeup cause*/
  861. uint32_t reserved17 : 15;
  862. };
  863. uint32_t val;
  864. } slp_wakeup_cause;
  865. union {
  866. struct {
  867. uint32_t reserved0 : 8;
  868. uint32_t ulp_cp_timer_slp_cycle : 24; /*sleep cycles for ULP-coprocessor timer*/
  869. };
  870. uint32_t val;
  871. } ulp_cp_timer_1;
  872. union {
  873. struct {
  874. uint32_t slp_wakeup_w1ts : 1; /*enable sleep wakeup interrupt*/
  875. uint32_t slp_reject_w1ts : 1; /*enable sleep reject interrupt*/
  876. uint32_t sdio_idle_w1ts : 1; /*enable SDIO idle interrupt*/
  877. uint32_t rtc_wdt_w1ts : 1; /*enable RTC WDT interrupt*/
  878. uint32_t rtc_touch_scan_done_w1ts : 1; /*enable touch scan done interrupt*/
  879. uint32_t rtc_ulp_cp_w1ts : 1; /*enable ULP-coprocessor interrupt*/
  880. uint32_t rtc_touch_done_w1ts : 1; /*enable touch done interrupt*/
  881. uint32_t rtc_touch_active_w1ts : 1; /*enable touch active interrupt*/
  882. uint32_t rtc_touch_inactive_w1ts : 1; /*enable touch inactive interrupt*/
  883. uint32_t w1ts : 1; /*enable brown out interrupt*/
  884. uint32_t rtc_main_timer_w1ts : 1; /*enable RTC main timer interrupt*/
  885. uint32_t rtc_saradc1_w1ts : 1; /*enable saradc1 interrupt*/
  886. uint32_t rtc_tsens_w1ts : 1; /*enable tsens interrupt*/
  887. uint32_t rtc_cocpu_w1ts : 1; /*enable riscV cocpu interrupt*/
  888. uint32_t rtc_saradc2_w1ts : 1; /*enable saradc2 interrupt*/
  889. uint32_t rtc_swd_w1ts : 1; /*enable super watch dog interrupt*/
  890. uint32_t rtc_xtal32k_dead_w1ts : 1; /*enable xtal32k_dead interrupt*/
  891. uint32_t rtc_cocpu_trap_w1ts : 1; /*enable cocpu trap interrupt*/
  892. uint32_t rtc_touch_timeout_w1ts : 1; /*enable touch timeout interrupt*/
  893. uint32_t rtc_glitch_det_w1ts : 1; /*enbale gitch det interrupt*/
  894. uint32_t rtc_touch_approach_loop_done_w1ts: 1;
  895. uint32_t reserved21 : 11;
  896. };
  897. uint32_t val;
  898. } int_ena_w1ts;
  899. union {
  900. struct {
  901. uint32_t slp_wakeup_w1tc : 1; /*enable sleep wakeup interrupt*/
  902. uint32_t slp_reject_w1tc : 1; /*enable sleep reject interrupt*/
  903. uint32_t sdio_idle_w1tc : 1; /*enable SDIO idle interrupt*/
  904. uint32_t rtc_wdt_w1tc : 1; /*enable RTC WDT interrupt*/
  905. uint32_t rtc_touch_scan_done_w1tc : 1; /*enable touch scan done interrupt*/
  906. uint32_t rtc_ulp_cp_w1tc : 1; /*enable ULP-coprocessor interrupt*/
  907. uint32_t rtc_touch_done_w1tc : 1; /*enable touch done interrupt*/
  908. uint32_t rtc_touch_active_w1tc : 1; /*enable touch active interrupt*/
  909. uint32_t rtc_touch_inactive_w1tc : 1; /*enable touch inactive interrupt*/
  910. uint32_t w1tc : 1; /*enable brown out interrupt*/
  911. uint32_t rtc_main_timer_w1tc : 1; /*enable RTC main timer interrupt*/
  912. uint32_t rtc_saradc1_w1tc : 1; /*enable saradc1 interrupt*/
  913. uint32_t rtc_tsens_w1tc : 1; /*enable tsens interrupt*/
  914. uint32_t rtc_cocpu_w1tc : 1; /*enable riscV cocpu interrupt*/
  915. uint32_t rtc_saradc2_w1tc : 1; /*enable saradc2 interrupt*/
  916. uint32_t rtc_swd_w1tc : 1; /*enable super watch dog interrupt*/
  917. uint32_t rtc_xtal32k_dead_w1tc : 1; /*enable xtal32k_dead interrupt*/
  918. uint32_t rtc_cocpu_trap_w1tc : 1; /*enable cocpu trap interrupt*/
  919. uint32_t rtc_touch_timeout_w1tc : 1; /*enable touch timeout interrupt*/
  920. uint32_t rtc_glitch_det_w1tc : 1; /*enbale gitch det interrupt*/
  921. uint32_t rtc_touch_approach_loop_done_w1tc: 1;
  922. uint32_t reserved21 : 11;
  923. };
  924. uint32_t val;
  925. } int_ena_w1tc;
  926. union {
  927. struct {
  928. uint32_t reserved0 : 10;
  929. uint32_t retention_tag_mode : 4;
  930. uint32_t retention_target : 2;
  931. uint32_t retention_clk_sel : 1;
  932. uint32_t retention_done_wait : 3;
  933. uint32_t retention_clkoff_wait : 4;
  934. uint32_t retention_en : 1;
  935. uint32_t retention_wait : 7; /*wait cycles for rention operation*/
  936. };
  937. uint32_t val;
  938. } retention_ctrl;
  939. union {
  940. struct {
  941. uint32_t reserved0 : 26;
  942. uint32_t power_glitch_dsense : 2;
  943. uint32_t power_glitch_force_pd : 1;
  944. uint32_t power_glitch_force_pu : 1;
  945. uint32_t power_glitch_efuse_sel : 1; /*select use analog fib signal*/
  946. uint32_t power_glitch_en : 1;
  947. };
  948. uint32_t val;
  949. } pg_ctrl;
  950. union {
  951. struct {
  952. uint32_t rtc_fib_sel : 3;
  953. uint32_t reserved3 : 29;
  954. };
  955. uint32_t val;
  956. } fib_sel;
  957. union {
  958. struct {
  959. uint32_t reserved0 : 2;
  960. uint32_t touch_pad9_dac : 3;
  961. uint32_t touch_pad8_dac : 3;
  962. uint32_t touch_pad7_dac : 3;
  963. uint32_t touch_pad6_dac : 3;
  964. uint32_t touch_pad5_dac : 3;
  965. uint32_t touch_pad4_dac : 3;
  966. uint32_t touch_pad3_dac : 3;
  967. uint32_t touch_pad2_dac : 3;
  968. uint32_t touch_pad1_dac : 3;
  969. uint32_t touch_pad0_dac : 3;
  970. };
  971. uint32_t val;
  972. } touch_dac;
  973. union {
  974. struct {
  975. uint32_t reserved0 : 17;
  976. uint32_t touch_pad14_dac : 3;
  977. uint32_t touch_pad13_dac : 3;
  978. uint32_t touch_pad12_dac : 3;
  979. uint32_t touch_pad11_dac : 3;
  980. uint32_t touch_pad10_dac : 3;
  981. };
  982. uint32_t val;
  983. } touch_dac1;
  984. union {
  985. struct {
  986. uint32_t reserved0 : 31;
  987. uint32_t disable_rtc_cpu : 1;
  988. };
  989. uint32_t val;
  990. } cocpu_disable;
  991. uint32_t reserved_158;
  992. uint32_t reserved_15c;
  993. uint32_t reserved_160;
  994. uint32_t reserved_164;
  995. uint32_t reserved_168;
  996. uint32_t reserved_16c;
  997. uint32_t reserved_170;
  998. uint32_t reserved_174;
  999. uint32_t reserved_178;
  1000. uint32_t reserved_17c;
  1001. uint32_t reserved_180;
  1002. uint32_t reserved_184;
  1003. uint32_t reserved_188;
  1004. uint32_t reserved_18c;
  1005. uint32_t reserved_190;
  1006. uint32_t reserved_194;
  1007. uint32_t reserved_198;
  1008. uint32_t reserved_19c;
  1009. uint32_t reserved_1a0;
  1010. uint32_t reserved_1a4;
  1011. uint32_t reserved_1a8;
  1012. uint32_t reserved_1ac;
  1013. uint32_t reserved_1b0;
  1014. uint32_t reserved_1b4;
  1015. uint32_t reserved_1b8;
  1016. uint32_t reserved_1bc;
  1017. uint32_t reserved_1c0;
  1018. uint32_t reserved_1c4;
  1019. uint32_t reserved_1c8;
  1020. uint32_t reserved_1cc;
  1021. uint32_t reserved_1d0;
  1022. uint32_t reserved_1d4;
  1023. uint32_t reserved_1d8;
  1024. uint32_t reserved_1dc;
  1025. uint32_t reserved_1e0;
  1026. uint32_t reserved_1e4;
  1027. uint32_t reserved_1e8;
  1028. uint32_t reserved_1ec;
  1029. uint32_t reserved_1f0;
  1030. uint32_t reserved_1f4;
  1031. uint32_t reserved_1f8;
  1032. union {
  1033. struct {
  1034. uint32_t date : 28;
  1035. uint32_t reserved28 : 4;
  1036. };
  1037. uint32_t val;
  1038. } date;
  1039. } rtc_cntl_dev_t;
  1040. extern rtc_cntl_dev_t RTCCNTL;
  1041. #ifdef __cplusplus
  1042. }
  1043. #endif
  1044. #endif /*_SOC_RTC_CNTL_STRUCT_H_ */