Defines | Functions
timer.h File Reference

Go to the source code of this file.

Defines

#define __MSP430_HAS_TxA7__
 DEPRECATED FILE - Replaced by timera.h and timerb.h.
#define TIMER_CLOCKSOURCE_EXTERNAL_TXCLK   TASSEL__TACLK
#define TIMER_CLOCKSOURCE_ACLK   TASSEL__ACLK
#define TIMER_CLOCKSOURCE_SMCLK   TASSEL__SMCLK
#define TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK   TASSEL__INCLK
#define TIMER_CLOCKSOURCE_DIVIDER_1   0x01
#define TIMER_CLOCKSOURCE_DIVIDER_2   0x02
#define TIMER_CLOCKSOURCE_DIVIDER_4   0x04
#define TIMER_CLOCKSOURCE_DIVIDER_8   0x08
#define TIMER_CLOCKSOURCE_DIVIDER_3   0x03
#define TIMER_CLOCKSOURCE_DIVIDER_5   0x05
#define TIMER_CLOCKSOURCE_DIVIDER_6   0x06
#define TIMER_CLOCKSOURCE_DIVIDER_7   0x07
#define TIMER_CLOCKSOURCE_DIVIDER_10   0x0A
#define TIMER_CLOCKSOURCE_DIVIDER_12   0x0C
#define TIMER_CLOCKSOURCE_DIVIDER_14   0x0E
#define TIMER_CLOCKSOURCE_DIVIDER_16   0x10
#define TIMER_CLOCKSOURCE_DIVIDER_20   0x14
#define TIMER_CLOCKSOURCE_DIVIDER_24   0x18
#define TIMER_CLOCKSOURCE_DIVIDER_28   0x1C
#define TIMER_CLOCKSOURCE_DIVIDER_32   0x20
#define TIMER_CLOCKSOURCE_DIVIDER_40   0x28
#define TIMER_CLOCKSOURCE_DIVIDER_48   0x30
#define TIMER_CLOCKSOURCE_DIVIDER_56   0x38
#define TIMER_CLOCKSOURCE_DIVIDER_64   0x40
#define TIMER_DO_CLEAR   TACLR
#define TIMER_SKIP_CLEAR   0x00
#define TIMER_CAPTURECOMPARE_INPUT   SCCI
#define TIMER_SYNCHRONIZED_CAPTURECOMPARE_INPUT   CCI
#define TIMER_CAPTURECOMPARE_INPUT_HIGH   0x01
#define TIMER_CAPTURECOMPARE_INPUT_LOW   0x00
#define TIMER_OUTPUTMODE_OUTBITVALUE_HIGH   OUT
#define TIMER_OUTPUTMODE_OUTBITVALUE_LOW   0x00
#define TIMER_CAPTURE_OVERFLOW   COV
#define TIMER_CAPTURECOMPARE_INTERRUPT_FLAG   CCIFG
#define TIMER_TAIE_INTERRUPT_ENABLE   TAIE
#define TIMER_TAIE_INTERRUPT_DISABLE   0x00
#define TIMER_CCIE_CCR0_INTERRUPT_ENABLE   CCIE
#define TIMER_CCIE_CCR0_INTERRUPT_DISABLE   0x00
#define TIMER_STOP_MODE   MC_0
#define TIMER_UP_MODE   MC_1
#define TIMER_CONTINUOUS_MODE   MC_2
#define TIMER_UPDOWN_MODE   MC_3
#define TIMER_CAPTURECOMPARE_REGISTER_0   0x02
#define TIMER_CAPTURECOMPARE_REGISTER_1   0x04
#define TIMER_CAPTURECOMPARE_REGISTER_2   0x06
#define TIMER_CAPTURECOMPARE_REGISTER_3   0x08
#define TIMER_CAPTURECOMPARE_REGISTER_4   0x0A
#define TIMER_CAPTURECOMPARE_REGISTER_5   0x0C
#define TIMER_CAPTURECOMPARE_REGISTER_6   0x0E
#define TIMER_OUTPUTMODE_OUTBITVALUE   OUTMOD_0
#define TIMER_OUTPUTMODE_SET   OUTMOD_1
#define TIMER_OUTPUTMODE_TOGGLE_RESET   OUTMOD_2
#define TIMER_OUTPUTMODE_SET_RESET   OUTMOD_3
#define TIMER_OUTPUTMODE_TOGGLE   OUTMOD_4
#define TIMER_OUTPUTMODE_RESET   OUTMOD_5
#define TIMER_OUTPUTMODE_TOGGLE_SET   OUTMOD_6
#define TIMER_OUTPUTMODE_RESET_SET   OUTMOD_7
#define TIMER_CAPTUREMODE_NO_CAPTURE   CM_0
#define TIMER_CAPTUREMODE_RISING_EDGE   CM_1
#define TIMER_CAPTUREMODE_FALLING_EDGE   CM_2
#define TIMER_CAPTUREMODE_RISING_AND_FALLING_EDGE   CM_3
#define TIMER_CAPTURE_ASYNCHRONOUS   0x00
#define TIMER_CAPTURE_SYNCHRONOUS   SCS
#define TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE   CCIE
#define TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE   0x00
#define TIMER_CAPTURE_INPUTSELECT_CCIxA   CCIS_0
#define TIMER_CAPTURE_INPUTSELECT_CCIxB   CCIS_1
#define TIMER_CAPTURE_INPUTSELECT_GND   CCIS_2
#define TIMER_CAPTURE_INPUTSELECT_Vcc   CCIS_3
#define TIMER_INTERRUPT_NOT_PENDING   0x00
#define TIMER_INTERRUPT_PENDING   0x01
#define TIMER_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT   SCCI
#define TIMER_READ_CAPTURE_COMPARE_INPUT   CCI

