refactor(rng): use adc_ll apis for ESP32-h4 and refactor rng_ll_enable/disable

This commit is contained in:
gaoxu
2026-05-26 19:02:41 +08:00
parent ad310ce681
commit 43317018d1
38 changed files with 533 additions and 418 deletions
@@ -5,6 +5,7 @@
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "hal/rng_ll.h"
#include "soc/rtc_periph.h"
#include "soc/sens_reg.h"
#include "soc/syscon_reg.h"
@@ -74,10 +75,13 @@ void bootloader_random_enable(void)
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE);
SET_PERI_REG_MASK(I2S_CONF2_REG(0), I2S_DATA_ENABLE_TEST_EN);
SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);
rng_ll_enable();
}
void bootloader_random_disable(void)
{
rng_ll_disable();
/* Reset some i2s configuration (possibly redundant as we reset entire
I2S peripheral further down). */
CLEAR_PERI_REG_MASK(I2S_CONF_REG(0), I2S_RX_START);