syscon_struct.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Copyright 2015-2016 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. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #ifndef _SOC_SYSCON_STRUCT_H_
  14. #define _SOC_SYSCON_STRUCT_H_
  15. typedef struct {
  16. union {
  17. struct {
  18. volatile uint32_t pre_div: 10;
  19. volatile uint32_t clk_320m_en: 1;
  20. volatile uint32_t clk_en: 1;
  21. volatile uint32_t rst_tick: 1;
  22. volatile uint32_t quick_clk_chng: 1;
  23. volatile uint32_t reserved14: 18;
  24. };
  25. volatile uint32_t val;
  26. }clk_conf;
  27. union {
  28. struct {
  29. volatile uint32_t xtal_tick: 8;
  30. volatile uint32_t reserved8: 24;
  31. };
  32. volatile uint32_t val;
  33. }xtal_tick_conf;
  34. union {
  35. struct {
  36. volatile uint32_t pll_tick: 8;
  37. volatile uint32_t reserved8: 24;
  38. };
  39. volatile uint32_t val;
  40. }pll_tick_conf;
  41. union {
  42. struct {
  43. volatile uint32_t ck8m_tick: 8;
  44. volatile uint32_t reserved8: 24;
  45. };
  46. volatile uint32_t val;
  47. }ck8m_tick_conf;
  48. union {
  49. struct {
  50. volatile uint32_t start_force: 1;
  51. volatile uint32_t start: 1;
  52. volatile uint32_t sar2_mux: 1; /*1: SAR ADC2 is controlled by DIG ADC2 CTRL 0: SAR ADC2 is controlled by PWDET CTRL*/
  53. volatile uint32_t work_mode: 2; /*0: single mode 1: double mode 2: alternate mode*/
  54. volatile uint32_t sar_sel: 1; /*0: SAR1 1: SAR2 only work for single SAR mode*/
  55. volatile uint32_t sar_clk_gated: 1;
  56. volatile uint32_t sar_clk_div: 8; /*SAR clock divider*/
  57. volatile uint32_t sar1_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/
  58. volatile uint32_t sar2_patt_len: 4; /*0 ~ 15 means length 1 ~ 16*/
  59. volatile uint32_t sar1_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC1 CTRL*/
  60. volatile uint32_t sar2_patt_p_clear: 1; /*clear the pointer of pattern table for DIG ADC2 CTRL*/
  61. volatile uint32_t data_sar_sel: 1; /*1: sar_sel will be coded by the MSB of the 16-bit output data in this case the resolution should not be larger than 11 bits.*/
  62. volatile uint32_t data_to_i2s: 1; /*1: I2S input data is from SAR ADC (for DMA) 0: I2S input data is from GPIO matrix*/
  63. volatile uint32_t reserved27: 5;
  64. };
  65. volatile uint32_t val;
  66. }saradc_ctrl;
  67. union {
  68. struct {
  69. volatile uint32_t meas_num_limit: 1;
  70. volatile uint32_t max_meas_num: 8; /*max conversion number*/
  71. volatile uint32_t sar1_inv: 1; /*1: data to DIG ADC1 CTRL is inverted otherwise not*/
  72. volatile uint32_t sar2_inv: 1; /*1: data to DIG ADC2 CTRL is inverted otherwise not*/
  73. volatile uint32_t reserved11: 21;
  74. };
  75. volatile uint32_t val;
  76. }saradc_ctrl2;
  77. union {
  78. struct {
  79. volatile uint32_t rstb_wait: 8;
  80. volatile uint32_t standby_wait: 8;
  81. volatile uint32_t start_wait: 8;
  82. volatile uint32_t sample_cycle: 8; /*sample cycles*/
  83. };
  84. volatile uint32_t val;
  85. }saradc_fsm;
  86. volatile uint32_t saradc_sar1_patt_tab1; /*item 0 ~ 3 for pattern table 1 (each item one byte)*/
  87. volatile uint32_t saradc_sar1_patt_tab2; /*Item 4 ~ 7 for pattern table 1 (each item one byte)*/
  88. volatile uint32_t saradc_sar1_patt_tab3; /*Item 8 ~ 11 for pattern table 1 (each item one byte)*/
  89. volatile uint32_t saradc_sar1_patt_tab4; /*Item 12 ~ 15 for pattern table 1 (each item one byte)*/
  90. volatile uint32_t saradc_sar2_patt_tab1; /*item 0 ~ 3 for pattern table 2 (each item one byte)*/
  91. volatile uint32_t saradc_sar2_patt_tab2; /*Item 4 ~ 7 for pattern table 2 (each item one byte)*/
  92. volatile uint32_t saradc_sar2_patt_tab3; /*Item 8 ~ 11 for pattern table 2 (each item one byte)*/
  93. volatile uint32_t saradc_sar2_patt_tab4; /*Item 12 ~ 15 for pattern table 2 (each item one byte)*/
  94. union {
  95. struct {
  96. volatile uint32_t apll_tick: 8;
  97. volatile uint32_t reserved8: 24;
  98. };
  99. volatile uint32_t val;
  100. }apll_tick_conf;
  101. volatile uint32_t reserved_40;
  102. volatile uint32_t reserved_44;
  103. volatile uint32_t reserved_48;
  104. volatile uint32_t reserved_4c;
  105. volatile uint32_t reserved_50;
  106. volatile uint32_t reserved_54;
  107. volatile uint32_t reserved_58;
  108. volatile uint32_t reserved_5c;
  109. volatile uint32_t reserved_60;
  110. volatile uint32_t reserved_64;
  111. volatile uint32_t reserved_68;
  112. volatile uint32_t reserved_6c;
  113. volatile uint32_t reserved_70;
  114. volatile uint32_t reserved_74;
  115. volatile uint32_t reserved_78;
  116. volatile uint32_t date; /**/
  117. } syscon_dev_t;
  118. #endif /* _SOC_SYSCON_STRUCT_H_ */