CPINTC Functions
[CPINTC]

Functions

CSL_IDEF_INLINE void CSL_CPINTC_setNestingMode (CSL_CPINTC_Handle hnd, CSL_CPINTCNestingMode nestMode)
CSL_IDEF_INLINE
CSL_CPINTCNestingMode 
CSL_CPINTC_getNestingMode (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE void CSL_CPINTC_setNestingLevel (CSL_CPINTC_Handle hnd, CSL_CPINTCNestingLevel nestLevel)
CSL_IDEF_INLINE
CSL_CPINTCNestingLevel 
CSL_CPINTC_getNestingLevel (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE void CSL_CPINTC_enableAllHostInterrupt (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE void CSL_CPINTC_disableAllHostInterrupt (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE void CSL_CPINTC_enableSysInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCSystemInterrupt sysIntr)
CSL_IDEF_INLINE void CSL_CPINTC_disableSysInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCSystemInterrupt sysIntr)
CSL_IDEF_INLINE void CSL_CPINTC_clearSysInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCSystemInterrupt sysIntr)
CSL_IDEF_INLINE void CSL_CPINTC_enableHostInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCHostInterrupt hostIntr)
CSL_IDEF_INLINE void CSL_CPINTC_disableHostInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCHostInterrupt hostIntr)
CSL_IDEF_INLINE Bool CSL_CPINTC_isInterruptPending (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE
CSL_CPINTCSystemInterrupt 
CSL_CPINTC_getPendingInterrupt (CSL_CPINTC_Handle hnd)
CSL_IDEF_INLINE Bool CSL_CPINTC_isHostInterruptPending (CSL_CPINTC_Handle hnd, CSL_CPINTCHostInterrupt hostIntr)
CSL_IDEF_INLINE
CSL_CPINTCSystemInterrupt 
CSL_CPINTC_getPendingHostInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCHostInterrupt hostIntr)
CSL_IDEF_INLINE void CSL_CPINTC_getRawInterruptStatus (CSL_CPINTC_Handle hnd, Uint8 index, Uint32 *rawStatus)
CSL_IDEF_INLINE void CSL_CPINTC_mapSystemIntrToChannel (CSL_CPINTC_Handle hnd, CSL_CPINTCSystemInterrupt sysIntr, CSL_CPINTCChannel channel)
CSL_IDEF_INLINE void CSL_CPINTC_mapChannelToHostInterrupt (CSL_CPINTC_Handle hnd, CSL_CPINTCChannel channel, CSL_CPINTCHostInterrupt hostIntr)

Function Documentation

CSL_IDEF_INLINE void CSL_CPINTC_clearSysInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCSystemInterrupt  sysIntr 
)

============================================================================
CSL_CPINTC_clearSysInterrupt

Description
This API clear the system interrupt in the interrupt controller.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    System Interrupt which is to be cleared.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The specific system interrupt has been serviced and is cleared.

Writes
CPINTC_STATUS_CLR_INDEX_REG_STATUS_CLR_INDEX

Example

        CSL_CPINTCSystemInterrupt     sysIntr;
        CSL_CPINTC_HANDLE             hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0       
        ...
        CSL_CPINTC_clearSysInterrupt (hnd, sysIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_disableAllHostInterrupt ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_disableAllHostInterrupt

Description
This API disables all the Host Interrupts in the system.

Arguments

        hnd         This is the handle to the CPINTC instance.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
All host interrupts are disabled in the system.

Writes
CPINTC_GLOBAL_ENABLE_HINT_REG_ENABLE_HINT_ANY=0

Example

        CSL_CPINTC_HANDLE     hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_disableAllHostInterrupt (hnd);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_disableHostInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCHostInterrupt  hostIntr 
)

============================================================================
CSL_CPINTCdisableHostInterrupt

Description
This API disables the host interrupt in the interrupt controller.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    Host Interrupt which is to be disabled.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The specific Host Interrupt is enabled in the controller and can now generate host interrupts.