Functions

void Timer_startContinuousMode (unsigned int baseAddress, unsigned int clockSource, unsigned int clockSourceDivider, unsigned int timerInterruptEnable_TAIE, unsigned int timerclear)
void Timer_startContinousMode (unsigned int baseAddress, unsigned int clockSource, unsigned int clockSourceDivider, unsigned int timerInterruptEnable_TAIE, unsigned int timerclear)
void Timer_startUpMode (unsigned int baseAddress, unsigned int clockSource, unsigned int clockSourceDivider, unsigned int timerPeriod, unsigned int timerInterruptEnable_TAIE, unsigned int captureCompareInterruptEnable_CCR0_CCIE, unsigned int timerclear)
void Timer_startUpDownMode (unsigned int baseAddress, unsigned int clockSource, unsigned int clockSourceDivider, unsigned int timerPeriod, unsigned int timerInterruptEnable_TAIE, unsigned int captureCompareInterruptEnable_CCR0_CCIE, unsigned int timerclear)
void Timer_initCapture (unsigned int baseAddress, unsigned int captureRegister, unsigned int captureMode, unsigned int captureInputSelect, unsigned short synchronizeCaptureSource, unsigned short captureInterruptEnable, unsigned int captureOutputMode)
void Timer_initCompare (unsigned int baseAddress, unsigned int compareRegister, unsigned short compareInterruptEnable, unsigned int compareOutputMode, unsigned int compareValue)
void Timer_enableInterrupt (unsigned int baseAddress)
void Timer_disableInterrupt (unsigned int baseAddress)
unsigned long Timer_getInterruptStatus (unsigned int baseAddress)
void Timer_enableCaptureCompareInterrupt (unsigned int baseAddress, unsigned int captureCompareRegister)
void Timer_disableCaptureCompareInterrupt (unsigned int baseAddress, unsigned int captureCompareRegister)
unsigned long Timer_getCaptureCompareInterruptStatus (unsigned int baseAddress, unsigned int mask)
void Timer_clear (unsigned int baseAddress)
unsigned short Timer_getSynchronizedCaptureCompareInput (unsigned int baseAddress, unsigned int captureCompareRegister, unsigned short synchronized)
void Timer_setOutputForOutputModeOutBitValue (unsigned int baseAddress, unsigned int captureCompareRegister, unsigned char outputModeOutBitValue)
unsigned char Timer_getOutputForOutputModeOutBitValue (unsigned int baseAddress, unsigned int captureCompareRegister)
void Timer_generatePWM (unsigned int baseAddress, unsigned int clockSource, unsigned int clockSourceDivider, unsigned int timerPeriod, unsigned int compareRegister, unsigned int compareOutputMode, unsigned int dutyCycle)
void Timer_stop (unsigned int baseAddress)
unsigned int Timer_getCaptureCompareCount (unsigned int baseAddress, unsigned int captureCompareRegister)
void Timer_setCompareValue (unsigned int baseAddress, unsigned int compareRegister, unsigned int compareValue)
void Timer_clearCaptureCompareInterruptFlag (unsigned int baseAddress, unsigned int compareRegister)
void Timer_clearTimerInterruptFlag (unsigned int baseAddress)

Define Documentation

#define __MSP430_HAS_TxA7__

DEPRECATED FILE - Replaced by timera.h and timerb.h.

