1/* ################################## SysTick function ###################################### */ 2/** 3\defgroup SysTick_gr Systick Timer (SYSTICK) 4\brief Initialize and start the SysTick timer. 5\details 6 The System Tick Time (SysTick) generates interrupt requests on a regular basis. 7 This allows an OS to carry out context switching to support multiple tasking. For applications 8 that do not require an OS, the SysTick can be used for time keeping, time measurement, or as an 9 interrupt source for tasks that need to be executed regularly. 10 11 12\section SysTick_code_ex_sec Code Example 13 The code below shows the usage of the function SysTick_Config() with an LPC1700. 14 15\code 16#include "LPC17xx.h" 17 18volatile uint32_t msTicks = 0; /* Variable to store millisecond ticks */ 19 20void SysTick_Handler(void) { /* SysTick interrupt Handler. */ 21 msTicks++; /* See startup file startup_LPC17xx.s for SysTick vector */ 22} 23 24int main (void) { 25 uint32_t returnCode; 26 27 returnCode = SysTick_Config(SystemCoreClock / 1000); /* Configure SysTick to generate an interrupt every millisecond */ 28 29 if (returnCode != 0) { /* Check return code for errors */ 30 // Error Handling 31 } 32 33 while(1); 34} 35\endcode 36 37@{ 38*/ 39 40 41/**************************************************************************************************/ 42/** \brief System Tick Timer Configuration 43 \details 44 Initialises and starts the System Tick Timer and its interrupt. 45 After this call, the SysTick timer creates interrupts with the specified time interval. 46 Counter is in free running mode to generate periodical interrupts. 47 48 \param [in] ticks Number of ticks between two interrupts 49 50 \returns 0 - success 51 \returns 1 - failure 52 53 \note 54 When \ref __Vendor_SysTickConfig is defined to 1, the standard function <b>SysTick_Config</b> 55 is excluded. In this case, the \ref device_h_pg must contain a vendor specific implementation 56 of this function. 57*/ 58uint32_t SysTick_Config(uint32_t ticks); 59 60/** @} */