brownout_hal.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. /*******************************************************************************
  15. * NOTICE
  16. * The hal is not public api, don't use in application code.
  17. * See readme.md in soc/include/hal/readme.md
  18. ******************************************************************************/
  19. #pragma once
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #include <stddef.h>
  24. #include <stdbool.h>
  25. #include <stdint.h>
  26. #include "soc/brownout_caps.h"
  27. typedef struct {
  28. uint8_t threshold;
  29. bool enabled;
  30. bool reset_enabled;
  31. bool flash_power_down;
  32. bool rf_power_down;
  33. } brownout_hal_config_t;
  34. void brownout_hal_config(const brownout_hal_config_t *cfg);
  35. void brownout_hal_intr_enable(bool enable);
  36. void brownout_hal_intr_clear(void);
  37. #ifdef __cplusplus
  38. }
  39. #endif