Logo Search packages:      
Sourcecode: linux version File versions  Download package

Defines | Functions

tmrHw.c File Reference

Low level Timer driver routines. More...

#include <csp/errno.h>
#include <csp/stdint.h>
#include <csp/tmrHw.h>
#include <mach/csp/tmrHw_reg.h>
Include dependency graph for tmrHw.c:

Go to the source code of this file.

Defines

#define tmrHw_ASSERT(a)   if (!(a)) *(char *)0 = 0
#define tmrHw_HIGH_16_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_HIGH_16_RESOLUTION_COUNT)
#define tmrHw_HIGH_16_RESOLUTION_COUNT   (tmrHw_HIGH_1_RESOLUTION_COUNT / 16)
#define tmrHw_HIGH_1_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_HIGH_1_RESOLUTION_COUNT)
#define tmrHw_HIGH_1_RESOLUTION_COUNT   (tmrHw_HIGH_RESOLUTION_CLOCK / tmrHw_MILLISEC_PER_SEC)
#define tmrHw_HIGH_256_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_HIGH_256_RESOLUTION_COUNT)
#define tmrHw_HIGH_256_RESOLUTION_COUNT   (tmrHw_HIGH_1_RESOLUTION_COUNT / 256)
#define tmrHw_LOW_16_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_LOW_16_RESOLUTION_COUNT)
#define tmrHw_LOW_16_RESOLUTION_COUNT   (tmrHw_LOW_1_RESOLUTION_COUNT / 16)
#define tmrHw_LOW_1_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_LOW_1_RESOLUTION_COUNT)
#define tmrHw_LOW_1_RESOLUTION_COUNT   (tmrHw_LOW_RESOLUTION_CLOCK / tmrHw_MILLISEC_PER_SEC)
#define tmrHw_LOW_256_MAX_MILLISEC   (0xFFFFFFFF / tmrHw_LOW_256_RESOLUTION_COUNT)
#define tmrHw_LOW_256_RESOLUTION_COUNT   (tmrHw_LOW_1_RESOLUTION_COUNT / 256)
#define tmrHw_MILLISEC_PER_SEC   (1000)

Functions

static void ResetTimer (tmrHw_ID_t timerId)
 Resets a timer.
static tmrHw_INTERVAL_t SetTimerPeriod (tmrHw_ID_t timerId, tmrHw_INTERVAL_t msec)
 Sets counter value for an interval in ms.
void tmrHw_clearInterrupt (tmrHw_ID_t timerId)
 Clears the interrupt.
void tmrHw_disableInterrupt (tmrHw_ID_t timerId)
 Disables timer interrupt.
static int tmrHw_divide (int num, int denom)
 Local Divide function.
void tmrHw_enableInterrupt (tmrHw_ID_t timerId)
 Enables timer interrupt.
tmrHw_RATE_t tmrHw_getCountRate (tmrHw_ID_t timerId)
 Gets timer count rate.
uint32_t tmrHw_GetCurrentCount (tmrHw_ID_t timerId)
 Gets current timer count.
tmrHw_ID_t tmrHw_getInterruptSource (void)
 Indentifies a timer causing interrupt.
tmrHw_INTERRUPT_STATUS_e tmrHw_getInterruptStatus (tmrHw_ID_t timerId)
 Gets the interrupt status.
uint32_t tmrHw_getTimerCapability (tmrHw_ID_t timerId, tmrHw_CAPABILITY_e capability)
 Get timer capability.
void tmrHw_printDebugInfo (tmrHw_ID_t timerId, int(*fpPrint)(const char *,...))
 Displays specific timer registers.
tmrHw_RATE_t tmrHw_setFreeRunningTimer (tmrHw_ID_t timerId, uint32_t divider)
 Configures a timer to run as a free running timer.
tmrHw_INTERVAL_t tmrHw_setOneshotTimerInterval (tmrHw_ID_t timerId, tmrHw_INTERVAL_t msec)
 Configures a periodic timer to generate timer interrupt just once after certain time interval.
tmrHw_INTERVAL_t tmrHw_setPeriodicTimerInterval (tmrHw_ID_t timerId, tmrHw_INTERVAL_t msec)
 Configures a periodic timer to generate timer interrupt after certain time interval.
tmrHw_RATE_t tmrHw_setPeriodicTimerRate (tmrHw_ID_t timerId, tmrHw_RATE_t rate)
 Configures a periodic timer in terms of timer interrupt rate.
int tmrHw_startTimer (tmrHw_ID_t timerId)
 Starts a timer.
int tmrHw_stopTimer (tmrHw_ID_t timerId)
 Stops a timer.
void tmrHw_udelay (tmrHw_ID_t timerId, unsigned long usecs)
 Use a timer to perform a busy wait delay for a number of usecs.

Detailed Description

Low level Timer driver routines.

Note:

These routines provide basic timer functionality only.

Definition in file tmrHw.c.


Generated by  Doxygen 1.6.0   Back to index