periph_ctrl.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // Copyright 2015-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. // 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 _DRIVER_PERIPH_CTRL_H_
  14. #define _DRIVER_PERIPH_CTRL_H_
  15. #include "soc/periph_defs.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. /**
  20. * @brief enable peripheral module
  21. *
  22. * @param[in] periph : Peripheral module name
  23. *
  24. * Clock for the module will be ungated, and reset de-asserted.
  25. *
  26. * @note If periph_module_enable is called a number of times,
  27. * periph_module_disable has to be called the same number of times
  28. * in order to put the peripheral into disabled state.
  29. *
  30. * @return NULL
  31. *
  32. */
  33. void periph_module_enable(periph_module_t periph);
  34. /**
  35. * @brief disable peripheral module
  36. *
  37. * @param[in] periph : Peripheral module name
  38. *
  39. * Clock for the module will be gated, reset asserted.
  40. *
  41. * @note If periph_module_enable is called a number of times,
  42. * periph_module_disable has to be called the same number of times
  43. * in order to put the peripheral into disabled state.
  44. *
  45. * @return NULL
  46. *
  47. */
  48. void periph_module_disable(periph_module_t periph);
  49. /**
  50. * @brief reset peripheral module
  51. *
  52. * @param[in] periph : Peripheral module name
  53. *
  54. * Reset will asserted then de-assrted for the peripheral.
  55. *
  56. * Calling this function does not enable or disable the clock for the module.
  57. *
  58. * @return NULL
  59. *
  60. */
  61. void periph_module_reset(periph_module_t periph);
  62. /**
  63. * @brief enable wifi bt common module
  64. *
  65. * @note If wifi_bt_common_module_enable is called a number of times,
  66. * wifi_bt_common_module_disable has to be called the same number of times
  67. * in order to put the peripheral into disabled state.
  68. *
  69. * @return NULL
  70. *
  71. */
  72. void wifi_bt_common_module_enable(void);
  73. /**
  74. * @brief disable wifi bt common module
  75. *
  76. * @note If wifi_bt_common_module_enable is called a number of times,
  77. * wifi_bt_common_module_disable has to be called the same number of times
  78. * in order to put the peripheral into disabled state.
  79. *
  80. * @return NULL
  81. *
  82. */
  83. void wifi_bt_common_module_disable(void);
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif /* _DRIVER_PERIPH_CTRL_H_ */