Struct WIFI
#[non_exhaustive]pub struct WIFI<'a> { /* private fields */ }Expand description
WIFI peripheral singleton
Implementations§
§impl WIFI<'_>
impl WIFI<'_>
pub unsafe fn steal() -> WIFI<'_>
pub unsafe fn steal() -> WIFI<'_>
Unsafely create an instance of this peripheral out of thin air.
§Safety
You must ensure that you’re only using one instance of this type at a time.
pub unsafe fn clone_unchecked(&self) -> WIFI<'_>
pub unsafe fn clone_unchecked(&self) -> WIFI<'_>
Unsafely clone this peripheral reference.
§Safety
You must ensure that you’re only using one instance of this type at a time.
pub fn reborrow(&mut self) -> WIFI<'_>
pub fn reborrow(&mut self) -> WIFI<'_>
Creates a new peripheral reference with a shorter lifetime.
Use this method if you would like to keep working with the peripheral after you dropped the driver that consumes this.
pub fn bind_bb_interrupt(&self, handler: InterruptHandler)
Available on crate features unstable only.
pub fn bind_bb_interrupt(&self, handler: InterruptHandler)
unstable only.Binds an interrupt handler to the corresponding interrupt for this peripheral, and enables the interrupt.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn enable_bb_interrupt(&self, priority: Priority)
pub fn enable_bb_interrupt(&self, priority: Priority)
Enables the WIFI_BB peripheral interrupt on the given priority level.
Note that a suitable interrupt handler needs to be set up before the first interrupt
is triggered, otherwise the default handler will panic.
To set up an interrupt handler, use Self::bind_bb_interrupt or create a function that has the same (non-mangled) name as the interrupt you want to handle.
§Examples
use esp_hal::interrupt::Priority;
#[unsafe(no_mangle)]
unsafe extern "C" fn WIFI_BB() {
// do something
}
peripherals.WIFI.enable_bb_interrupt(Priority::Priority1);
peripherals.WIFI.disable_bb_interrupt_on_all_cores();pub fn disable_bb_interrupt(&self)
Available on crate features unstable only.
pub fn disable_bb_interrupt(&self)
unstable only.Disables the WIFI_BB peripheral interrupt handler on the current CPU core.
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn disable_bb_interrupt_on_all_cores(&self)
pub fn disable_bb_interrupt_on_all_cores(&self)
Disables the WIFI_BB peripheral interrupt handler on all cores.
pub fn bind_mac_interrupt(&self, handler: InterruptHandler)
Available on crate features unstable only.
pub fn bind_mac_interrupt(&self, handler: InterruptHandler)
unstable only.Binds an interrupt handler to the corresponding interrupt for this peripheral, and enables the interrupt.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn enable_mac_interrupt(&self, priority: Priority)
pub fn enable_mac_interrupt(&self, priority: Priority)
Enables the WIFI_MAC peripheral interrupt on the given priority level.
Note that a suitable interrupt handler needs to be set up before the first interrupt
is triggered, otherwise the default handler will panic.
To set up an interrupt handler, use Self::bind_mac_interrupt or create a function that has the same (non-mangled) name as the interrupt you want to handle.
§Examples
use esp_hal::interrupt::Priority;
#[unsafe(no_mangle)]
unsafe extern "C" fn WIFI_MAC() {
// do something
}
peripherals.WIFI.enable_mac_interrupt(Priority::Priority1);
peripherals.WIFI.disable_mac_interrupt_on_all_cores();pub fn disable_mac_interrupt(&self)
Available on crate features unstable only.
pub fn disable_mac_interrupt(&self)
unstable only.Disables the WIFI_MAC peripheral interrupt handler on the current CPU core.
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn disable_mac_interrupt_on_all_cores(&self)
pub fn disable_mac_interrupt_on_all_cores(&self)
Disables the WIFI_MAC peripheral interrupt handler on all cores.
pub fn bind_modem_peri_timeout_interrupt(&self, handler: InterruptHandler)
Available on crate features unstable only.
pub fn bind_modem_peri_timeout_interrupt(&self, handler: InterruptHandler)
unstable only.Binds an interrupt handler to the corresponding interrupt for this peripheral, and enables the interrupt.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn enable_modem_peri_timeout_interrupt(&self, priority: Priority)
pub fn enable_modem_peri_timeout_interrupt(&self, priority: Priority)
Enables the MODEM_PERI_TIMEOUT peripheral interrupt on the given priority level.
Note that a suitable interrupt handler needs to be set up before the first interrupt
is triggered, otherwise the default handler will panic.
To set up an interrupt handler, use Self::bind_modem_peri_timeout_interrupt or create a function that has the same (non-mangled) name as the interrupt you want to handle.
§Examples
use esp_hal::interrupt::Priority;
#[unsafe(no_mangle)]
unsafe extern "C" fn MODEM_PERI_TIMEOUT() {
// do something
}
peripherals.WIFI.enable_modem_peri_timeout_interrupt(Priority::Priority1);
peripherals.WIFI.disable_modem_peri_timeout_interrupt_on_all_cores();pub fn disable_modem_peri_timeout_interrupt(&self)
Available on crate features unstable only.
pub fn disable_modem_peri_timeout_interrupt(&self)
unstable only.Disables the MODEM_PERI_TIMEOUT peripheral interrupt handler on the current CPU core.
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn disable_modem_peri_timeout_interrupt_on_all_cores(&self)
pub fn disable_modem_peri_timeout_interrupt_on_all_cores(&self)
Disables the MODEM_PERI_TIMEOUT peripheral interrupt handler on all cores.
pub fn bind_pwr_interrupt(&self, handler: InterruptHandler)
Available on crate features unstable only.
pub fn bind_pwr_interrupt(&self, handler: InterruptHandler)
unstable only.Binds an interrupt handler to the corresponding interrupt for this peripheral, and enables the interrupt.
§Stability
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn enable_pwr_interrupt(&self, priority: Priority)
pub fn enable_pwr_interrupt(&self, priority: Priority)
Enables the WIFI_PWR peripheral interrupt on the given priority level.
Note that a suitable interrupt handler needs to be set up before the first interrupt
is triggered, otherwise the default handler will panic.
To set up an interrupt handler, use Self::bind_pwr_interrupt or create a function that has the same (non-mangled) name as the interrupt you want to handle.
§Examples
use esp_hal::interrupt::Priority;
#[unsafe(no_mangle)]
unsafe extern "C" fn WIFI_PWR() {
// do something
}
peripherals.WIFI.enable_pwr_interrupt(Priority::Priority1);
peripherals.WIFI.disable_pwr_interrupt_on_all_cores();pub fn disable_pwr_interrupt(&self)
Available on crate features unstable only.
pub fn disable_pwr_interrupt(&self)
unstable only.Disables the WIFI_PWR peripheral interrupt handler on the current CPU core.
This API is marked as unstable and is only available when the unstable
crate feature is enabled. This comes with no stability guarantees, and could be changed
or removed at any time.
pub fn disable_pwr_interrupt_on_all_cores(&self)
pub fn disable_pwr_interrupt_on_all_cores(&self)
Disables the WIFI_PWR peripheral interrupt handler on all cores.