#define TIMER_CLOCKSOURCE_EXTERNAL_TXCLK   TASSEL__TACLK
#define TIMER_CLOCKSOURCE_ACLK   TASSEL__ACLK
#define TIMER_CLOCKSOURCE_SMCLK   TASSEL__SMCLK
#define TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK   TASSEL__INCLK
#define TIMER_CLOCKSOURCE_DIVIDER_1   0x01
#define TIMER_CLOCKSOURCE_DIVIDER_2   0x02
#define TIMER_CLOCKSOURCE_DIVIDER_4   0x04
#define TIMER_CLOCKSOURCE_DIVIDER_8   0x08
#define TIMER_CLOCKSOURCE_DIVIDER_3   0x03
#define TIMER_CLOCKSOURCE_DIVIDER_5   0x05
#define TIMER_CLOCKSOURCE_DIVIDER_6   0x06
#define TIMER_CLOCKSOURCE_DIVIDER_7   0x07
#define TIMER_CLOCKSOURCE_DIVIDER_10   0x0A
#define TIMER_CLOCKSOURCE_DIVIDER_12   0x0C
#define TIMER_CLOCKSOURCE_DIVIDER_14   0x0E
#define TIMER_CLOCKSOURCE_DIVIDER_16   0x10
#define TIMER_CLOCKSOURCE_DIVIDER_20   0x14
#define TIMER_CLOCKSOURCE_DIVIDER_24   0x18
#define TIMER_CLOCKSOURCE_DIVIDER_28   0x1C
#define TIMER_CLOCKSOURCE_DIVIDER_32   0x20
#define TIMER_CLOCKSOURCE_DIVIDER_40   0x28
#define TIMER_CLOCKSOURCE_DIVIDER_48   0x30
#define TIMER_CLOCKSOURCE_DIVIDER_56   0x38
#define TIMER_CLOCKSOURCE_DIVIDER_64   0x40
#define TIMER_DO_CLEAR   TACLR
#define TIMER_SKIP_CLEAR   0x00
#define TIMER_CAPTURECOMPARE_INPUT   SCCI
#define TIMER_SYNCHRONIZED_CAPTURECOMPARE_INPUT   CCI
#define TIMER_CAPTURECOMPARE_INPUT_HIGH   0x01
#define TIMER_CAPTURECOMPARE_INPUT_LOW   0x00
#define TIMER_OUTPUTMODE_OUTBITVALUE_HIGH   OUT
#define TIMER_OUTPUTMODE_OUTBITVALUE_LOW   0x00
#define TIMER_CAPTURE_OVERFLOW   COV
#define TIMER_CAPTURECOMPARE_INTERRUPT_FLAG   CCIFG
#define TIMER_TAIE_INTERRUPT_ENABLE   TAIE
#define TIMER_TAIE_INTERRUPT_DISABLE   0x00
#define TIMER_CCIE_CCR0_INTERRUPT_ENABLE   CCIE
#define TIMER_CCIE_CCR0_INTERRUPT_DISABLE   0x00
#define TIMER_STOP_MODE   MC_0
#define TIMER_UP_MODE   MC_1
#define TIMER_CONTINUOUS_MODE   MC_2
#define TIMER_UPDOWN_MODE   MC_3
#define TIMER_CAPTURECOMPARE_REGISTER_0   0x02
#define TIMER_CAPTURECOMPARE_REGISTER_1   0x04
#define TIMER_CAPTURECOMPARE_REGISTER_2   0x06
#define TIMER_CAPTURECOMPARE_REGISTER_3   0x08
#define TIMER_CAPTURECOMPARE_REGISTER_4   0x0A
#define TIMER_CAPTURECOMPARE_REGISTER_5   0x0C
#define TIMER_CAPTURECOMPARE_REGISTER_6   0x0E
#define TIMER_OUTPUTMODE_OUTBITVALUE   OUTMOD_0
#define TIMER_OUTPUTMODE_SET   OUTMOD_1
#define TIMER_OUTPUTMODE_TOGGLE_RESET   OUTMOD_2
#define TIMER_OUTPUTMODE_SET_RESET   OUTMOD_3
#define TIMER_OUTPUTMODE_TOGGLE   OUTMOD_4
#define TIMER_OUTPUTMODE_RESET   OUTMOD_5
#define TIMER_OUTPUTMODE_TOGGLE_SET   OUTMOD_6
#define TIMER_OUTPUTMODE_RESET_SET   OUTMOD_7
#define TIMER_CAPTUREMODE_NO_CAPTURE   CM_0

Referenced by Timer_initCapture().

#define TIMER_CAPTUREMODE_RISING_EDGE   CM_1

Referenced by Timer_initCapture().

#define TIMER_CAPTUREMODE_FALLING_EDGE   CM_2

Referenced by Timer_initCapture().

#define TIMER_CAPTUREMODE_RISING_AND_FALLING_EDGE   CM_3

Referenced by Timer_initCapture().

#define TIMER_CAPTURE_ASYNCHRONOUS   0x00

Referenced by Timer_initCapture().

#define TIMER_CAPTURE_SYNCHRONOUS   SCS

Referenced by Timer_initCapture().

#define TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE   CCIE
#define TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE   0x00
#define TIMER_CAPTURE_INPUTSELECT_CCIxA   CCIS_0

Referenced by Timer_initCapture().

#define TIMER_CAPTURE_INPUTSELECT_CCIxB   CCIS_1

Referenced by Timer_initCapture().

#define TIMER_CAPTURE_INPUTSELECT_GND   CCIS_2

Referenced by Timer_initCapture().

#define TIMER_CAPTURE_INPUTSELECT_Vcc   CCIS_3

Referenced by Timer_initCapture().

#define TIMER_INTERRUPT_NOT_PENDING   0x00
#define TIMER_INTERRUPT_PENDING   0x01
#define TIMER_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT   SCCI
#define TIMER_READ_CAPTURE_COMPARE_INPUT   CCI

Function Documentation

void Timer_startContinuousMode ( unsigned int  baseAddress,
unsigned int  clockSource,
unsigned int  clockSourceDivider,
unsigned int  timerInterruptEnable_TAIE,
unsigned int  timerclear 
)

Starts timer in continuous mode.

