mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
esp32c3: Adds support BROWNOUT reset
This commit is contained in:
@@ -22,15 +22,24 @@
|
||||
|
||||
void brownout_hal_config(const brownout_hal_config_t *cfg)
|
||||
{
|
||||
// TODO ESP32-C3 IDF-2397
|
||||
REGI2C_WRITE_MASK(I2C_BOD, I2C_BOD_THRESHOLD, cfg->threshold);
|
||||
typeof(RTCCNTL.brown_out) brown_out_reg = {
|
||||
.close_flash_ena = cfg->flash_power_down,
|
||||
.pd_rf_ena = cfg->rf_power_down,
|
||||
.rst_wait = 0x3ff,
|
||||
.rst_ena = cfg->reset_enabled,
|
||||
.ena = cfg->enabled,
|
||||
.rst_sel = 1,
|
||||
};
|
||||
RTCCNTL.brown_out = brown_out_reg;
|
||||
}
|
||||
|
||||
void brownout_hal_intr_enable(bool enable)
|
||||
{
|
||||
// TODO ESP32-C3 IDF-2397
|
||||
RTCCNTL.int_ena.rtc_brown_out = enable;
|
||||
}
|
||||
|
||||
void brownout_hal_intr_clear(void)
|
||||
{
|
||||
// TODO ESP32-C3 IDF-2397
|
||||
RTCCNTL.int_clr.rtc_brown_out = 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user