feat(brownout): Add brownout detector support on esp32p4

This commit is contained in:
C.S.M
2024-05-16 18:29:39 +08:00
parent 4db2236626
commit 9b3bd13a13
8 changed files with 214 additions and 4 deletions

View File

@@ -20,6 +20,8 @@
extern "C" {
#endif
#define BROWNOUT_DETECTOR_LL_INTERRUPT_MASK (BIT(31))
/**
* @brief power down the flash when a brown out happens.
*
@@ -123,6 +125,16 @@ static inline void brownout_ll_clear_count(void)
LP_ANA_PERI.bod_mode0_cntl.bod_mode0_cnt_clr = 0;
}
/**
* @brief Get interrupt status register address
*
* @return Register address
*/
static inline volatile void *brownout_ll_intr_get_status_reg(void)
{
return &LP_ANA_PERI.int_st;
}
#ifdef __cplusplus
}
#endif