clk_ctrl_os.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #include "soc/rtc.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /**
  19. * @brief This function is used to enable the digital 8m rtc clock,
  20. * to support the peripherals.
  21. *
  22. * @note If this function is called a number of times, the `periph_rtc_dig_clk8m_disable`
  23. * function needs to be called same times to disable.
  24. *
  25. * @return true: success for enable the rtc 8M clock, false: rtc 8M clock enable failed
  26. */
  27. bool periph_rtc_dig_clk8m_enable(void);
  28. /**
  29. * @brief This function is used to disable the rtc digital clock, which should be called
  30. * with the `periph_rtc_dig_clk8m_enable` pairedly
  31. *
  32. * @note If this function is called a number of times, the `periph_rtc_dig_clk8m_disable`
  33. * function needs to be called same times to disable.
  34. */
  35. void periph_rtc_dig_clk8m_disable(void);
  36. /**
  37. * @brief This function is used to get the real clock frequency value of the rtc clock
  38. *
  39. * @return The real clock value
  40. */
  41. uint32_t periph_rtc_dig_clk8m_get_freq(void);
  42. #ifdef __cplusplus
  43. }
  44. #endif