Mobil_surveillance_system 1
Timer.c
Go to the documentation of this file.
00001 #include "Timer.h"
00002 
00004 
00009 //*****************************************************************************
00010 //
00011 // Globlal Flags
00012 //
00013 //*****************************************************************************
00014 
00016 unsigned char g_ucTimerAexpired = 0;
00017 
00018 
00019 //*****************************************************************************
00020 //
00021 // Function definitions
00022 //
00023 //*****************************************************************************
00024 
00026 void Timer_timerAInit(void)
00028 {
00029     // Source ACLK, and stop 
00030     TACTL = TASSEL_1 + MC_0;
00031     //CCR0 interrupt enabble
00032     CCTL0 = CCIE; 
00033     // set coppare value between 0 and 0xffff
00034     CCR0 =  TIMER_OFFSETVALUE_0x8000;
00035     // clear flags indicate that the Timer A has not been expeired yet
00036     g_ucTimerAexpired = 0;
00037 }
00038 
00039 
00041 void Timer_timerAUpStart(void)
00043 {
00044     // UP mode: the timer counts up to TACCR0
00045     TACTL |= MC_1;
00046 }
00047 
00048 
00050 void Timer_timerAStop(void)
00052 {
00053     TACTL |= MC_0;
00054 }
00055 
00056 
00058 void Timer_timerAReset(void)
00060 {
00061     // reset timer A, This rests TAR,, the clock divider and the count direction
00062     TACTL |= TACLR;
00063 }
 All Data Structures Files Functions Variables Typedefs Enumerations Defines