Robobo
timetick.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

uint32_t TimeTick_Configure (uint32_t dwNew_MCK)
 Configures the SAM3 SysTick & reset tickCount. Systick interrupt handler will generates 1ms interrupt and increase a tickCount. More...
 
void TimeTick_Increment (void)
 Handler for Sytem Tick interrupt.
 
uint32_t GetTickCount (void)
 Get current Tick Count, in ms.
 
void Wait (volatile uint32_t dwMs)
 Sync Wait for several ms.
 
void Sleep (volatile uint32_t dwMs)
 Sync Sleep for several ms.
 

Detailed Description

Purpose

Methods and definitions for Global time tick and wait functions.

Defines a common and simpliest use of Time Tick, to increase tickCount every 1ms, the application can get this value through GetTickCount().

Usage
  1. Configure the System Tick with TimeTick_Configure() when MCK changed
    Note
    Must be done before any invoke of GetTickCount(), Wait() or Sleep().
  2. Uses GetTickCount to get current tick value.
  3. Uses Wait to wait several ms.
  4. Uses Sleep to enter wait for interrupt mode to wait several ms.

Function Documentation

uint32_t TimeTick_Configure ( uint32_t  dwNew_MCK)

Configures the SAM3 SysTick & reset tickCount. Systick interrupt handler will generates 1ms interrupt and increase a tickCount.

Parameters
dwNew_MCKCurrent master clock.