Writes
CPINTC_HINT_ENABLE_CLR_INDEX_REG_HINT_ENABLE_CLR_INDEX

Example

        CSL_CPINTCHostInterrupt     hostIntr;
        CSL_CPINTC_HANDLE           hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTCdisableHostInterrupt (hnd, hostIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_disableSysInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCSystemInterrupt  sysIntr 
)

============================================================================
CSL_CPINTC_disableSysInterrupt

Description
This API disables the system interrupt in the interrupt controller.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    System Interrupt which is to be disabled.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The specific System Interrupt is disabled in the controller and cannot generate host interrupts.

Writes
CPINTC_ENABLE_CLR_INDEX_REG_ENABLE_CLR_INDEX

Example

        CSL_CPINTCSystemInterrupt     sysIntr;
        CSL_CPINTC_HANDLE             hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_disableSysInterrupt (hnd, sysIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_enableAllHostInterrupt ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_enableAllHostInterrupt

Description
This API enables all the Host Interrupts in the system.

Arguments

        hnd         This is the handle to the CPINTC instance.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
All host interrupts are enabled in the system. Individual Host interrupts are still enabled/disabled from their individual registers

Writes
CPINTC_GLOBAL_ENABLE_HINT_REG_ENABLE_HINT_ANY=1

Example

        CSL_CPINTC_HANDLE     hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_enableAllHostInterrupt (hnd);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_enableHostInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCHostInterrupt  hostIntr 
)

============================================================================
CSL_CPINTC_enableHostInterrupt

Description
This API enables the host interrupt in the interrupt controller.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    Host Interrupt which is to be enabled.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The specific Host Interrupt is enabled in the controller and can now generate host interrupts.

Writes
CPINTC_HINT_ENABLE_SET_INDEX_REG_HINT_ENABLE_SET_INDEX

Example

        CSL_CPINTCHostInterrupt     hostIntr;
        CSL_CPINTC_HANDLE           hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0       
        ...
        CSL_CPINTC_enableHostInterrupt (hnd, hostIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_enableSysInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCSystemInterrupt  sysIntr 
)

============================================================================
CSL_CPINTC_enableSysInterrupt

Description
This API enables the system interrupt in the interrupt controller.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    System Interrupt which is to be enabled.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The specific System Interrupt is enabled in the controller and can now generate host interrupts.

Writes
CPINTC_ENABLE_SET_INDEX_REG_ENABLE_SET_INDEX

Example

        CSL_CPINTCSystemInterrupt     sysIntr;
        CSL_CPINTC_HANDLE             hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_enableSysInterrupt (hnd, sysIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE CSL_CPINTCNestingLevel CSL_CPINTC_getNestingLevel ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_getNestingLevel

Description
This API gets the current nesting level which is configured in the interrupt controller.

Arguments

        hnd         This is the handle to the CPINTC instance.
     

Return Value CSL_CPINTCNestingLevel - Current Nesting Level.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_GLB_NEST_LEVEL_REG_GLB_NEST_LEVEL

Example

        CSL_CPINTC_HANDLE      hnd;
        CSL_CPINTCNestingLevel nestLevel;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        nestLevel = CSL_CPINTC_getNestingLevel();
     

===========================================================================

CSL_IDEF_INLINE CSL_CPINTCNestingMode CSL_CPINTC_getNestingMode ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_getNestingMode

Description
This API gets the current nesting mode which is configured in the interrupt controller.

Arguments

        hnd         This is the handle to the CPINTC instance.
     

Return Value CSL_CPINTCNestingMode - Current Nesting Mode.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_CONTROL_REG_NEST_MODE

Example

        CSL_CPINTC_HANDLE     hnd;
        CSL_CPINTCNestingMode nestMode;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        nestMode = CSL_CPINTC_getNestingMode();
     

===========================================================================

CSL_IDEF_INLINE CSL_CPINTCSystemInterrupt CSL_CPINTC_getPendingHostInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCHostInterrupt  hostIntr 
)