Parameters:
baseAddressis the base address of the Timer module.
clockSourceselects Clock source. Valid values are TIMER_CLOCKSOURCE_EXTERNAL_TXCLK [Default value] TIMER_CLOCKSOURCE_ACLK TIMER_CLOCKSOURCE_SMCLK TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are TIMER_CLOCKSOURCE_DIVIDER_1 [Default value] TIMER_CLOCKSOURCE_DIVIDER_2 TIMER_CLOCKSOURCE_DIVIDER_4 TIMER_CLOCKSOURCE_DIVIDER_8 TIMER_CLOCKSOURCE_DIVIDER_3 TIMER_CLOCKSOURCE_DIVIDER_5 TIMER_CLOCKSOURCE_DIVIDER_6 TIMER_CLOCKSOURCE_DIVIDER_7 TIMER_CLOCKSOURCE_DIVIDER_10 TIMER_CLOCKSOURCE_DIVIDER_12 TIMER_CLOCKSOURCE_DIVIDER_14 TIMER_CLOCKSOURCE_DIVIDER_16 TIMER_CLOCKSOURCE_DIVIDER_20 TIMER_CLOCKSOURCE_DIVIDER_24 TIMER_CLOCKSOURCE_DIVIDER_28 TIMER_CLOCKSOURCE_DIVIDER_32 TIMER_CLOCKSOURCE_DIVIDER_40 TIMER_CLOCKSOURCE_DIVIDER_48 TIMER_CLOCKSOURCE_DIVIDER_56 TIMER_CLOCKSOURCE_DIVIDER_64
timerInterruptEnable_TAIEis to enable or disable timer interrupt Valid values are TIMER_TAIE_INTERRUPT_ENABLE TIMER_TAIE_INTERRUPT_DISABLE [Default value]
timercleardecides if timer clock divider, count direction, count need to be reset. Valid values are TIMER_DO_CLEAR TIMER_SKIP_CLEAR [Default value]

Modified reister is TAxCTL

Returns:
None

References ASSERT, HWREG, privateTimerProcessClockSourceDivider(), TIMER_CLOCKSOURCE_ACLK, TIMER_CLOCKSOURCE_DIVIDER_1, TIMER_CLOCKSOURCE_DIVIDER_10, TIMER_CLOCKSOURCE_DIVIDER_12, TIMER_CLOCKSOURCE_DIVIDER_14, TIMER_CLOCKSOURCE_DIVIDER_16, TIMER_CLOCKSOURCE_DIVIDER_2, TIMER_CLOCKSOURCE_DIVIDER_20, TIMER_CLOCKSOURCE_DIVIDER_24, TIMER_CLOCKSOURCE_DIVIDER_28, TIMER_CLOCKSOURCE_DIVIDER_3, TIMER_CLOCKSOURCE_DIVIDER_32, TIMER_CLOCKSOURCE_DIVIDER_4, TIMER_CLOCKSOURCE_DIVIDER_40, TIMER_CLOCKSOURCE_DIVIDER_48, TIMER_CLOCKSOURCE_DIVIDER_5, TIMER_CLOCKSOURCE_DIVIDER_56, TIMER_CLOCKSOURCE_DIVIDER_6, TIMER_CLOCKSOURCE_DIVIDER_64, TIMER_CLOCKSOURCE_DIVIDER_7, TIMER_CLOCKSOURCE_DIVIDER_8, TIMER_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_SMCLK, TIMER_CONTINUOUS_MODE, TIMER_DO_CLEAR, TIMER_SKIP_CLEAR, TIMER_TAIE_INTERRUPT_DISABLE, TIMER_TAIE_INTERRUPT_ENABLE, and TIMER_UPDOWN_MODE.

Referenced by Timer_startContinousMode().

void Timer_startContinousMode ( unsigned int  baseAddress,
unsigned int  clockSource,
unsigned int  clockSourceDivider,
unsigned int  timerInterruptEnable_TAIE,
unsigned int  timerclear 
)

DEPRECATED- Spelling Error Fixed Starts timer in continuous mode.

Parameters:
baseAddressis the base address of the Timer module.
clockSourceselects Clock source. Valid values are TIMER_CLOCKSOURCE_EXTERNAL_TXCLK [Default value] TIMER_CLOCKSOURCE_ACLK TIMER_CLOCKSOURCE_SMCLK TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are TIMER_CLOCKSOURCE_DIVIDER_1 [Default value] TIMER_CLOCKSOURCE_DIVIDER_2 TIMER_CLOCKSOURCE_DIVIDER_4 TIMER_CLOCKSOURCE_DIVIDER_8 TIMER_CLOCKSOURCE_DIVIDER_3 TIMER_CLOCKSOURCE_DIVIDER_5 TIMER_CLOCKSOURCE_DIVIDER_6 TIMER_CLOCKSOURCE_DIVIDER_7 TIMER_CLOCKSOURCE_DIVIDER_10 TIMER_CLOCKSOURCE_DIVIDER_12 TIMER_CLOCKSOURCE_DIVIDER_14 TIMER_CLOCKSOURCE_DIVIDER_16 TIMER_CLOCKSOURCE_DIVIDER_20 TIMER_CLOCKSOURCE_DIVIDER_24 TIMER_CLOCKSOURCE_DIVIDER_28 TIMER_CLOCKSOURCE_DIVIDER_32 TIMER_CLOCKSOURCE_DIVIDER_40 TIMER_CLOCKSOURCE_DIVIDER_48 TIMER_CLOCKSOURCE_DIVIDER_56 TIMER_CLOCKSOURCE_DIVIDER_64
timerInterruptEnable_TAIEis to enable or disable timer interrupt Valid values are TIMER_TAIE_INTERRUPT_ENABLE TIMER_TAIE_INTERRUPT_DISABLE [Default value]
timercleardecides if timer clock divider, count direction, count need to be reset. Valid values are TIMER_DO_CLEAR TIMER_SKIP_CLEAR [Default value]

