Tiva Driver Lib
|
Macros | |
#define | NUM_INTERRUPTS 155 |
Functions | |
bool | IntMasterDisable (void) |
void | IntRegister (uint32_t ui32Interrupt, void(*pfnHandler)(void)) |
void | IntUnregister (uint32_t ui32Interrupt) |
void | IntPriorityGroupingSet (uint32_t ui32Bits) |
uint32_t | IntPriorityGroupingGet (void) |
void | IntPrioritySet (uint32_t ui32Interrupt, uint8_t ui8Priority) |
int32_t | IntPriorityGet (uint32_t ui32Interrupt) |
void | IntEnable (uint32_t ui32Interrupt) |
void | IntDisable (uint32_t ui32Interrupt) |
uint32_t | IntIsEnabled (uint32_t ui32Interrupt) |
void | IntPendSet (uint32_t ui32Interrupt) |
void | IntPendClear (uint32_t ui32Interrupt) |
void | IntPriorityMaskSet (uint32_t ui32PriorityMask) |
uint32_t | IntPriorityMaskGet (void) |
void | IntTrigger (uint32_t ui32Interrupt) |
void IntDisable | ( | uint32_t | ui32Interrupt | ) |
Disables an interrupt.
ui32Interrupt | specifies the interrupt to be disabled. |
The specified interrupt is disabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.
void IntEnable | ( | uint32_t | ui32Interrupt | ) |
Enables an interrupt.
ui32Interrupt | specifies the interrupt to be enabled. |
The specified interrupt is enabled in the interrupt controller. Other enables for the interrupt (such as at the peripheral level) are unaffected by this function.
uint32_t IntIsEnabled | ( | uint32_t | ui32Interrupt | ) |
Returns if a peripheral interrupt is enabled.
ui32Interrupt | specifies the interrupt to check. |
This function checks if the specified interrupt is enabled in the interrupt controller.
bool IntMasterDisable | ( | void | ) |
Disables the processor interrupt.
This function prevents the processor from receiving interrupts. This function does not affect the set of interrupts enabled in the interrupt controller; it just gates the single interrupt from the controller to the processor.
interrupt.h
and call this function without having included hw_types.h
. Now that the return is a bool
, a compiler error occurs in this case. The solution is to include hw_types.h
before including interrupt.h
.void IntPendClear | ( | uint32_t | ui32Interrupt | ) |
Un-pends an interrupt.
ui32Interrupt | specifies the interrupt to be un-pended. |
The specified interrupt is un-pended in the interrupt controller. This causes any previously generated interrupts that have not been handled yet (due to higher priority interrupts or the interrupt not having been enabled yet) to be discarded.
void IntPendSet | ( | uint32_t | ui32Interrupt | ) |
Pends an interrupt.
ui32Interrupt | specifies the interrupt to be pended. |
The specified interrupt is pended in the interrupt controller. Pending an interrupt causes the interrupt controller to execute the corresponding interrupt handler at the next available time, based on the current interrupt state priorities. For example, if called by a higher priority interrupt handler, the specified interrupt handler is not called until after the current interrupt handler has completed execution. The interrupt must have been enabled for it to be called.
int32_t IntPriorityGet | ( | uint32_t | ui32Interrupt | ) |
Gets the priority of an interrupt.
ui32Interrupt | specifies the interrupt in question. |
This function gets the priority of an interrupt. See IntPrioritySet() for a definition of the priority value.
uint32_t IntPriorityGroupingGet | ( | void | ) |
Gets the priority grouping of the interrupt controller.
This function returns the split between preemptable priority levels and sub-priority levels in the interrupt priority specification.
void IntPriorityGroupingSet | ( | uint32_t | ui32Bits | ) |
Sets the priority grouping of the interrupt controller.
ui32Bits | specifies the number of bits of preemptable priority. |
This function specifies the split between preemptable priority levels and sub-priority levels in the interrupt priority specification. The range of the grouping values are dependent upon the hardware implementation; on the Tiva C and E Series family, three bits are available for hardware interrupt prioritization and therefore priority grouping values of three through seven have the same effect.
uint32_t IntPriorityMaskGet | ( | void | ) |
Gets the priority masking level
This function gets the current setting of the interrupt priority masking level. The value returned is the priority level such that all interrupts of that and lesser priority are masked. A value of 0 means that priority masking is disabled.
Smaller numbers correspond to higher interrupt priorities. So for example a priority level mask of 4 allows interrupts of priority level 0-3, and interrupts with a numerical priority of 4 and greater are blocked.
The hardware priority mechanism only looks at the upper N bits of the priority level (where N is 3 for the Tiva C and E Series family), so any prioritization must be performed in those bits.
void IntPriorityMaskSet | ( | uint32_t | ui32PriorityMask | ) |
Sets the priority masking level
ui32PriorityMask | is the priority level that is masked. |
This function sets the interrupt priority masking level so that all interrupts at the specified or lesser priority level are masked. Masking interrupts can be used to globally disable a set of interrupts with priority below a predetermined threshold. A value of 0 disables priority masking.
Smaller numbers correspond to higher interrupt priorities. So for example a priority level mask of 4 allows interrupts of priority level 0-3, and interrupts with a numerical priority of 4 and greater are blocked.
The hardware priority mechanism only looks at the upper N bits of the priority level (where N is 3 for the Tiva C and E Series family), so any prioritization must be performed in those bits.
void IntPrioritySet | ( | uint32_t | ui32Interrupt, |
uint8_t | ui8Priority | ||
) |
Sets the priority of an interrupt.
ui32Interrupt | specifies the interrupt in question. |
ui8Priority | specifies the priority of the interrupt. |
This function is used to set the priority of an interrupt. When multiple interrupts are asserted simultaneously, the ones with the highest priority are processed before the lower priority interrupts. Smaller numbers correspond to higher interrupt priorities; priority 0 is the highest interrupt priority.
The hardware priority mechanism only looks at the upper N bits of the priority level (where N is 3 for the Tiva C and E Series family), so any prioritization must be performed in those bits. The remaining bits can be used to sub-prioritize the interrupt sources, and may be used by the hardware priority mechanism on a future part. This arrangement allows priorities to migrate to different NVIC implementations without changing the gross prioritization of the interrupts.
void IntRegister | ( | uint32_t | ui32Interrupt, |
void(*)(void) | pfnHandler | ||
) |
Registers a function to be called when an interrupt occurs.
ui32Interrupt | specifies the interrupt in question. |
pfnHandler | is a pointer to the function to be called. |
This function is used to specify the handler function to be called when the given interrupt is asserted to the processor. When the interrupt occurs, if it is enabled (via IntEnable()), the handler function is called in interrupt context. Because the handler function can preempt other code, care must be taken to protect memory or peripherals that are accessed by the handler and other non-handler code.
void IntTrigger | ( | uint32_t | ui32Interrupt | ) |
Triggers an interrupt.
ui32Interrupt | specifies the interrupt to be triggered. |
This function performs a software trigger of an interrupt. The interrupt controller behaves as if the corresponding interrupt line was asserted, and the interrupt is handled in the same manner (meaning that it must be enabled in order to be processed, and the processing is based on its priority with respect to other unhandled interrupts).
void IntUnregister | ( | uint32_t | ui32Interrupt | ) |
Unregisters the function to be called when an interrupt occurs.
ui32Interrupt | specifies the interrupt in question. |
This function is used to indicate that no handler is called when the given interrupt is asserted to the processor. The interrupt source is automatically disabled (via IntDisable()) if necessary.