============================================================================
CSL_CPINTC_getPendingHostInterrupt

Description
This API gets the current highest priority pending interrupt for a given host. This API should only be called after checking if there are pending interrupts using the 'CSL_CPINTCisHostInterruptPending'.

Arguments

        hnd        This is the handle to the CPINTC instance.
        hostIntr   This is the specific host interrupt output.
     

Return Value CSL_CPINTCSystemInterrupt - Highest Priority System Interrupt.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_PRI_HINT_REG0_PRI_HINT_0..CPINTC_PRI_HINT_REG255_PRI_HINT_255

Example

        CSL_CPINTCSystemInterrupt intr;
        Bool                      pendingStatus;
        CSL_CPINTC_HANDLE         hnd;
        CSL_CPINTCHostInterrupt   host;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        pendingStatus = CSL_CPINTC_isHostInterruptPending(hnd, host);
        if (pendingStatus == TRUE)
        {
            intr = CSL_CPINTC_getPendingHostInterrupt(hnd, host);
        }
        ...
     

===========================================================================

CSL_IDEF_INLINE CSL_CPINTCSystemInterrupt CSL_CPINTC_getPendingInterrupt ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_getPendingInterrupt

Description
This API gets the current highest priority pending interrupt. This API should only be called after checking if there are pending interrupts using the 'CSL_CPINTCisInterruptPending'.

Arguments

        hnd        This is the handle to the CPINTC instance.
     

Return Value CSL_CPINTCHostInterrupt - Highest Priority System Interrupt.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_GLB_PRI_INTR_REG_GLB_PRI_INTR

Example

        CSL_CPINTCHostInterrupt intr;
        Bool                    pendingStatus;
        CSL_CPINTC_HANDLE       hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        pendingStatus = CSL_CPINTC_isInterruptPending(hnd);
        if (pendingStatus == TRUE)
        {
            intr = CSL_CPINTC_getPendingInterrupt(hnd);
        }
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_getRawInterruptStatus ( CSL_CPINTC_Handle  hnd,
Uint8  index,
Uint32 *  rawStatus 
)

============================================================================
CSL_CPINTC_getRawInterruptStatus

Description
The function is used to get the contents of the RAW Interrupt status register.

Arguments

        hnd         This is the handle to the CPINTC instance.
        index       RAW Status Index register which is to be read
        rawStatus   RAW Status which indicates which interrupts are pending.
     

Return Value
None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_RAW_STATUS_REG

Example

        CSL_CPINTC_HANDLE   hnd;
        Uint32              rawStatus;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        // Check if there are any interrupts between 0-31 pending.
        CSL_CPINTC_getRawInterruptStatus(hnd, 0, &rawStatus);
        if (rawStatus != 0)
        {
            // An Interrupt from 0-31 is pending.
        }
        ...
     

===========================================================================

CSL_IDEF_INLINE Bool CSL_CPINTC_isHostInterruptPending ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCHostInterrupt  hostIntr 
)

============================================================================
CSL_CPINTC_isHostInterruptPending

Description
This API is used to check if there are any pending interrupts active for a particular host.

Arguments

        hnd        This is the handle to the CPINTC instance.
        hostIntr   This is the specific host interrupt output.
     

Return Value TRUE - Interrupts are pending. FALSE - No interrupts are pending.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_PRI_HINT_REG0_NONE_HINT_0..CPINTC_PRI_HINT_REG255_NONE_HINT_255

Example

        Bool                pendingStatus;
        CSL_CPINTC_HANDLE   hnd;
        CSL_CPINTCHostInterrupt host;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        pendingStatus = CSL_CPINTC_isHostInterruptPending(hnd, host);
        ...
     

===========================================================================

CSL_IDEF_INLINE Bool CSL_CPINTC_isInterruptPending ( CSL_CPINTC_Handle  hnd  ) 