Modified reister is TAxCTL

Returns:
None

References Timer_startContinuousMode().

void Timer_startUpMode ( unsigned int  baseAddress,
unsigned int  clockSource,
unsigned int  clockSourceDivider,
unsigned int  timerPeriod,
unsigned int  timerInterruptEnable_TAIE,
unsigned int  captureCompareInterruptEnable_CCR0_CCIE,
unsigned int  timerclear 
)

Starts timer in up mode.

Parameters:
baseAddressis the base address of the Timer module.
clockSourceselects Clock source. Valid values are TIMER_CLOCKSOURCE_EXTERNAL_TXCLK [Default value] TIMER_CLOCKSOURCE_ACLK TIMER_CLOCKSOURCE_SMCLK TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are TIMER_CLOCKSOURCE_DIVIDER_1 [Default value] TIMER_CLOCKSOURCE_DIVIDER_2 TIMER_CLOCKSOURCE_DIVIDER_4 TIMER_CLOCKSOURCE_DIVIDER_8 TIMER_CLOCKSOURCE_DIVIDER_3 TIMER_CLOCKSOURCE_DIVIDER_5 TIMER_CLOCKSOURCE_DIVIDER_6 TIMER_CLOCKSOURCE_DIVIDER_7 TIMER_CLOCKSOURCE_DIVIDER_10 TIMER_CLOCKSOURCE_DIVIDER_12 TIMER_CLOCKSOURCE_DIVIDER_14 TIMER_CLOCKSOURCE_DIVIDER_16 TIMER_CLOCKSOURCE_DIVIDER_20 TIMER_CLOCKSOURCE_DIVIDER_24 TIMER_CLOCKSOURCE_DIVIDER_28 TIMER_CLOCKSOURCE_DIVIDER_32 TIMER_CLOCKSOURCE_DIVIDER_40 TIMER_CLOCKSOURCE_DIVIDER_48 TIMER_CLOCKSOURCE_DIVIDER_56 TIMER_CLOCKSOURCE_DIVIDER_64
timerPeriodis the specified timer period. This is the value that gets written into the CCR0. Limited to 16 bits[unsigned int]
timerInterruptEnable_TAIEis to enable or disable timer interrupt Valid values are TIMER_TAIE_INTERRUPT_ENABLE and TIMER_TAIE_INTERRUPT_DISABLE [Default value]
captureCompareInterruptEnable_CCR0_CCIEis to enable or disable timer CCR0 captureComapre interrupt. Valid values are TIMER_CCIE_CCR0_INTERRUPT_ENABLE and TIMER_CCIE_CCR0_INTERRUPT_DISABLE [Default value]
timercleardecides if timer clock divider, count direction, count need to be reset. Valid values are TIMER_DO_CLEAR TIMER_SKIP_CLEAR [Default value]

Modified registers are TAxCTL, TAxCCR0, TAxCCTL0

Returns:
None

References ASSERT, HWREG, privateTimerProcessClockSourceDivider(), TIMER_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_CLOCKSOURCE_ACLK, TIMER_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_SMCLK, TIMER_DO_CLEAR, TIMER_SKIP_CLEAR, TIMER_TAIE_INTERRUPT_ENABLE, TIMER_UP_MODE, and TIMER_UPDOWN_MODE.

void Timer_startUpDownMode ( unsigned int  baseAddress,
unsigned int  clockSource,
unsigned int  clockSourceDivider,
unsigned int  timerPeriod,
unsigned int  timerInterruptEnable_TAIE,
unsigned int  captureCompareInterruptEnable_CCR0_CCIE,
unsigned int  timerclear 
)

Starts timer in up down mode.

