nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
Public Member Functions
nrfcxx::nvic_BlockIRQ Class Reference

RAII class to block a peripheral interrupt. More...

#include <nrfcxx/core.hpp>

Inheritance diagram for nrfcxx::nvic_BlockIRQ:
nrfcxx::mutex_irq< IRQn >

Public Member Functions

 nvic_BlockIRQ (IRQn_Type irqn)
 
 nvic_BlockIRQ (int irqn)
 Variant required to work around lack of IRQn_Type when declaring nrfcxx::peripheral.
 
 nvic_BlockIRQ (const nvic_BlockIRQ &)=delete
 
nvic_BlockIRQoperator= (const nvic_BlockIRQ &)=delete
 
 nvic_BlockIRQ (nvic_BlockIRQ &&)=delete
 
nvic_BlockIRQoperator= (nvic_BlockIRQ &)=delete
 

Detailed Description

RAII class to block a peripheral interrupt.

The NVIC configuration for the specified IRQ is recorded and the interrupt disabled when the instance is constructed. When the instance is destructed the interrupt is enabled if it was enabled when constructed.

This allows safe manipulation of state that is shared between the application and the interrupt handler, assuming that instances of this class are created (for a specific IRQ) only when not invoked from within (recursively) the corresponding handler.

Note that if the code invoked from within the blocked region calls functions that independently block the same interrupt, the interrupt will not be prematurely re-enabled.


The documentation for this class was generated from the following file: