5-systick

1.
When the main frequency is 64MHz and the main frequency of the CPU is 1MHz, one systick=1/1MHz=1us
When the main frequency of the CPU is 64MHz, one systick=1/64MHz=0.015625us=15.625ns

2. Main documents
2.1 modules\nrfx\hal\nrf_systick. h
2.2modules\nrfx\drivers\src\nrfx_systick.c
2.3integration\nrfx\legacy\nrf_drv_systick.h

3. Example

#include <stdbool.h>
#include <stdint.h>
#include "nrf_drv_systick.h"
#include "boards.h"

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    /* Configure LED-pins as outputs. */
    bsp_board_init(BSP_INIT_LEDS);

    /* Init systick driver */
    nrf_drv_systick_init();

    /* Toggle LEDs. */
    while (true)
    {
        for (int i = 0; i < LEDS_NUMBER; i++)
        {
            bsp_board_led_invert(i);
            nrf_drv_systick_delay_ms(1000);     
        }
    }
}

Guess you like

Origin blog.csdn.net/fanxianchao_2012/article/details/130315226