Parameters:
baseAddressis the base address of the Timer module.
clockSourceselects Clock source. Valid values are TIMER_CLOCKSOURCE_EXTERNAL_TXCLK [Default value] TIMER_CLOCKSOURCE_ACLK TIMER_CLOCKSOURCE_SMCLK TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are TIMER_CLOCKSOURCE_DIVIDER_1 [Default value] TIMER_CLOCKSOURCE_DIVIDER_2 TIMER_CLOCKSOURCE_DIVIDER_4 TIMER_CLOCKSOURCE_DIVIDER_8 TIMER_CLOCKSOURCE_DIVIDER_3 TIMER_CLOCKSOURCE_DIVIDER_5 TIMER_CLOCKSOURCE_DIVIDER_6 TIMER_CLOCKSOURCE_DIVIDER_7 TIMER_CLOCKSOURCE_DIVIDER_10 TIMER_CLOCKSOURCE_DIVIDER_12 TIMER_CLOCKSOURCE_DIVIDER_14 TIMER_CLOCKSOURCE_DIVIDER_16 TIMER_CLOCKSOURCE_DIVIDER_20 TIMER_CLOCKSOURCE_DIVIDER_24 TIMER_CLOCKSOURCE_DIVIDER_28 TIMER_CLOCKSOURCE_DIVIDER_32 TIMER_CLOCKSOURCE_DIVIDER_40 TIMER_CLOCKSOURCE_DIVIDER_48 TIMER_CLOCKSOURCE_DIVIDER_56 TIMER_CLOCKSOURCE_DIVIDER_64
timerPeriodis the specified timer period
timerInterruptEnable_TAIEis to enable or disable timer interrupt Valid values are TIMER_TAIE_INTERRUPT_ENABLE TIMER_TAIE_INTERRUPT_DISABLE [Default value]
captureCompareInterruptEnable_CCR0_CCIEis to enable or disable timer CCR0 captureComapre interrupt. Valid values are TIMER_CCIE_CCR0_INTERRUPT_ENABLE and TIMER_CCIE_CCR0_INTERRUPT_DISABLE [Default value]
timercleardecides if timer clock divider, count direction, count need to be reset. Valid values are TIMER_DO_CLEAR TIMER_SKIP_CLEAR [Default value]

Modified registers are TAxCTL, TAxCCR0, TAxCCTL0

Returns:
None

References ASSERT, HWREG, privateTimerProcessClockSourceDivider(), TIMER_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_CLOCKSOURCE_ACLK, TIMER_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_SMCLK, TIMER_DO_CLEAR, TIMER_SKIP_CLEAR, TIMER_TAIE_INTERRUPT_ENABLE, and TIMER_UPDOWN_MODE.

void Timer_initCapture ( unsigned int  baseAddress,
unsigned int  captureRegister,
unsigned int  captureMode,
unsigned int  captureInputSelect,
unsigned short  synchronizeCaptureSource,
unsigned short  captureInterruptEnable,
unsigned int  captureOutputMode 
)

Initializes Capture Mode

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
captureModeis the capture mode selected. Valid values are TIMER_CAPTUREMODE_NO_CAPTURE [Default value] TIMER_CAPTUREMODE_RISING_EDGE TIMER_CAPTUREMODE_FALLING_EDGE TIMER_CAPTUREMODE_RISING_AND_FALLING_EDGE
captureInputSelectdecides the Input Select TIMER_CAPTURE_INPUTSELECT_CCIxA [Default value] TIMER_CAPTURE_INPUTSELECT_CCIxB TIMER_CAPTURE_INPUTSELECT_GND TIMER_CAPTURE_INPUTSELECT_Vcc
synchronizeCaptureSourcedecides if capture source should be synchronized with timer clock Valid values are TIMER_CAPTURE_ASYNCHRONOUS [Default value] TIMER_CAPTURE_SYNCHRONOUS
captureInterruptEnableis to enable or disable timer captureComapre interrupt. Valid values are TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE [Default value] TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE
captureOutputModespecifies the ouput mode. Valid values are TIMER_OUTPUTMODE_OUTBITVALUE [Default value], TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_TOGGLE_RESET, TIMER_OUTPUTMODE_SET_RESET TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_TOGGLE_SET, TIMER_OUTPUTMODE_RESET_SET

Modified register is TAxCCTLn

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURE_ASYNCHRONOUS, TIMER_CAPTURE_INPUTSELECT_CCIxA, TIMER_CAPTURE_INPUTSELECT_CCIxB, TIMER_CAPTURE_INPUTSELECT_GND, TIMER_CAPTURE_INPUTSELECT_Vcc, TIMER_CAPTURE_SYNCHRONOUS, TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE, TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_CAPTUREMODE_FALLING_EDGE, TIMER_CAPTUREMODE_NO_CAPTURE, TIMER_CAPTUREMODE_RISING_AND_FALLING_EDGE, TIMER_CAPTUREMODE_RISING_EDGE, TIMER_DO_CLEAR, TIMER_OUTPUTMODE_OUTBITVALUE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_RESET_SET, TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_SET_RESET, TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_TOGGLE_RESET, TIMER_OUTPUTMODE_TOGGLE_SET, and TIMER_TAIE_INTERRUPT_ENABLE.

void Timer_initCompare ( unsigned int  baseAddress,
unsigned int  compareRegister,
unsigned short  compareInterruptEnable,
unsigned int  compareOutputMode,
unsigned int  compareValue 
)

Initializes Compare Mode

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
compareInterruptEnableis to enable or disable timer captureComapre interrupt. Valid values are TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE and TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE [Default value]
compareOutputModespecifies the ouput mode. Valid values are TIMER_OUTPUTMODE_OUTBITVALUE [Default value], TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_TOGGLE_RESET, TIMER_OUTPUTMODE_SET_RESET TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_TOGGLE_SET, TIMER_OUTPUTMODE_RESET_SET
compareValueis the count to be compared with in compare mode

