const DPORT_WIFI_CLK_WIFI_EN_M: u32 = 0x00000406;
const DPORT_WIFI_CLK_BT_EN_M: u32 = 0x00030800;
pub(crate) fn enable_bt(enable: bool) {
regs!(DPORT).wifi_clk_en().modify(|r, w| unsafe {
if enable {
w.bits(r.bits() | DPORT_WIFI_CLK_BT_EN_M)
} else {
w.bits(r.bits() & !DPORT_WIFI_CLK_BT_EN_M)
}
});
}
pub(crate) fn enable_wifi(enable: bool) {
regs!(DPORT).wifi_clk_en().modify(|r, w| unsafe {
if enable {
w.bits(r.bits() | DPORT_WIFI_CLK_WIFI_EN_M)
} else {
w.bits(r.bits() & !DPORT_WIFI_CLK_WIFI_EN_M)
}
});
}
pub(crate) fn reset_wifi_mac() {
regs!(DPORT)
.wifi_rst_en()
.modify(|_, w| w.mac_rst().set_bit());
regs!(DPORT)
.wifi_rst_en()
.modify(|_, w| w.mac_rst().clear_bit());
}
pub(crate) fn init_clocks() {
regs!(DPORT)
.wifi_clk_en()
.write(|w| unsafe { w.bits(u32::MAX) });
}
pub(crate) fn ble_rtc_clk_init() {
}
pub(crate) fn reset_rpa() {
}