timer_group_struct.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. // Copyright 2020 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef _SOC_TIMG_STRUCT_H_
  15. #define _SOC_TIMG_STRUCT_H_
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef volatile struct {
  20. struct {
  21. union {
  22. struct {
  23. uint32_t reserved0: 9;
  24. uint32_t use_xtal: 1;
  25. uint32_t alarm_en: 1;
  26. uint32_t reserved11: 1;
  27. uint32_t divcnt_rst: 1;
  28. uint32_t divider: 16;
  29. uint32_t autoreload: 1;
  30. uint32_t increase: 1;
  31. uint32_t enable: 1;
  32. };
  33. uint32_t val;
  34. } config;
  35. uint32_t cnt_low; /**/
  36. union {
  37. struct {
  38. uint32_t hi: 22;
  39. uint32_t reserved22:10;
  40. };
  41. uint32_t val;
  42. } cnt_high;
  43. union {
  44. struct {
  45. uint32_t reserved0: 31;
  46. uint32_t update: 1;
  47. };
  48. uint32_t val;
  49. } update;
  50. uint32_t alarm_low; /**/
  51. union {
  52. struct {
  53. uint32_t alarm_hi: 22;
  54. uint32_t reserved22: 10;
  55. };
  56. uint32_t val;
  57. } alarm_high;
  58. uint32_t load_low; /**/
  59. union {
  60. struct {
  61. uint32_t load_hi: 22;
  62. uint32_t reserved22:10;
  63. };
  64. uint32_t val;
  65. } load_high;
  66. uint32_t reload; /**/
  67. } hw_timer[1];
  68. uint32_t reserved_24;
  69. uint32_t reserved_28;
  70. uint32_t reserved_2c;
  71. uint32_t reserved_30;
  72. uint32_t reserved_34;
  73. uint32_t reserved_38;
  74. uint32_t reserved_3c;
  75. uint32_t reserved_40;
  76. uint32_t reserved_44;
  77. union {
  78. struct {
  79. uint32_t reserved0: 12;
  80. uint32_t appcpu_reset_en: 1;
  81. uint32_t procpu_reset_en: 1;
  82. uint32_t flashboot_mod_en: 1;
  83. uint32_t sys_reset_length: 3;
  84. uint32_t cpu_reset_length: 3;
  85. uint32_t use_xtal: 1;
  86. uint32_t conf_update_en: 1;
  87. uint32_t stg3: 2;
  88. uint32_t stg2: 2;
  89. uint32_t stg1: 2;
  90. uint32_t stg0: 2;
  91. uint32_t en: 1;
  92. };
  93. uint32_t val;
  94. } wdt_config0;
  95. union {
  96. struct {
  97. uint32_t divcnt_rst: 1;
  98. uint32_t reserved1: 15;
  99. uint32_t clk_prescale: 16;
  100. };
  101. uint32_t val;
  102. } wdt_config1;
  103. uint32_t wdt_config2; /**/
  104. uint32_t wdt_config3; /**/
  105. uint32_t wdt_config4; /**/
  106. uint32_t wdt_config5; /**/
  107. uint32_t wdt_feed; /**/
  108. uint32_t wdt_wprotect; /**/
  109. union {
  110. struct {
  111. uint32_t reserved0: 12;
  112. uint32_t start_cycling: 1;
  113. uint32_t clk_sel: 2;
  114. uint32_t rdy: 1;
  115. uint32_t max: 15;
  116. uint32_t start: 1;
  117. };
  118. uint32_t val;
  119. } rtc_cali_cfg;
  120. union {
  121. struct {
  122. uint32_t cycling_data_vld: 1;
  123. uint32_t reserved1: 6;
  124. uint32_t value: 25;
  125. };
  126. uint32_t val;
  127. } rtc_cali_cfg1;
  128. union {
  129. struct {
  130. uint32_t t0: 1;
  131. uint32_t wdt: 1;
  132. uint32_t reserved2: 30;
  133. };
  134. uint32_t val;
  135. } int_ena;
  136. union {
  137. struct {
  138. uint32_t t0: 1;
  139. uint32_t wdt: 1;
  140. uint32_t reserved2: 30;
  141. };
  142. uint32_t val;
  143. } int_raw;
  144. union {
  145. struct {
  146. uint32_t t0: 1;
  147. uint32_t wdt: 1;
  148. uint32_t reserved2: 30;
  149. };
  150. uint32_t val;
  151. } int_st;
  152. union {
  153. struct {
  154. uint32_t t0: 1;
  155. uint32_t wdt: 1;
  156. uint32_t reserved2: 30;
  157. };
  158. uint32_t val;
  159. } int_clr;
  160. union {
  161. struct {
  162. uint32_t timeout: 1; /*timeout indicator*/
  163. uint32_t reserved1: 2;
  164. uint32_t timeout_rst_cnt: 4; /*Cycles that release calibration timeout reset*/
  165. uint32_t timeout_thres: 25; /*timeout if cali value counts over threshold*/
  166. };
  167. uint32_t val;
  168. } rtc_cali_cfg2;
  169. uint32_t reserved_84;
  170. uint32_t reserved_88;
  171. uint32_t reserved_8c;
  172. uint32_t reserved_90;
  173. uint32_t reserved_94;
  174. uint32_t reserved_98;
  175. uint32_t reserved_9c;
  176. uint32_t reserved_a0;
  177. uint32_t reserved_a4;
  178. uint32_t reserved_a8;
  179. uint32_t reserved_ac;
  180. uint32_t reserved_b0;
  181. uint32_t reserved_b4;
  182. uint32_t reserved_b8;
  183. uint32_t reserved_bc;
  184. uint32_t reserved_c0;
  185. uint32_t reserved_c4;
  186. uint32_t reserved_c8;
  187. uint32_t reserved_cc;
  188. uint32_t reserved_d0;
  189. uint32_t reserved_d4;
  190. uint32_t reserved_d8;
  191. uint32_t reserved_dc;
  192. uint32_t reserved_e0;
  193. uint32_t reserved_e4;
  194. uint32_t reserved_e8;
  195. uint32_t reserved_ec;
  196. uint32_t reserved_f0;
  197. uint32_t reserved_f4;
  198. union {
  199. struct {
  200. uint32_t date: 28;
  201. uint32_t reserved28: 4;
  202. };
  203. uint32_t val;
  204. } timg_date;
  205. union {
  206. struct {
  207. uint32_t reserved0: 29;
  208. uint32_t wdt_clk_is_active: 1;
  209. uint32_t timer_clk_is_active: 1;
  210. uint32_t en: 1;
  211. };
  212. uint32_t val;
  213. } clk;
  214. } timg_dev_t;
  215. extern timg_dev_t TIMERG0;
  216. extern timg_dev_t TIMERG1;
  217. #ifdef __cplusplus
  218. }
  219. #endif
  220. #endif /* _SOC_TIMG_STRUCT_H_ */