![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
Encapsulates the ARM sysTick counter, which is used for computing delays. ARM-core specific function that enables the ARM systick timer on Kinetis uCs. the timer is 24 bit so allows measurement of intervals up to 2^24/CORE_SYSTICK_HZ secs=0.35s for a 48MHz uC. More...
#include "issdk_hal.h"
Go to the source code of this file.
Macros | |
#define | SYST_CSR SysTick->CTRL |
#define | SYST_RVR SysTick->LOAD |
#define | SYST_CVR SysTick->VAL |
Functions | |
void | SysTick_Handler (void) |
uint32_t | SysTick_GetOVFCount (void) |
void | BOARD_SystickEnable (void) |
Function to enable systicks framework. More... | |
void | BOARD_SystickStart (int32_t *pStart) |
Function to Record the Start systick. More... | |
int32_t | BOARD_SystickElapsedTicks (int32_t *pStart) |
Function to compute the Elapsed systicks. More... | |
uint32_t | BOARD_SystickElapsedTime_us (int32_t *pStart) |
Function to compute the Elapsed Time. More... | |
void | BOARD_DELAY_ms (uint32_t delay_ms) |
Function to insert delays. More... | |
Variables | |
uint32_t | g_ovf_stamp |
volatile uint32_t | g_ovf_counter = 0 |
Encapsulates the ARM sysTick counter, which is used for computing delays. ARM-core specific function that enables the ARM systick timer on Kinetis uCs. the timer is 24 bit so allows measurement of intervals up to 2^24/CORE_SYSTICK_HZ secs=0.35s for a 48MHz uC.
Definition in file systick_utils.c.
#define SYST_CSR SysTick->CTRL |
Definition at line 45 of file systick_utils.c.
Referenced by BOARD_SystickEnable().
#define SYST_CVR SysTick->VAL |
Definition at line 47 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickStart().
#define SYST_RVR SysTick->LOAD |
Definition at line 46 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickEnable().
void BOARD_DELAY_ms | ( | uint32_t | delay_ms | ) |
Function to insert delays.
This function blocks for the specified milli seconds by using the elapsed systicks to determine time delays.
[in] | delay_ms | The required time to block. |
Definition at line 116 of file systick_utils.c.
References BOARD_SystickElapsedTicks(), BOARD_SystickStart(), and int32_t().
Referenced by ADS_DetectShield(), ADS_MMA9553Query(), DIFF_P_I2C_Initialize(), DIFF_P_SPI_Initialize(), FXLC95000_SPI_Initialize(), FXLS8962_I2C_DeInit(), FXLS8962_SPI_Deinit(), MMA9553_I2C_Initialize(), MMA9553_SPI_Initialize(), Sensor_I2C_BlockWrite(), and Sensor_SPI_BlockWrite().
Function to compute the Elapsed systicks.
This function computes the elapsed ticks by getting the difference of the current tick to the one in the arguement.
[in] | pStart | Pointer to the variable contating the start systick. |
Definition at line 87 of file systick_utils.c.
References g_ovf_stamp, int32_t(), SYST_CVR, SYST_RVR, and SysTick_GetOVFCount().
Referenced by BOARD_DELAY_ms(), and BOARD_SystickElapsedTime_us().
uint32_t BOARD_SystickElapsedTime_us | ( | int32_t * | pStart | ) |
Function to compute the Elapsed Time.
This function computes the elapsed Time in micro seconds by getting the difference of the current tick to the one in the arguement. It also updates the start tick to the current systick.
[in] | pStart | Pointer to the variable contating the start systick. |
Definition at line 99 of file systick_utils.c.
References BOARD_SystickElapsedTicks(), and BOARD_SystickStart().
Referenced by main().
void BOARD_SystickEnable | ( | void | ) |
Function to enable systicks framework.
This function initializes the CMSIS define ARM core specific systick implementation.
[in] | void. |
Definition at line 70 of file systick_utils.c.
References SYST_CSR, and SYST_RVR.
Referenced by main().
void BOARD_SystickStart | ( | int32_t * | pStart | ) |
Function to Record the Start systick.
This function records the current systick count for other APIs to compute difference.
[in] | pStart | Pointer to the variable to store the current/start systick. |
Definition at line 79 of file systick_utils.c.
References g_ovf_stamp, SYST_CVR, and SysTick_GetOVFCount().
Referenced by BOARD_DELAY_ms(), BOARD_SystickElapsedTime_us(), main(), and process_host_command().
uint32_t SysTick_GetOVFCount | ( | void | ) |
Definition at line 60 of file systick_utils.c.
References g_ovf_counter.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickStart().
void SysTick_Handler | ( | void | ) |
Definition at line 54 of file systick_utils.c.
References g_ovf_counter.
volatile uint32_t g_ovf_counter = 0 |
Definition at line 50 of file systick_utils.c.
Referenced by SysTick_GetOVFCount(), and SysTick_Handler().
uint32_t g_ovf_stamp |
Definition at line 49 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickStart().