MSP432E4 DriverLib API Guide
1.11.00.03
|
Functions | |
void | SysTickEnable (void) |
void | SysTickDisable (void) |
void | SysTickIntRegister (void(*pfnHandler)(void)) |
void | SysTickIntUnregister (void) |
void | SysTickIntEnable (void) |
void | SysTickIntDisable (void) |
void | SysTickPeriodSet (uint32_t ui32Period) |
uint32_t | SysTickPeriodGet (void) |
uint32_t | SysTickValueGet (void) |
SysTick is a simple timer that is part of the NVIC controller in the Cortex-M microprocessor. Its intended purpose is to provide a periodic interrupt for an RTOS, but it can be used for other simple timing purposes.
The SysTick interrupt handler does not need to clear the SysTick interrupt source as it is cleared automatically by the NVIC when the SysTick interrupt handler is called.
The SysTick API is fairly simple, like SysTick itself. There are functions for configuring and enabling SysTick (SysTickEnable(), SysTickDisable(), SysTickPeriodSet(), SysTickPeriodGet(), and SysTickValueGet()) and functions for dealing with an interrupt handler for SysTick (SysTickIntRegister(), SysTickIntUnregister(), SysTickIntEnable(), and SysTickIntDisable()).
The following example shows how to use the SysTick API to configure the SysTick counter and read its value.
void SysTickEnable | ( | void | ) |
Enables the SysTick counter.
This function starts the SysTick counter. If an interrupt handler has been registered, it is called when the SysTick counter rolls over.
References HWREG, NVIC_ST_CTRL, NVIC_ST_CTRL_CLK_SRC, and NVIC_ST_CTRL_ENABLE.
void SysTickDisable | ( | void | ) |
Disables the SysTick counter.
This function stops the SysTick counter. If an interrupt handler has been registered, it is not called until SysTick is restarted.
References HWREG, NVIC_ST_CTRL, and NVIC_ST_CTRL_ENABLE.
void SysTickIntRegister | ( | void(*)(void) | pfnHandler | ) |
Registers an interrupt handler for the SysTick interrupt.
pfnHandler | is a pointer to the function to be called when the SysTick interrupt occurs. |
This function registers the handler to be called when a SysTick interrupt occurs.
References FAULT_SYSTICK, HWREG, IntRegister(), NVIC_ST_CTRL, and NVIC_ST_CTRL_INTEN.
void SysTickIntUnregister | ( | void | ) |
Unregisters the interrupt handler for the SysTick interrupt.
This function unregisters the handler to be called when a SysTick interrupt occurs.
References FAULT_SYSTICK, HWREG, IntUnregister(), NVIC_ST_CTRL, and NVIC_ST_CTRL_INTEN.
void SysTickIntEnable | ( | void | ) |
Enables the SysTick interrupt.
This function enables the SysTick interrupt, allowing it to be reflected to the processor.
References HWREG, NVIC_ST_CTRL, and NVIC_ST_CTRL_INTEN.
void SysTickIntDisable | ( | void | ) |
Disables the SysTick interrupt.
This function disables the SysTick interrupt, preventing it from being reflected to the processor.
References HWREG, NVIC_ST_CTRL, and NVIC_ST_CTRL_INTEN.
void SysTickPeriodSet | ( | uint32_t | ui32Period | ) |
Sets the period of the SysTick counter.
ui32Period | is the number of clock ticks in each period of the SysTick counter and must be between 1 and 16,777,216, inclusive. |
This function sets the rate at which the SysTick counter wraps, which equates to the number of processor clocks between interrupts.
References ASSERT, HWREG, and NVIC_ST_RELOAD.
uint32_t SysTickPeriodGet | ( | void | ) |
Gets the period of the SysTick counter.
This function returns the rate at which the SysTick counter wraps, which equates to the number of processor clocks between interrupts.
References HWREG, and NVIC_ST_RELOAD.
uint32_t SysTickValueGet | ( | void | ) |
Gets the current value of the SysTick counter.
This function returns the current value of the SysTick counter, which is a value between the period - 1 and zero, inclusive.
References HWREG, and NVIC_ST_CURRENT.