Skip to content

Class hal::cortex_m::interrupt::exception_number

ClassList > hal > cortex_m > interrupt > exception_number

represents an interrupt request number along with helper functions for setting up the interrupt controller registers.

  • #include <interrupt.hpp>

Public Static Attributes

Type Name
constexpr uint32_t enable_mask_code = = 0x1F
Lower 5 bits indicate which bit within the 32-bit word is the enable bit.
constexpr uint32_t index_position = = 5
Bits 5 and above represent which 32-bit word in the iser and icer arrays IRQs enable bit resides.

Public Functions

Type Name
constexpr bool default_enabled () const
Determines if the irq is within the range of ARM.
constexpr std::uint32_t enable_mask () const
return a mask with a 1 bit in the enable position for this exception_number .
constexpr exception_number (std::uint16_t p_id)
construct an exception_number from an int
constexpr exception_number (exception_number & p_id) = default
constexpr std::uint16_t get_event_number ()
bool is_valid () const
determines if the irq is within bounds of the interrupt vector table.
constexpr exception_number & operator= (exception_number & p_id) = default
constexpr std::uint32_t register_index () const
the enable bit for this interrupt resides within one of the 32-bit registers within the "iser" and "icer" arrays. This function will return the index of which 32-bit register contains the enable bit.
constexpr std::uint32_t to_irq_number () const
constexpr size_t vector_index () const
Provides the index within the IVT.

Public Static Attributes Documentation

variable enable_mask_code

constexpr uint32_t hal::cortex_m::interrupt::exception_number::enable_mask_code;

variable index_position

constexpr uint32_t hal::cortex_m::interrupt::exception_number::index_position;

Public Functions Documentation

function default_enabled

Determines if the irq is within the range of ARM.

inline constexpr bool hal::cortex_m::interrupt::exception_number::default_enabled () const

Returns:

true - irq is enabled by default

Returns:

false - irq must be enabled to work

function enable_mask

return a mask with a 1 bit in the enable position for this exception_number .

inline constexpr std::uint32_t hal::cortex_m::interrupt::exception_number::enable_mask () const

Returns:

constexpr std::uint32_t - enable mask

function exception_number [1/2]

construct an exception_number from an int

inline constexpr hal::cortex_m::interrupt::exception_number::exception_number (
    std::uint16_t p_id
) 

Parameters:

  • p_id - interrupt request number. If this value is beyond the bounds of the interrupt vector table, meaning it is an invalid exception number, then all operations will do nothing.

function exception_number [2/2]

constexpr hal::cortex_m::interrupt::exception_number::exception_number (
    exception_number & p_id
) = default

function get_event_number

inline constexpr std::uint16_t hal::cortex_m::interrupt::exception_number::get_event_number () 

Returns:

constexpr std::uint16_t - the interrupt request number

function is_valid

determines if the irq is within bounds of the interrupt vector table.

inline bool hal::cortex_m::interrupt::exception_number::is_valid () const

Returns:

true - is a valid interrupt for this system

Returns:

false - this interrupt is beyond the range of valid interrupts

function operator=

constexpr exception_number & hal::cortex_m::interrupt::exception_number::operator= (
    exception_number & p_id
) = default

function register_index

the enable bit for this interrupt resides within one of the 32-bit registers within the "iser" and "icer" arrays. This function will return the index of which 32-bit register contains the enable bit.

inline constexpr std::uint32_t hal::cortex_m::interrupt::exception_number::register_index () const

Returns:

constexpr std::uint32_t - array index

function to_irq_number

inline constexpr std::uint32_t hal::cortex_m::interrupt::exception_number::to_irq_number () const

function vector_index

Provides the index within the IVT.

inline constexpr size_t hal::cortex_m::interrupt::exception_number::vector_index () const

Returns:

constexpr size_t - the index position


The documentation for this class was generated from the following file libraries/include/libhal-armcortex/interrupt.hpp