FuSa 8-Bit Libraries Safety Framework
Loading...
Searching...
No Matches
Interrupt Manager

Contains API prototypes for the Interrupt Manager. More...

Files

file  midware_interrupt_manager.c
 Implements APIs for the Interrupt Manager.

Functions

void MW_SetIntVectorLocation (bool expectAltLoc)
 Configures whether the device should expect an alternative interrupt vector table location (see IVSEL bit in CPUINT.CTRLA).
errFlag_t MW_SetIntPriority (bool useRoundRobin, uint8_t altStartVect, uint8_t highPriorityVect)
 Configures interrupt scheduling and priority scheme.
errFlag_t MW_EnableGlobalInterrupts (void)
 Enables global interrupts on the device.
void MW_DisableGlobalInterrupts (void)
 Disables global interrupts on the device.

Detailed Description

Contains API prototypes for the Interrupt Manager.

Version
1.0.0-alpha.1

The Interrupt Manager provides services to Tasks to ensure correct interaction with features of the CPUCTRL and CPUINT modules.

UML Class Diagrams

UML Activity Diagrams

Function Documentation

◆ MW_EnableGlobalInterrupts()

errFlag_t MW_EnableGlobalInterrupts ( void )

Enables global interrupts on the device.

This function sets the global interrupts enable bit in the CPU status register, and verifies the status by reading back the bit.

Return values
ERRORFailed to enable global interrupts.
NO_ERRORGlobal interrupts enabled successfully.

Definition at line 79 of file midware_interrupt_manager.c.

◆ MW_SetIntPriority()

errFlag_t MW_SetIntPriority ( bool useRoundRobin,
uint8_t altStartVect,
uint8_t highPriorityVect )

Configures interrupt scheduling and priority scheme.

This function enables or disables round robin interrupt scheduling for normal (level 0) interrupts and selects a starting vector priority order for both static and round robin scheduling. It also optionally sets which interrupt vector has high priority (level 1) which can interrupt other normal interrupts.

Parameters
useRoundRobinEnables or disables round robin scheduling.
altStartVectSets the lowest priority vector number for static scheduling and the initial round robin schedule. Set to 0 to use default priority based on vector number.
highPriorityVectSets the high priority interrupt vector number. Set to 0 to disable this feature.
Return values
ERRORProvided interrupt vector numbers are invalid, function aborted.
NO_ERRORInterrupt priority and scheduling successfully configured.
MISRA C:2012 Deviation
Required: misra-c2012- 10.8
Justification: This deviation concerns the determination of the maximum interrupt vector number for the device. The _VECTORS_SIZE macro, defined in the device-specific header file, lacks an unsigned literal suffix, requiring an explicit cast to uint8_t to avoid implicit integer conversions that could lead to other MISRA violations. The fundamental issue is that the macro itself is not inherently MISRA-compliant. However, since package variants within the same device family can have different vector counts, hardcoding values for each supported device is not scalable and reduces software portability. The cast does not introduce unintended behavior, as the value is known to be positive and within the range of uint8_t. This deviation is limited in scope, reviewed, and tested to ensure correctness.

Definition at line 44 of file midware_interrupt_manager.c.

◆ MW_SetIntVectorLocation()

void MW_SetIntVectorLocation ( bool expectAltLoc)

Configures whether the device should expect an alternative interrupt vector table location (see IVSEL bit in CPUINT.CTRLA).

Note
When the entire Flash is configured as a BOOT section (which is the default configuration), this setting has no effect.
Parameters
expectAltLocSelects whether the expected location of the interrupt vectors is at the alternative location.

Definition at line 31 of file midware_interrupt_manager.c.