gpio_periph.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Copyright 2018 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. #include "soc/gpio_periph.h"
  15. const uint32_t GPIO_PIN_MUX_REG[SOC_GPIO_PIN_COUNT] = {
  16. IO_MUX_GPIO0_REG,
  17. IO_MUX_GPIO1_REG,
  18. IO_MUX_GPIO2_REG,
  19. IO_MUX_GPIO3_REG,
  20. IO_MUX_GPIO4_REG,
  21. IO_MUX_GPIO5_REG,
  22. IO_MUX_GPIO6_REG,
  23. IO_MUX_GPIO7_REG,
  24. IO_MUX_GPIO8_REG,
  25. IO_MUX_GPIO9_REG,
  26. IO_MUX_GPIO10_REG,
  27. IO_MUX_GPIO11_REG,
  28. IO_MUX_GPIO12_REG,
  29. IO_MUX_GPIO13_REG,
  30. IO_MUX_GPIO14_REG,
  31. IO_MUX_GPIO15_REG,
  32. IO_MUX_GPIO16_REG,
  33. IO_MUX_GPIO17_REG,
  34. IO_MUX_GPIO18_REG,
  35. IO_MUX_GPIO19_REG,
  36. IO_MUX_GPIO20_REG, // This corresponding pin is only available on ESP32-PICO-V3 chip package
  37. IO_MUX_GPIO21_REG,
  38. IO_MUX_GPIO22_REG,
  39. IO_MUX_GPIO23_REG,
  40. 0,
  41. IO_MUX_GPIO25_REG,
  42. IO_MUX_GPIO26_REG,
  43. IO_MUX_GPIO27_REG,
  44. 0,
  45. 0,
  46. 0,
  47. 0,
  48. IO_MUX_GPIO32_REG,
  49. IO_MUX_GPIO33_REG,
  50. IO_MUX_GPIO34_REG,
  51. IO_MUX_GPIO35_REG,
  52. IO_MUX_GPIO36_REG,
  53. IO_MUX_GPIO37_REG,
  54. IO_MUX_GPIO38_REG,
  55. IO_MUX_GPIO39_REG,
  56. };
  57. const uint32_t GPIO_HOLD_MASK[SOC_GPIO_PIN_COUNT] = {
  58. 0,
  59. BIT(1),
  60. 0,
  61. BIT(0),
  62. 0,
  63. BIT(8),
  64. BIT(2),
  65. BIT(3),
  66. BIT(4),
  67. BIT(5),
  68. BIT(6),
  69. BIT(7),
  70. 0,
  71. 0,
  72. 0,
  73. 0,
  74. BIT(9),
  75. BIT(10),
  76. BIT(11),
  77. BIT(12),
  78. 0,
  79. BIT(14),
  80. BIT(15),
  81. BIT(16),
  82. 0,
  83. 0,
  84. 0,
  85. 0,
  86. 0,
  87. 0,
  88. 0,
  89. 0,
  90. 0,
  91. 0,
  92. 0,
  93. 0,
  94. 0,
  95. 0,
  96. 0,
  97. 0,
  98. };