Modified register is TAxCCTLn and TAxCCRn

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_INTERRUPT_DISABLE, TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_OUTPUTMODE_OUTBITVALUE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_RESET_SET, TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_SET_RESET, TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_TOGGLE_RESET, and TIMER_OUTPUTMODE_TOGGLE_SET.

void Timer_enableInterrupt ( unsigned int  baseAddress)

Enable timer interrupt

Parameters:
baseAddressis the base address of the Timer module.

Modified register is TAxCTL

Returns:
None

References HWREG, and HWREGB.

void Timer_disableInterrupt ( unsigned int  baseAddress)

Disable timer interrupt

Parameters:
baseAddressis the base address of the Timer module.

Modified register is TAxCTL

Returns:
None

References HWREG.

unsigned long Timer_getInterruptStatus ( unsigned int  baseAddress)

Get timer interrupt status

Parameters:
baseAddressis the base address of the Timer module.
Returns:
unsigned long. Return interrupt status. Valid values are TIMER_INTERRUPT_PENDING TIMER_INTERRUPT_NOT_PENDING

References HWREG.

void Timer_enableCaptureCompareInterrupt ( unsigned int  baseAddress,
unsigned int  captureCompareRegister 
)

Enable capture compare interrupt

Parameters:
baseAddressis the base address of the Timer module.
captureCompareRegisteris the selected capture compare regsiter

Modified register is TAxCCTLn

Returns:
None

References ASSERT, HWREG, HWREGB, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, and TIMER_CAPTURECOMPARE_REGISTER_6.

void Timer_disableCaptureCompareInterrupt ( unsigned int  baseAddress,
unsigned int  captureCompareRegister 
)

Disable capture compare interrupt

Parameters:
baseAddressis the base address of the Timer module.
captureCompareRegisteris the selected capture compare regsiter

Modified register is TAxCCTLn

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, and TIMER_CAPTURECOMPARE_REGISTER_6.

unsigned long Timer_getCaptureCompareInterruptStatus ( unsigned int  baseAddress,
unsigned int  mask 
)

Return capture compare interrupt status

Parameters:
baseAddressis the base address of the Timer module.
maskis the mask for the interrupt status Valid values is and OR of TIMER_CAPTURE_OVERFLOW, TIMER_CAPTURECOMPARE_INTERRUPT_FLAG

Modified register is TAxCTL

Returns:
unsigned long. The mask of the set flags.

References HWREG.

void Timer_clear ( unsigned int  baseAddress)

Reset/Clear the timer clock divider, count direction, count

Parameters:
baseAddressis the base address of the Timer module.

Modified register is TAxCTL

Returns:
None

References HWREG.

unsigned short Timer_getSynchronizedCaptureCompareInput ( unsigned int  baseAddress,
unsigned int  captureCompareRegister,
unsigned short  synchronized 
)

Get synchrnozied capturecompare input

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
synchronizedis to select type of capture compare input. Valid values are TIMER_READ_CAPTURE_COMPARE_INPUT TIMER_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
Returns:
TIMER_CAPTURECOMPARE_INPUT_HIGH or TIMER_CAPTURECOMPARE_INPUT_LOW

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_INPUT_HIGH, TIMER_CAPTURECOMPARE_INPUT_LOW, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_READ_CAPTURE_COMPARE_INPUT, and TIMER_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT.

void Timer_setOutputForOutputModeOutBitValue ( unsigned int  baseAddress,
unsigned int  captureCompareRegister,
unsigned char  outputModeOutBitValue 
)

Set ouput bit for output mode

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
outputModeOutBitValueisthe value to be set for out bit Valid values are TIMER_OUTPUTMODE_OUTBITVALUE_HIGH TIMER_OUTPUTMODE_OUTBITVALUE_LOW

Modified register is TAxCCTLn

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_OUTPUTMODE_OUTBITVALUE_HIGH, and TIMER_OUTPUTMODE_OUTBITVALUE_LOW.

unsigned char Timer_getOutputForOutputModeOutBitValue ( unsigned int  baseAddress,
unsigned int  captureCompareRegister 
)

Get ouput bit for output mode

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
Returns:
TIMER_OUTPUTMODE_OUTBITVALUE_HIGH or TIMER_OUTPUTMODE_OUTBITVALUE_LOW

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_OUTPUTMODE_OUTBITVALUE_HIGH, and TIMER_OUTPUTMODE_OUTBITVALUE_LOW.

void Timer_generatePWM ( unsigned int  baseAddress,
unsigned int  clockSource,
unsigned int  clockSourceDivider,
unsigned int  timerPeriod,
unsigned int  compareRegister,
unsigned int  compareOutputMode,
unsigned int  dutyCycle 
)

Generate a PWM with timer running in up down mode

