MSP432E4 DriverLib API Guide  1.11.00.03
Functions
Sysexc_api

Functions

void SysExcIntRegister (void(*pfnHandler)(void))
 
void SysExcIntUnregister (void)
 
void SysExcIntEnable (uint32_t ui32IntFlags)
 
void SysExcIntDisable (uint32_t ui32IntFlags)
 
uint32_t SysExcIntStatus (bool bMasked)
 
void SysExcIntClear (uint32_t ui32IntFlags)
 

Detailed Description

Introduction

The system exception module driver provides methods for manipulating the behavior of the system exception module that handles system-level Cortex-M4 FPU exceptions. The exceptions are underflow, overflow, divide by zero, invalid operation, input denormal, and inexact exception. The application can optionally choose to enable one or more of these interrupts and use the interrupt handler to decide upon a course of action to be taken in each case. All the interrupt events are ORed together before being sent to the interrupt controller, so the System Exception module can only generate a single interrupt request to the controller at any given time.

API Functions

The system exception module interrupts are managed with SysExcIntRegister(), SysExcIntUnregister(), SysExcIntEnable(), SysExcIntDisable(), SysExcIntStatus(), and SysExcIntClear().

Programming Example

The following example shows how to use the system exception module API to register an interrupt handler and enable an interrupt.

//
// The interrupt handler function.
//
extern void SysExcIntHandler(void);
//
// Register the interrupt handler function for the system exception
// interrupt.
//
SysExcIntRegister(SysExcIntHandler);
//
// Enable the Floating-point overflow exception.
//

Function Documentation

§ SysExcIntRegister()

void SysExcIntRegister ( void(*)(void)  pfnHandler)

Registers an interrupt handler for the system exception interrupt.

Parameters
pfnHandleris a pointer to the function to be called when the system exception interrupt occurs.

This function places the address of the system exception interrupt handler into the interrupt vector table in SRAM. This function also enables the global interrupt in the interrupt controller; specific system exception interrupts must be enabled via SysExcIntEnable(). It is the interrupt handler's responsibility to clear the interrupt source.

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

§ SysExcIntUnregister()

void SysExcIntUnregister ( void  )

Unregisters the system exception interrupt handler.

This function removes the system exception interrupt handler from the vector table in SRAM. This function also masks off the system exception interrupt in the interrupt controller so that the interrupt handler is no longer called.

See also
IntRegister() for important information about registering interrupt handlers.
Returns
None.

§ SysExcIntEnable()

void SysExcIntEnable ( uint32_t  ui32IntFlags)

Enables individual system exception interrupt sources.

Parameters
ui32IntFlagsis the bit mask of the interrupt sources to be enabled.

This function enables the indicated system exception interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ui32IntFlags parameter is the logical OR of any of the following:

  • SYSEXC_INT_FP_IXC - Floating-point inexact exception interrupt
  • SYSEXC_INT_FP_OFC - Floating-point overflow exception interrupt
  • SYSEXC_INT_FP_UFC - Floating-point underflow exception interrupt
  • SYSEXC_INT_FP_IOC - Floating-point invalid operation interrupt
  • SYSEXC_INT_FP_DZC - Floating-point divide by zero exception interrupt
  • SYSEXC_INT_FP_IDC - Floating-point input denormal exception interrupt
Returns
None.

References HWREG, and SYSEXC_IM.

§ SysExcIntDisable()

void SysExcIntDisable ( uint32_t  ui32IntFlags)

Disables individual system exception interrupt sources.

Parameters
ui32IntFlagsis the bit mask of the interrupt sources to be disabled.

This function disables the indicated system exception interrupt sources. Only sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.

The ui32IntFlags parameter is the logical OR of any of the following:

  • SYSEXC_INT_FP_IXC - Floating-point inexact exception interrupt
  • SYSEXC_INT_FP_OFC - Floating-point overflow exception interrupt
  • SYSEXC_INT_FP_UFC - Floating-point underflow exception interrupt
  • SYSEXC_INT_FP_IOC - Floating-point invalid operation interrupt
  • SYSEXC_INT_FP_DZC - Floating-point divide by zero exception interrupt
  • SYSEXC_INT_FP_IDC - Floating-point input denormal exception interrupt
Returns
None.

References HWREG, and SYSEXC_IM.

§ SysExcIntStatus()

uint32_t SysExcIntStatus ( bool  bMasked)

Gets the current system exception interrupt status.

Parameters
bMaskedis false if the raw interrupt status is required and true if the masked interrupt status is required.

This function returns the system exception interrupt status. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.

Returns
Returns the current system exception interrupt status, enumerated as the logical OR of SYSEXC_INT_FP_IXC, SYSEXC_INT_FP_OFC, SYSEXC_INT_FP_UFC, SYSEXC_INT_FP_IOC, SYSEXC_INT_FP_DZC, and SYSEXC_INT_FP_IDC.

References HWREG, SYSEXC_MIS, and SYSEXC_RIS.

§ SysExcIntClear()

void SysExcIntClear ( uint32_t  ui32IntFlags)

Clears system exception interrupt sources.

Parameters
ui32IntFlagsis a bit mask of the interrupt sources to be cleared.

This function clears the specified system exception interrupt sources, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.

The ui32IntFlags parameter is the logical OR of any of the following:

  • SYSEXC_INT_FP_IXC - Floating-point inexact exception interrupt
  • SYSEXC_INT_FP_OFC - Floating-point overflow exception interrupt
  • SYSEXC_INT_FP_UFC - Floating-point underflow exception interrupt
  • SYSEXC_INT_FP_IOC - Floating-point invalid operation interrupt
  • SYSEXC_INT_FP_DZC - Floating-point divide by zero exception interrupt
  • SYSEXC_INT_FP_IDC - Floating-point input denormal exception interrupt
Note
Because there is a write buffer in the Cortex-M processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (because the interrupt controller still sees the interrupt source asserted).
Returns
None.

References HWREG, and SYSEXC_IC.

© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale