periph_ctrl.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include "soc/periph_defs.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. /**
  12. * @brief Enable peripheral module by un-gating the clock and de-asserting the reset signal.
  13. *
  14. * @param[in] periph Peripheral module
  15. *
  16. * @note If @c periph_module_enable() is called a number of times,
  17. * @c periph_module_disable() has to be called the same number of times,
  18. * in order to put the peripheral into disabled state.
  19. */
  20. void periph_module_enable(periph_module_t periph);
  21. /**
  22. * @brief Disable peripheral module by gating the clock and asserting the reset signal.
  23. *
  24. * @param[in] periph Peripheral module
  25. *
  26. * @note If @c periph_module_enable() is called a number of times,
  27. * @c periph_module_disable() has to be called the same number of times,
  28. * in order to put the peripheral into disabled state.
  29. */
  30. void periph_module_disable(periph_module_t periph);
  31. /**
  32. * @brief Reset peripheral module by asserting and de-asserting the reset signal.
  33. *
  34. * @param[in] periph Peripheral module
  35. *
  36. * @note Calling this function does not enable or disable the clock for the module.
  37. */
  38. void periph_module_reset(periph_module_t periph);
  39. /**
  40. * @brief Enable Wi-Fi and BT common module
  41. *
  42. * @note If @c wifi_bt_common_module_enable() is called a number of times,
  43. * @c wifi_bt_common_module_disable() has to be called the same number of times,
  44. * in order to put the peripheral into disabled state.
  45. */
  46. void wifi_bt_common_module_enable(void);
  47. /**
  48. * @brief Disable Wi-Fi and BT common module
  49. *
  50. * @note If @c wifi_bt_common_module_enable() is called a number of times,
  51. * @c wifi_bt_common_module_disable() has to be called the same number of times,
  52. * in order to put the peripheral into disabled state.
  53. */
  54. void wifi_bt_common_module_disable(void);
  55. /**
  56. * @brief Enable Wi-Fi module
  57. *
  58. * @note Calling this function will only enable Wi-Fi module.
  59. */
  60. void wifi_module_enable(void);
  61. /**
  62. * @brief Disable Wi-Fi module
  63. *
  64. * @note Calling this function will only disable Wi-Fi module.
  65. */
  66. void wifi_module_disable(void);
  67. #ifdef __cplusplus
  68. }
  69. #endif