ISSDK  1.8
IoT Sensing Software Development Kit
systick_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 /**
10  * @file systick_utils.h
11  * @brief ARM Systick Utilities.
12 
13  This file provides systick based counts for the developer
14  to get cycle counts for measuring time delays.
15 */
16 
17 #ifndef __SYSTICK_UTILS_H__
18 #define __SYSTICK_UTILS_H__
19 
20 /*! @brief Function to enable systicks framework.
21  * @details This function initializes the CMSIS define ARM core specific systick implementation.
22  * @param[in] void.
23  * @return void.
24  * @constraints This should be the first function to be invoked before other Systick APIs.
25  * @reeentrant Yes
26  */
27 void BOARD_SystickEnable(void);
28 
29 /*! @brief Function to Record the Start systick.
30  * @details This function records the current systick count for other APIs to compute difference.
31  * @param[in] pStart Pointer to the variable to store the current/start systick.
32  * @return void.
33  * @constraints None.
34  * @reeentrant Yes
35  */
36 void BOARD_SystickStart(int32_t *pStart);
37 
38 /*! @brief Function to compute the Elapsed systicks.
39  * @details This function computes the elapsed ticks by getting the difference
40  * of the current tick to the one in the arguement.
41  * @param[in] pStart Pointer to the variable contating the start systick.
42  * @return int32_t The elapsed systicks.
43  * @constraints None.
44  * @reeentrant Yes
45  */
47 
48 /*! @brief Function to compute the Elapsed Time.
49  * @details This function computes the elapsed Time in micro seconds by getting the difference
50  * of the current tick to the one in the arguement.
51  * It also updates the start tick to the current systick.
52  * @param[in] pStart Pointer to the variable contating the start systick.
53  * @return uint32_t The elapsed Time in micro seconds.
54  * @constraints None.
55  * @reeentrant Yes
56  */
57 uint32_t BOARD_SystickElapsedTime_us(int32_t *pStart);
58 
59 /*! @brief Function to insert delays.
60  * @details This function blocks for the specified milli seconds by using the elapsed systicks
61  * to determine time delays.
62  * @param[in] delay_ms The required time to block.
63  * @return void.
64  * @constraints None.
65  * @reeentrant Yes
66  */
67 void BOARD_DELAY_ms(uint32_t delay_ms);
68 
69 #endif // __SYSTICK_UTILS_H__
void BOARD_DELAY_ms(uint32_t delay_ms)
Function to insert delays.
Definition: systick_utils.c:81
int32_t BOARD_SystickElapsedTicks(int32_t *pStart)
Function to compute the Elapsed systicks.
Definition: systick_utils.c:52
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
void BOARD_SystickStart(int32_t *pStart)
Function to Record the Start systick.
Definition: systick_utils.c:44
uint32_t BOARD_SystickElapsedTime_us(int32_t *pStart)
Function to compute the Elapsed Time.
Definition: systick_utils.c:64
void BOARD_SystickEnable(void)
Function to enable systicks framework.
Definition: systick_utils.c:35