system_internal.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #pragma once
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "esp_system.h"
  19. #define MWDT0_TICK_PRESCALER 40000
  20. #define MWDT0_TICKS_PER_US 500
  21. #define MWDT1_TICK_PRESCALER 40000
  22. #define MWDT1_TICKS_PER_US 500
  23. /**
  24. * @brief Internal function to restart PRO and APP CPUs.
  25. *
  26. * @note This function should not be called from FreeRTOS applications.
  27. * Use esp_restart instead.
  28. *
  29. * This is an internal function called by esp_restart. It is called directly
  30. * by the panic handler and brownout detector interrupt.
  31. */
  32. void esp_restart_noos(void) __attribute__ ((noreturn));
  33. /**
  34. * @brief Similar to esp_restart_noos, but resets all the digital peripherals.
  35. */
  36. void esp_restart_noos_dig(void) __attribute__ ((noreturn));
  37. /**
  38. * @brief Internal function to set reset reason hint
  39. *
  40. * The hint is used do distinguish different reset reasons when software reset
  41. * is performed.
  42. *
  43. * The hint is stored in RTC store register, RTC_RESET_CAUSE_REG.
  44. *
  45. * @param hint Desired esp_reset_reason_t value for the real reset reason
  46. */
  47. void esp_reset_reason_set_hint(esp_reset_reason_t hint);
  48. /**
  49. * @brief Internal function to get the reset hint value
  50. * @return - Reset hint value previously stored into RTC_RESET_CAUSE_REG using
  51. * esp_reset_reason_set_hint function
  52. * - ESP_RST_UNKNOWN if the value in RTC_RESET_CAUSE_REG is invalid
  53. */
  54. esp_reset_reason_t esp_reset_reason_get_hint(void);
  55. #ifdef __cplusplus
  56. }
  57. #endif