Struct stm32wlxx_hal::subghz::CfgIrq
source · pub struct CfgIrq { /* private fields */ }
Expand description
Argument for set_irq_cfg
.
Implementations§
source§impl CfgIrq
impl CfgIrq
sourcepub const fn new() -> CfgIrq
pub const fn new() -> CfgIrq
Create a new CfgIrq
.
This is the same as default
, but in a const
function.
The default value has all interrupts disabled on all lines.
Example
use stm32wlxx_hal::subghz::CfgIrq;
const IRQ_CFG: CfgIrq = CfgIrq::new();
sourcepub const fn irq_enable(self, line: IrqLine, irq: Irq) -> CfgIrq
pub const fn irq_enable(self, line: IrqLine, irq: Irq) -> CfgIrq
Enable an interrupt.
Example
use stm32wlxx_hal::subghz::{CfgIrq, Irq, IrqLine};
const IRQ_CFG: CfgIrq = CfgIrq::new()
.irq_enable(IrqLine::Global, Irq::TxDone)
.irq_enable(IrqLine::Global, Irq::Timeout);
sourcepub const fn irq_enable_all(self, irq: Irq) -> CfgIrq
pub const fn irq_enable_all(self, irq: Irq) -> CfgIrq
Enable an interrupt on all lines.
As far as I can tell with empirical testing all IRQ lines need to be enabled for the internal interrupt to be pending in the NVIC.
Example
use stm32wlxx_hal::subghz::{CfgIrq, Irq};
const IRQ_CFG: CfgIrq = CfgIrq::new()
.irq_enable_all(Irq::TxDone)
.irq_enable_all(Irq::Timeout);
sourcepub const fn irq_disable(self, line: IrqLine, irq: Irq) -> CfgIrq
pub const fn irq_disable(self, line: IrqLine, irq: Irq) -> CfgIrq
Disable an interrupt.
Example
use stm32wlxx_hal::subghz::{CfgIrq, Irq, IrqLine};
const IRQ_CFG: CfgIrq = CfgIrq::new()
.irq_enable(IrqLine::Global, Irq::TxDone)
.irq_enable(IrqLine::Global, Irq::Timeout)
.irq_disable(IrqLine::Global, Irq::TxDone)
.irq_disable(IrqLine::Global, Irq::Timeout);
sourcepub const fn irq_disable_all(self, irq: Irq) -> CfgIrq
pub const fn irq_disable_all(self, irq: Irq) -> CfgIrq
Disable an interrupt on all lines.
Example
use stm32wlxx_hal::subghz::{CfgIrq, Irq};
const IRQ_CFG: CfgIrq = CfgIrq::new()
.irq_enable_all(Irq::TxDone)
.irq_enable_all(Irq::Timeout)
.irq_disable_all(Irq::TxDone)
.irq_disable_all(Irq::Timeout);
sourcepub const fn as_slice(&self) -> &[u8]
pub const fn as_slice(&self) -> &[u8]
Extracts a slice containing the packet.
Example
use stm32wlxx_hal::subghz::{CfgIrq, Irq};
const IRQ_CFG: CfgIrq = CfgIrq::new()
.irq_enable_all(Irq::TxDone)
.irq_enable_all(Irq::Timeout);
assert_eq!(
IRQ_CFG.as_slice(),
&[0x08, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01]
);
Trait Implementations§
source§impl PartialEq for CfgIrq
impl PartialEq for CfgIrq
impl Copy for CfgIrq
impl Eq for CfgIrq
impl StructuralEq for CfgIrq
impl StructuralPartialEq for CfgIrq
Auto Trait Implementations§
impl RefUnwindSafe for CfgIrq
impl Send for CfgIrq
impl Sync for CfgIrq
impl Unpin for CfgIrq
impl UnwindSafe for CfgIrq
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more