Parameters:
baseAddressis the base address of the Timer module.
clockSourceselects Clock source. Valid values are TIMER_CLOCKSOURCE_EXTERNAL_TXCLK TIMER_CLOCKSOURCE_ACLK TIMER_CLOCKSOURCE_SMCLK TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are TIMER_CLOCKSOURCE_DIVIDER_1 TIMER_CLOCKSOURCE_DIVIDER_2 TIMER_CLOCKSOURCE_DIVIDER_4 TIMER_CLOCKSOURCE_DIVIDER_8 TIMER_CLOCKSOURCE_DIVIDER_3 TIMER_CLOCKSOURCE_DIVIDER_5 TIMER_CLOCKSOURCE_DIVIDER_6 TIMER_CLOCKSOURCE_DIVIDER_7 TIMER_CLOCKSOURCE_DIVIDER_10 TIMER_CLOCKSOURCE_DIVIDER_12 TIMER_CLOCKSOURCE_DIVIDER_14 TIMER_CLOCKSOURCE_DIVIDER_16 TIMER_CLOCKSOURCE_DIVIDER_20 TIMER_CLOCKSOURCE_DIVIDER_24 TIMER_CLOCKSOURCE_DIVIDER_28 TIMER_CLOCKSOURCE_DIVIDER_32 TIMER_CLOCKSOURCE_DIVIDER_40 TIMER_CLOCKSOURCE_DIVIDER_48 TIMER_CLOCKSOURCE_DIVIDER_56 TIMER_CLOCKSOURCE_DIVIDER_64
timerPeriodselects the desired timer period
compareRegisterselects the compare register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
compareOutputModespecifies the ouput mode. Valid values are TIMER_OUTPUTMODE_OUTBITVALUE, TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_TOGGLE_RESET, TIMER_OUTPUTMODE_SET_RESET TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_TOGGLE_SET, TIMER_OUTPUTMODE_RESET_SET
dutyCyclespecifies the dutycycle for the generated waveform

Modified registers are TAxCTL, TAxCCR0, TAxCCTL0,TAxCCTLn

Returns:
None

References ASSERT, HWREG, privateTimerProcessClockSourceDivider(), TIMER_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, TIMER_CAPTURECOMPARE_REGISTER_6, TIMER_CLOCKSOURCE_ACLK, TIMER_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_CLOCKSOURCE_SMCLK, TIMER_DO_CLEAR, TIMER_OUTPUTMODE_OUTBITVALUE, TIMER_OUTPUTMODE_RESET, TIMER_OUTPUTMODE_RESET_SET, TIMER_OUTPUTMODE_SET, TIMER_OUTPUTMODE_SET_RESET, TIMER_OUTPUTMODE_TOGGLE, TIMER_OUTPUTMODE_TOGGLE_RESET, TIMER_OUTPUTMODE_TOGGLE_SET, TIMER_TAIE_INTERRUPT_ENABLE, TIMER_UP_MODE, and TIMER_UPDOWN_MODE.

void Timer_stop ( unsigned int  baseAddress)

Stops the timer

Parameters:
baseAddressis the base address of the Timer module.

Modified registers are TAxCTL

Returns:
None

References HWREG.

unsigned int Timer_getCaptureCompareCount ( unsigned int  baseAddress,
unsigned int  captureCompareRegister 
)

Get current capturecompare count

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
Returns:
current count as unsigned int

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, and TIMER_CAPTURECOMPARE_REGISTER_6.

void Timer_setCompareValue ( unsigned int  baseAddress,
unsigned int  compareRegister,
unsigned int  compareValue 
)

Sets the value of the capture-compare register

Parameters:
baseAddressis the base address of the Timer module.
captureRegisterselects the Capture register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used
compareValueis the count to be compared with in compare mode

Modified register is TAxCCRn

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, and TIMER_CAPTURECOMPARE_REGISTER_6.

void Timer_clearCaptureCompareInterruptFlag ( unsigned int  baseAddress,
unsigned int  captureCompareRegister 
)

Clears the capture-compare interrupt flag

Parameters:
baseAddressis the base address of the Timer module.
captureCompareRegisterselects the Capture-compare register being used. Valid values are TIMER_CAPTURECOMPARE_REGISTER_0 TIMER_CAPTURECOMPARE_REGISTER_1 TIMER_CAPTURECOMPARE_REGISTER_2 TIMER_CAPTURECOMPARE_REGISTER_3 TIMER_CAPTURECOMPARE_REGISTER_4 TIMER_CAPTURECOMPARE_REGISTER_5 TIMER_CAPTURECOMPARE_REGISTER_6 Refer datasheet to ensure the device has the capture compare register being used

Modified bits are CCIFG of TAxCCTLn register

Returns:
None

References ASSERT, HWREG, TIMER_CAPTURECOMPARE_REGISTER_0, TIMER_CAPTURECOMPARE_REGISTER_1, TIMER_CAPTURECOMPARE_REGISTER_2, TIMER_CAPTURECOMPARE_REGISTER_3, TIMER_CAPTURECOMPARE_REGISTER_4, TIMER_CAPTURECOMPARE_REGISTER_5, and TIMER_CAPTURECOMPARE_REGISTER_6.

void Timer_clearTimerInterruptFlag ( unsigned int  baseAddress)

Clears the Timer TAIFG interrupt flag

Parameters:
baseAddressis the base address of the Timer module.

Modified bits are TAIFG og TAxCTL register

Returns:
None

References HWREGB.


Copyright 2012, Texas Instruments Incorporated