============================================================================
CSL_CPINTC_isInterruptPending

Description
This API is used to check if there are any pending interrupts active in the system or not.

Arguments

        hnd        This is the handle to the CPINTC instance.
     

Return Value TRUE - Interrupts are pending. FALSE - No interrupts are pending.

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Reads
CPINTC_GLB_PRI_INTR_REG_GLB_NONE

Example

        Bool                pendingStatus;
        CSL_CPINTC_HANDLE   hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        pendingStatus = CSL_CPINTCisInterruptPending(hnd);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_mapChannelToHostInterrupt ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCChannel  channel,
CSL_CPINTCHostInterrupt  hostIntr 
)

============================================================================
CSL_CPINTC_mapChannelToHostInterrupt

Description
This API is used to map the channel to the host interrupt.

Arguments

        hnd        This is the handle to the CPINTC instance.
        channel    Channel Number to be mapped
        sysIntr    Host Interrupt to which the channel is mapped to.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Writes
CPINTC_HINT_MAP_REG0_HINT_MAP_0..CPINTC_HINT_MAP_REG49_HINT_MAP_196

Example

        CSL_CPINTCHostInterrupt hostIntr;
        CSL_CPINTCChannel       channel;
        CSL_CPINTC_HANDLE       hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_mapChannelToHostInterrupt(hnd, channel, hostIntr);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_mapSystemIntrToChannel ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCSystemInterrupt  sysIntr,
CSL_CPINTCChannel  channel 
)

============================================================================
CSL_CPINTC_mapSystemIntrToChannel

Description
This API is used to map a system interrupt to a specific channel.

Arguments

        hnd        This is the handle to the CPINTC instance.
        sysIntr    System Interrupt which is to be mapped
        channel    Channel Number to which the interrupt is to be mapped.
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
None

Writes
CPINTC_CH_MAP_REG0_CH_MAP_0..CPINTC_CH_MAP_REG49_CH_MAP_196

Example

        CSL_CPINTCSystemInterrupt sysIntr;
        CSL_CPINTCChannel         channel;
        CSL_CPINTC_HANDLE         hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_mapSystemIntrToChannel(hnd, sysIntr, channel);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_setNestingLevel ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCNestingLevel  nestLevel 
)

============================================================================
CSL_CPINTC_setNestingLevel

Description
This API overrides the Interrupt Controller global nesting level that is set by automatic nesting mode

Arguments

        hnd         This is the handle to the CPINTC instance.
        nestLevel   Nesting Level to be configured
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The interrupt controller is configured to use the specified nesting level.

Writes
CPINTC_GLB_NEST_LEVEL_REG_GLB_NEST_LEVEL

Example

        CSL_CPINTCNestingLevel nestLevel;
        CSL_CPINTC_HANDLE      hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_setNestingLevel (hnd, nestLevel);
        ...
     

===========================================================================

CSL_IDEF_INLINE void CSL_CPINTC_setNestingMode ( CSL_CPINTC_Handle  hnd,
CSL_CPINTCNestingMode  nestMode 
)

============================================================================
CSL_CPINTC_setNestingMode

Description
This API configures the Interrupt Controller nesting mode.

Arguments

        hnd         This is the handle to the CPINTC instance.
        nestMode    Nesting Mode to be configured
     

Return Value None

Pre Condition
CSL_CPINTC_open() must be called.

Post Condition
The interrupt controller is configured to use the specified nesting mode.

Writes
CPINTC_CONTROL_REG_NEST_MODE

Example

        CSL_CPINTCNestingMode nestMode;
        CSL_CPINTC_HANDLE     hnd;
        ...
        hnd = CSL_CPINTC_open (0);    // Opens CPINTC Instance 0
        ...
        CSL_CPINTC_setNestingMode (hnd, nestMode);
        ...
     

===========================================================================


Copyright 2012, Texas Instruments Incorporated