![]() |
ISSDK
1.8
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) |
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 19 of file systick_utils.c.
Referenced by BOARD_SystickEnable().
#define SYST_CVR SysTick->VAL |
Definition at line 21 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickStart().
#define SYST_RVR SysTick->LOAD |
Definition at line 20 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 81 of file systick_utils.c.
References BOARD_SystickElapsedTicks(), BOARD_SystickStart(), and int32_t().
Referenced by ADS_DetectShield(), ADS_MMA9553Query(), FXLC95000_SPI_Initialize(), FXLS8962_I2C_DeInit(), FXLS8962_SPI_Deinit(), FXLS896x_I2C_DeInit(), FXLS896x_SPI_Deinit(), FXLS8974_I2C_DeInit(), FXLS8974_SPI_Deinit(), MMA9553_I2C_Initialize(), MMA9553_SPI_Initialize(), perform_selftest(), 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 52 of file systick_utils.c.
References g_ovf_counter, g_ovf_stamp, int32_t(), SYST_CVR, and SYST_RVR.
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 64 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 35 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 44 of file systick_utils.c.
References g_ovf_counter, g_ovf_stamp, and SYST_CVR.
Referenced by BOARD_DELAY_ms(), BOARD_SystickElapsedTime_us(), main(), and process_host_command().
void SysTick_Handler | ( | void | ) |
Definition at line 28 of file systick_utils.c.
References g_ovf_counter.
volatile uint32_t g_ovf_counter = 0 |
Definition at line 24 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), BOARD_SystickStart(), and SysTick_Handler().
uint32_t g_ovf_stamp |
Definition at line 23 of file systick_utils.c.
Referenced by BOARD_SystickElapsedTicks(), and BOARD_SystickStart().