fn set_write_protection(&mut self, enable: bool) {
        let rtc_cntl = LP_WDT::regs();

        #[cfg(not(any(esp32c6, esp32h2)))]
        let wkey = if enable { 0u32 } else { 0x8F1D_312A };
        #[cfg(any(esp32c6, esp32h2))]
        let wkey = if enable { 0u32 } else { 0x50D8_3AA1 };

        rtc_cntl
            .swd_wprotect()
            .write(|w| unsafe { w.swd_wkey().bits(wkey) });
    }
Enable/disable write protection for WDT registers
esp-hal/src/rtc_cntl/mod.rs