arch/arm/nrf5x/include/nrf52840.h
/**
  \brief   System Tick Configuration
  \details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
           Counter is in free running mode to generate periodic interrupts.
  \param [in]  ticks  Number of ticks between two interrupts.
  \return          0  Function succeeded.
  \return          1  Function failed.
  \note    When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
           must contain a vendor-specific implementation of this function.
 */
\brief   System Tick Configuration
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
Counter is in free running mode to generate periodic interrupts.
\param [in]  ticks  Number of ticks between two interrupts.
\return          0  Function succeeded.
\return          1  Function failed.
\note    When the variable __Vendor_SysTickConfig is set to 1, then the
function SysTick_Config is not included. In this case, the file device.h
must contain a vendor-specific implementation of this function.
\ brief System Tick Configuration \ details Initializes the System Timer and its interrupt and starts the System Tick Timer . Counter is in free running mode to generate periodic interrupts . \ param [ in ] ticks Number of ticks between two interrupts . \ return 0 Function succeeded . \ return 1 Function failed . \ note When the variable __Vendor_SysTickConfig is set to 1 then the function SysTick_Config is not included . In this case the file device . h must contain a vendor - specific implementation of this function .
static inline uint32_t SysTick_Config(uint32_t ticks)
{
  if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
  {
    return (1UL);                                                   
  }
  SysTick->LOAD  = (uint32_t)(ticks - 1UL);                         
  NVIC_SetPriority (PendSV_IRQn, 0x7);
  NVIC_SetPriority (SysTick_IRQn, 0x7); 
  SysTick->VAL   = 0UL;                                             
  SysTick->CTRL  = SysTick_CTRL_CLKSOURCE_Msk |
                   SysTick_CTRL_TICKINT_Msk   |
                   SysTick_CTRL_ENABLE_Msk;                         
  SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
  return (0UL);                                                     
}
static inline uint32_t SysTick_Config ( uint32_t ticks ) { if ( ( ticks - 1UL ) > SysTick_LOAD_RELOAD_Msk ) { return ( 1UL ) ; } SysTick -> LOAD = ( uint32_t ) ( ticks - 1UL ) ; NVIC_SetPriority ( PendSV_IRQn , 0x7 ) ; NVIC_SetPriority ( SysTick_IRQn , 0x7 ) ; SysTick -> VAL = 0UL ; SysTick -> CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk ; SCB -> SCR |= SCB_SCR_SLEEPDEEP_Msk ; return ( 0UL ) ; }
\brief   System Tick Configuration
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
\ brief System Tick Configuration \ details Initializes the System Timer and its interrupt and starts the System Tick Timer .
/* Reload value impossible */ /* set reload register */ /* set Priority for Systick Interrupt */ /* Load the SysTick Counter Value */ /* Enable SysTick IRQ and SysTick Timer */ /* Enable deep sleep */ /* Function successful */