Data Structures | Macros | Typedefs | Functions
Timera_api

Data Structures

struct  _Timer_A_ContinuousModeConfig
 Configuration structure for continuous mode in the Timer_A module. See Timer_A_configureContinuousMode for parameter documentation. More...
 
struct  _Timer_A_UpModeConfig
 Configuration structure for Up mode in the Timer_A module. See Timer_A_configureUpMode for parameter documentation. More...
 
struct  _Timer_A_UpDownModeConfig
 Configuration structure for UpDown mode in the Timer_A module. See Timer_A_configureUpDownMode for parameter documentation. More...
 
struct  _Timer_A_CaptureModeConfig
 Configuration structure for capture mode in the Timer_A module. See Timer_A_initCapture for parameter documentation. More...
 
struct  _Timer_A_CompareModeConfig
 Configuration structure for compare mode in the Timer_A module. See Timer_A_initCompare for parameter documentation. More...
 
struct  _Timer_A_PWMConfig
 Configuration structure for PWM mode in the Timer_A module. See Timer_A_generatePWM for parameter documentation. More...
 

Macros

#define TIMER_A_CMSIS(x)   ((TIMER_A0_Type *) x)
 
#define TIMER_A_CCR0_INTERRUPT   0x00
 
#define TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT   0x01
 
#define TIMER_A_THRESHOLD   50
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_1   0x01
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_2   0x02
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_4   0x04
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_8   0x08
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_3   0x03
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_5   0x05
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_6   0x06
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_7   0x07
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_10   0x0A
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_12   0x0C
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_14   0x0E
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_16   0x10
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_20   0x14
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_24   0x18
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_28   0x1C
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_32   0x20
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_40   0x28
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_48   0x30
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_56   0x38
 
#define TIMER_A_CLOCKSOURCE_DIVIDER_64   0x40
 
#define TIMER_A_STOP_MODE   MC_0
 
#define TIMER_A_UP_MODE   MC_1
 
#define TIMER_A_CONTINUOUS_MODE   MC_2
 
#define TIMER_A_UPDOWN_MODE   MC_3
 
#define TIMER_A_DO_CLEAR   TACLR
 
#define TIMER_A_SKIP_CLEAR   0x00
 
#define TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK   TASSEL__TACLK
 
#define TIMER_A_CLOCKSOURCE_ACLK   TASSEL__ACLK
 
#define TIMER_A_CLOCKSOURCE_SMCLK   TASSEL__SMCLK
 
#define TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK   TASSEL__INCLK
 
#define TIMER_A_TAIE_INTERRUPT_ENABLE   TAIE
 
#define TIMER_A_TAIE_INTERRUPT_DISABLE   0x00
 
#define TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE   CCIE
 
#define TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE   0x00
 
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE   0x00
 
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE   CCIE
 
#define TIMER_A_CAPTURE_INPUTSELECT_CCIxA   CCIS_0
 
#define TIMER_A_CAPTURE_INPUTSELECT_CCIxB   CCIS_1
 
#define TIMER_A_CAPTURE_INPUTSELECT_GND   CCIS_2
 
#define TIMER_A_CAPTURE_INPUTSELECT_Vcc   CCIS_3
 
#define TIMER_A_OUTPUTMODE_OUTBITVALUE   OUTMOD_0
 
#define TIMER_A_OUTPUTMODE_SET   OUTMOD_1
 
#define TIMER_A_OUTPUTMODE_TOGGLE_RESET   OUTMOD_2
 
#define TIMER_A_OUTPUTMODE_SET_RESET   OUTMOD_3
 
#define TIMER_A_OUTPUTMODE_TOGGLE   OUTMOD_4
 
#define TIMER_A_OUTPUTMODE_RESET   OUTMOD_5
 
#define TIMER_A_OUTPUTMODE_TOGGLE_SET   OUTMOD_6
 
#define TIMER_A_OUTPUTMODE_RESET_SET   OUTMOD_7
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_0   0x02
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_1   0x04
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_2   0x06
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_3   0x08
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_4   0x0A
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_5   0x0C
 
#define TIMER_A_CAPTURECOMPARE_REGISTER_6   0x0E
 
#define TIMER_A_CAPTUREMODE_NO_CAPTURE   CM_0
 
#define TIMER_A_CAPTUREMODE_RISING_EDGE   CM_1
 
#define TIMER_A_CAPTUREMODE_FALLING_EDGE   CM_2
 
#define TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE   CM_3
 
#define TIMER_A_CAPTURE_ASYNCHRONOUS   0x00
 
#define TIMER_A_CAPTURE_SYNCHRONOUS   SCS
 
#define TIMER_A_CAPTURE_OVERFLOW   COV
 
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG   CCIFG
 
#define TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT   SCCI
 
#define TIMER_A_READ_CAPTURE_COMPARE_INPUT   CCI
 
#define TIMER_A_CAPTURECOMPARE_INPUT_HIGH   0x01
 
#define TIMER_A_CAPTURECOMPARE_INPUT_LOW   0x00
 
#define TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH   OUT
 
#define TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW   0x00
 
#define TIMER_A_INTERRUPT_NOT_PENDING   0x00
 
#define TIMER_A_INTERRUPT_PENDING   0x01
 
#define Timer_A_setDutyCycle(timer, dutyCycle)   Timer_A_setCompareValue(timer,dutyCycle)
 
#define TIMER_A_startCounter   Timer_A_startCounter
 
#define TIMER_A_clearTimerInterruptFlag   Timer_A_clearInterruptFlag
 
#define TIMER_A_clearCaptureCompareInterruptFlag   Timer_A_clearCaptureCompareInterrupt
 
#define TIMER_A_getCounterValue   Timer_A_getCounterValue
 
#define TIMER_A_setCompareValue   Timer_A_setCompareValue
 
#define TIMER_A_stop   Timer_A_stopTimer
 
#define TIMER_A_setOutputForOutputModeOutBitValue   Timer_A_setOutputForOutputModeOutBitValue
 
#define TIMER_A_enableInterrupt   Timer_A_enableInterrupt
 
#define TIMER_A_disableInterrupt   Timer_A_disableInterrupt
 
#define TIMER_A_getInterruptStatus   Timer_A_getInterruptStatus
 
#define TIMER_A_enableCaptureCompareInterrupt   Timer_A_enableCaptureCompareInterrupt
 
#define TIMER_A_disableCaptureCompareInterrupt   Timer_A_disableCaptureCompareInterrupt
 
#define TIMER_A_getCaptureCompareInterruptStatus   Timer_A_getCaptureCompareInterruptStatus
 
#define TIMER_A_clear   Timer_A_clearTimer
 
#define TIMER_A_getSynchronizedCaptureCompareInput   Timer_A_getSynchronizedCaptureCompareInput
 
#define TIMER_A_getCaptureCompareCount   Timer_A_getCaptureCompareCount
 

Typedefs

typedef struct
_Timer_A_ContinuousModeConfig 
Timer_A_ContinuousModeConfig
 Type definition for _Timer_A_ContinuousModeConfig structure. More...
 
typedef struct
_Timer_A_UpModeConfig 
Timer_A_UpModeConfig
 Type definition for _Timer_A_UpModeConfig structure. More...
 
typedef struct
_Timer_A_UpDownModeConfig 
Timer_A_UpDownModeConfig
 Type definition for _Timer_A_UpDownModeConfig structure. More...
 
typedef struct
_Timer_A_CaptureModeConfig 
Timer_A_CaptureModeConfig
 Type definition for _Timer_A_CaptureModeConfig structure. More...
 
typedef struct
_Timer_A_CompareModeConfig 
Timer_A_CompareModeConfig
 Type definition for _Timer_A_CompareModeConfig structure. More...
 
typedef struct _Timer_A_PWMConfig Timer_A_PWMConfig
 Type definition for _Timer_A_PWMConfig structure. More...
 

Functions

void Timer_A_startCounter (uint32_t timer, uint_fast16_t timerMode)
 
void Timer_A_configureContinuousMode (uint32_t timer, const Timer_A_ContinuousModeConfig *config)
 
void Timer_A_configureUpMode (uint32_t timer, const Timer_A_UpModeConfig *config)
 
void Timer_A_configureUpDownMode (uint32_t timer, const Timer_A_UpDownModeConfig *config)
 
void Timer_A_initCapture (uint32_t timer, const Timer_A_CaptureModeConfig *config)
 
void Timer_A_initCompare (uint32_t timer, const Timer_A_CompareModeConfig *config)
 
void Timer_A_clearTimer (uint32_t timer)
 
uint_fast8_t Timer_A_getSynchronizedCaptureCompareInput (uint32_t timer, uint_fast16_t captureCompareRegister, uint_fast16_t synchronizedSetting)
 
uint_fast8_t Timer_A_getOutputForOutputModeOutBitValue (uint32_t timer, uint_fast16_t captureCompareRegister)
 
uint_fast16_t Timer_A_getCaptureCompareCount (uint32_t timer, uint_fast16_t captureCompareRegister)
 
void Timer_A_setOutputForOutputModeOutBitValue (uint32_t timer, uint_fast16_t captureCompareRegister, uint_fast8_t outputModeOutBitValue)
 
void Timer_A_generatePWM (uint32_t timer, const Timer_A_PWMConfig *config)
 
void Timer_A_stopTimer (uint32_t timer)
 
void Timer_A_setCompareValue (uint32_t timer, uint_fast16_t compareRegister, uint_fast16_t compareValue)
 
uint16_t Timer_A_getCounterValue (uint32_t timer)
 
void Timer_A_clearInterruptFlag (uint32_t timer)
 
void Timer_A_clearCaptureCompareInterrupt (uint32_t timer, uint_fast16_t captureCompareRegister)
 
void Timer_A_enableInterrupt (uint32_t timer)
 
void Timer_A_disableInterrupt (uint32_t timer)
 
uint32_t Timer_A_getInterruptStatus (uint32_t timer)
 
uint32_t Timer_A_getEnabledInterruptStatus (uint32_t timer)
 
void Timer_A_enableCaptureCompareInterrupt (uint32_t timer, uint_fast16_t captureCompareRegister)
 
void Timer_A_disableCaptureCompareInterrupt (uint32_t timer, uint_fast16_t captureCompareRegister)
 
uint32_t Timer_A_getCaptureCompareInterruptStatus (uint32_t timer, uint_fast16_t captureCompareRegister, uint_fast16_t mask)
 
uint32_t Timer_A_getCaptureCompareEnabledInterruptStatus (uint32_t timer, uint_fast16_t captureCompareRegister)
 
void Timer_A_registerInterrupt (uint32_t timer, uint_fast8_t interruptSelect, void(*intHandler)(void))
 
void Timer_A_unregisterInterrupt (uint32_t timer, uint_fast8_t interruptSelect)
 

Detailed Description

Macro Definition Documentation

#define TIMER_A_CMSIS (   x)    ((TIMER_A0_Type *) x)
#define TIMER_A_CCR0_INTERRUPT   0x00
#define TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT   0x01
#define TIMER_A_THRESHOLD   50

Referenced by Timer_A_getCounterValue().

#define TIMER_A_CLOCKSOURCE_DIVIDER_1   0x01
#define TIMER_A_CLOCKSOURCE_DIVIDER_2   0x02
#define TIMER_A_CLOCKSOURCE_DIVIDER_4   0x04
#define TIMER_A_CLOCKSOURCE_DIVIDER_8   0x08
#define TIMER_A_CLOCKSOURCE_DIVIDER_3   0x03
#define TIMER_A_CLOCKSOURCE_DIVIDER_5   0x05
#define TIMER_A_CLOCKSOURCE_DIVIDER_6   0x06
#define TIMER_A_CLOCKSOURCE_DIVIDER_7   0x07
#define TIMER_A_CLOCKSOURCE_DIVIDER_10   0x0A
#define TIMER_A_CLOCKSOURCE_DIVIDER_12   0x0C
#define TIMER_A_CLOCKSOURCE_DIVIDER_14   0x0E
#define TIMER_A_CLOCKSOURCE_DIVIDER_16   0x10
#define TIMER_A_CLOCKSOURCE_DIVIDER_20   0x14
#define TIMER_A_CLOCKSOURCE_DIVIDER_24   0x18
#define TIMER_A_CLOCKSOURCE_DIVIDER_28   0x1C
#define TIMER_A_CLOCKSOURCE_DIVIDER_32   0x20
#define TIMER_A_CLOCKSOURCE_DIVIDER_40   0x28
#define TIMER_A_CLOCKSOURCE_DIVIDER_48   0x30
#define TIMER_A_CLOCKSOURCE_DIVIDER_56   0x38
#define TIMER_A_CLOCKSOURCE_DIVIDER_64   0x40
#define TIMER_A_STOP_MODE   MC_0
#define TIMER_A_UP_MODE   MC_1
#define TIMER_A_CONTINUOUS_MODE   MC_2

Referenced by Timer_A_startCounter().

#define TIMER_A_UPDOWN_MODE   MC_3
#define TIMER_A_DO_CLEAR   TACLR
#define TIMER_A_SKIP_CLEAR   0x00
#define TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK   TASSEL__TACLK
#define TIMER_A_CLOCKSOURCE_ACLK   TASSEL__ACLK
#define TIMER_A_CLOCKSOURCE_SMCLK   TASSEL__SMCLK
#define TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK   TASSEL__INCLK
#define TIMER_A_TAIE_INTERRUPT_ENABLE   TAIE
#define TIMER_A_TAIE_INTERRUPT_DISABLE   0x00
#define TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE   CCIE
#define TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE   0x00
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE   0x00
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE   CCIE
#define TIMER_A_CAPTURE_INPUTSELECT_CCIxA   CCIS_0

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_INPUTSELECT_CCIxB   CCIS_1

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_INPUTSELECT_GND   CCIS_2

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_INPUTSELECT_Vcc   CCIS_3

Referenced by Timer_A_initCapture().

#define TIMER_A_OUTPUTMODE_OUTBITVALUE   OUTMOD_0
#define TIMER_A_OUTPUTMODE_SET   OUTMOD_1
#define TIMER_A_OUTPUTMODE_TOGGLE_RESET   OUTMOD_2
#define TIMER_A_OUTPUTMODE_SET_RESET   OUTMOD_3
#define TIMER_A_OUTPUTMODE_TOGGLE   OUTMOD_4
#define TIMER_A_OUTPUTMODE_RESET   OUTMOD_5
#define TIMER_A_OUTPUTMODE_TOGGLE_SET   OUTMOD_6
#define TIMER_A_OUTPUTMODE_RESET_SET   OUTMOD_7
#define TIMER_A_CAPTURECOMPARE_REGISTER_0   0x02
#define TIMER_A_CAPTURECOMPARE_REGISTER_1   0x04
#define TIMER_A_CAPTURECOMPARE_REGISTER_2   0x06
#define TIMER_A_CAPTURECOMPARE_REGISTER_3   0x08
#define TIMER_A_CAPTURECOMPARE_REGISTER_4   0x0A
#define TIMER_A_CAPTURECOMPARE_REGISTER_5   0x0C
#define TIMER_A_CAPTURECOMPARE_REGISTER_6   0x0E
#define TIMER_A_CAPTUREMODE_NO_CAPTURE   CM_0

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTUREMODE_RISING_EDGE   CM_1

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTUREMODE_FALLING_EDGE   CM_2

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE   CM_3

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_ASYNCHRONOUS   0x00

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_SYNCHRONOUS   SCS

Referenced by Timer_A_initCapture().

#define TIMER_A_CAPTURE_OVERFLOW   COV
#define TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG   CCIFG
#define TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT   SCCI
#define TIMER_A_READ_CAPTURE_COMPARE_INPUT   CCI
#define TIMER_A_CAPTURECOMPARE_INPUT_HIGH   0x01
#define TIMER_A_CAPTURECOMPARE_INPUT_LOW   0x00
#define TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH   OUT
#define TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW   0x00
#define TIMER_A_INTERRUPT_NOT_PENDING   0x00
#define TIMER_A_INTERRUPT_PENDING   0x01
#define Timer_A_setDutyCycle (   timer,
  dutyCycle 
)    Timer_A_setCompareValue(timer,dutyCycle)
#define TIMER_A_startCounter   Timer_A_startCounter
#define TIMER_A_clearTimerInterruptFlag   Timer_A_clearInterruptFlag
#define TIMER_A_clearCaptureCompareInterruptFlag   Timer_A_clearCaptureCompareInterrupt
#define TIMER_A_getCounterValue   Timer_A_getCounterValue
#define TIMER_A_setCompareValue   Timer_A_setCompareValue
#define TIMER_A_stop   Timer_A_stopTimer
#define TIMER_A_setOutputForOutputModeOutBitValue   Timer_A_setOutputForOutputModeOutBitValue
#define TIMER_A_enableInterrupt   Timer_A_enableInterrupt
#define TIMER_A_disableInterrupt   Timer_A_disableInterrupt
#define TIMER_A_getInterruptStatus   Timer_A_getInterruptStatus
#define TIMER_A_enableCaptureCompareInterrupt   Timer_A_enableCaptureCompareInterrupt
#define TIMER_A_disableCaptureCompareInterrupt   Timer_A_disableCaptureCompareInterrupt
#define TIMER_A_getCaptureCompareInterruptStatus   Timer_A_getCaptureCompareInterruptStatus
#define TIMER_A_clear   Timer_A_clearTimer
#define TIMER_A_getSynchronizedCaptureCompareInput   Timer_A_getSynchronizedCaptureCompareInput
#define TIMER_A_getCaptureCompareCount   Timer_A_getCaptureCompareCount

Typedef Documentation

Type definition for _Timer_A_ContinuousModeConfig structure.

Type definition for _Timer_A_UpModeConfig structure.

Type definition for _Timer_A_UpDownModeConfig structure.

Type definition for _Timer_A_CaptureModeConfig structure.

Type definition for _Timer_A_CompareModeConfig structure.

Type definition for _Timer_A_PWMConfig structure.

Function Documentation

void Timer_A_startCounter ( uint32_t  timer,
uint_fast16_t  timerMode 
)

Starts Timer_A counter

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
timerModeselects Clock source. Valid values are
  • TIMER_A_CONTINUOUS_MODE [Default value]
  • TIMER_A_UPDOWN_MODE
  • TIMER_A_UP_MODE
Note
This function assumes that the timer has been previously configured using Timer_A_configureContinuousMode, Timer_A_configureUpMode or Timer_A_configureUpDownMode.
Returns
None

References ASSERT, TIMER_A_CMSIS, TIMER_A_CONTINUOUS_MODE, TIMER_A_UP_MODE, and TIMER_A_UPDOWN_MODE.

void Timer_A_configureContinuousMode ( uint32_t  timer,
const Timer_A_ContinuousModeConfig config 
)

Configures Timer_A in continuous mode.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A continuous mode

Configuration options for Timer_A_ContinuousModeConfig structure.


Parameters
clockSourceselects Clock source. Valid values are
  • TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default value]
  • TIMER_A_CLOCKSOURCE_ACLK
  • TIMER_A_CLOCKSOURCE_SMCLK
  • TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
timerInterruptEnable_TAIEis the divider for Clock source. Valid values are:
  • TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default value]
  • TIMER_A_CLOCKSOURCE_DIVIDER_2
  • TIMER_A_CLOCKSOURCE_DIVIDER_4
  • TIMER_A_CLOCKSOURCE_DIVIDER_8
  • TIMER_A_CLOCKSOURCE_DIVIDER_3
  • TIMER_A_CLOCKSOURCE_DIVIDER_5
  • TIMER_A_CLOCKSOURCE_DIVIDER_6
  • TIMER_A_CLOCKSOURCE_DIVIDER_7
  • TIMER_A_CLOCKSOURCE_DIVIDER_10
  • TIMER_A_CLOCKSOURCE_DIVIDER_12
  • TIMER_A_CLOCKSOURCE_DIVIDER_14
  • TIMER_A_CLOCKSOURCE_DIVIDER_16
  • TIMER_A_CLOCKSOURCE_DIVIDER_20
  • TIMER_A_CLOCKSOURCE_DIVIDER_24
  • TIMER_A_CLOCKSOURCE_DIVIDER_28
  • TIMER_A_CLOCKSOURCE_DIVIDER_32
  • TIMER_A_CLOCKSOURCE_DIVIDER_40
  • TIMER_A_CLOCKSOURCE_DIVIDER_48
  • TIMER_A_CLOCKSOURCE_DIVIDER_56
  • TIMER_A_CLOCKSOURCE_DIVIDER_64
timerInterruptEnable_TAIEis to enable or disable Timer_A interrupt. Valid values are
  • TIMER_A_TAIE_INTERRUPT_ENABLE
  • TIMER_A_TAIE_INTERRUPT_DISABLE [Default value]
timerCleardecides if Timer_A clock divider, count direction, count need to be reset. Valid values are
  • TIMER_A_DO_CLEAR
  • TIMER_A_SKIP_CLEAR [Default value]
Note
This API does not start the timer. Timer needs to be started when required using the Timer_A_startCounter API.
Returns
None

References ASSERT, _Timer_A_ContinuousModeConfig::clockSource, _Timer_A_ContinuousModeConfig::clockSourceDivider, TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_DIVIDER_1, TIMER_A_CLOCKSOURCE_DIVIDER_10, TIMER_A_CLOCKSOURCE_DIVIDER_12, TIMER_A_CLOCKSOURCE_DIVIDER_14, TIMER_A_CLOCKSOURCE_DIVIDER_16, TIMER_A_CLOCKSOURCE_DIVIDER_2, TIMER_A_CLOCKSOURCE_DIVIDER_20, TIMER_A_CLOCKSOURCE_DIVIDER_24, TIMER_A_CLOCKSOURCE_DIVIDER_28, TIMER_A_CLOCKSOURCE_DIVIDER_3, TIMER_A_CLOCKSOURCE_DIVIDER_32, TIMER_A_CLOCKSOURCE_DIVIDER_4, TIMER_A_CLOCKSOURCE_DIVIDER_40, TIMER_A_CLOCKSOURCE_DIVIDER_48, TIMER_A_CLOCKSOURCE_DIVIDER_5, TIMER_A_CLOCKSOURCE_DIVIDER_56, TIMER_A_CLOCKSOURCE_DIVIDER_6, TIMER_A_CLOCKSOURCE_DIVIDER_64, TIMER_A_CLOCKSOURCE_DIVIDER_7, TIMER_A_CLOCKSOURCE_DIVIDER_8, TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CMSIS, TIMER_A_DO_CLEAR, TIMER_A_SKIP_CLEAR, TIMER_A_TAIE_INTERRUPT_DISABLE, TIMER_A_TAIE_INTERRUPT_ENABLE, TIMER_A_UPDOWN_MODE, _Timer_A_ContinuousModeConfig::timerClear, and _Timer_A_ContinuousModeConfig::timerInterruptEnable_TAIE.

void Timer_A_configureUpMode ( uint32_t  timer,
const Timer_A_UpModeConfig config 
)

Configures Timer_A in up mode.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A Up mode

Configuration options for Timer_A_UpModeConfig structure.


Parameters
clockSourceselects Clock source. Valid values are
  • TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default value]
  • TIMER_A_CLOCKSOURCE_ACLK
  • TIMER_A_CLOCKSOURCE_SMCLK
  • TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are:
  • TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default value]
  • TIMER_A_CLOCKSOURCE_DIVIDER_2
  • TIMER_A_CLOCKSOURCE_DIVIDER_4
  • TIMER_A_CLOCKSOURCE_DIVIDER_8
  • TIMER_A_CLOCKSOURCE_DIVIDER_3
  • TIMER_A_CLOCKSOURCE_DIVIDER_5
  • TIMER_A_CLOCKSOURCE_DIVIDER_6
  • TIMER_A_CLOCKSOURCE_DIVIDER_7
  • TIMER_A_CLOCKSOURCE_DIVIDER_10
  • TIMER_A_CLOCKSOURCE_DIVIDER_12
  • TIMER_A_CLOCKSOURCE_DIVIDER_14
  • TIMER_A_CLOCKSOURCE_DIVIDER_16
  • TIMER_A_CLOCKSOURCE_DIVIDER_20
  • TIMER_A_CLOCKSOURCE_DIVIDER_24
  • TIMER_A_CLOCKSOURCE_DIVIDER_28
  • TIMER_A_CLOCKSOURCE_DIVIDER_32
  • TIMER_A_CLOCKSOURCE_DIVIDER_40
  • TIMER_A_CLOCKSOURCE_DIVIDER_48
  • TIMER_A_CLOCKSOURCE_DIVIDER_56
  • TIMER_A_CLOCKSOURCE_DIVIDER_64
timerPeriodis the specified Timer_A period. This is the value that gets written into the CCR0. Limited to 16 bits[uint16_t]
timerInterruptEnable_TAIEis to enable or disable Timer_A interrupt. Valid values are:
  • TIMER_A_TAIE_INTERRUPT_ENABLE and
  • TIMER_A_TAIE_INTERRUPT_DISABLE [Default value]
captureCompareInterruptEnable_CCR0_CCIEis to enable or disable Timer_A CCR0 captureComapre interrupt. Valid values are
  • TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE and
  • TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE [Default value]
timerCleardecides if Timer_A clock divider, count direction, count need to be reset. Valid values are
  • TIMER_A_DO_CLEAR
  • TIMER_A_SKIP_CLEAR [Default value]
Note
This API does not start the timer. Timer needs to be started when required using the Timer_A_startCounter API.
Returns
None

References ASSERT, _Timer_A_UpModeConfig::captureCompareInterruptEnable_CCR0_CCIE, _Timer_A_UpModeConfig::clockSource, _Timer_A_UpModeConfig::clockSourceDivider, TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CMSIS, TIMER_A_DO_CLEAR, TIMER_A_SKIP_CLEAR, TIMER_A_TAIE_INTERRUPT_ENABLE, TIMER_A_UPDOWN_MODE, _Timer_A_UpModeConfig::timerClear, _Timer_A_UpModeConfig::timerInterruptEnable_TAIE, and _Timer_A_UpModeConfig::timerPeriod.

void Timer_A_configureUpDownMode ( uint32_t  timer,
const Timer_A_UpDownModeConfig config 
)

Configures Timer_A in up down mode.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A UpDown mode

Configuration options for Timer_A_UpDownModeConfig structure.


Parameters
clockSourceselects Clock source. Valid values are
  • TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK [Default value]
  • TIMER_A_CLOCKSOURCE_ACLK
  • TIMER_A_CLOCKSOURCE_SMCLK
  • TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are:
  • TIMER_A_CLOCKSOURCE_DIVIDER_1 [Default value]
  • TIMER_A_CLOCKSOURCE_DIVIDER_2
  • TIMER_A_CLOCKSOURCE_DIVIDER_4
  • TIMER_A_CLOCKSOURCE_DIVIDER_8
  • TIMER_A_CLOCKSOURCE_DIVIDER_3
  • TIMER_A_CLOCKSOURCE_DIVIDER_5
  • TIMER_A_CLOCKSOURCE_DIVIDER_6
  • TIMER_A_CLOCKSOURCE_DIVIDER_7
  • TIMER_A_CLOCKSOURCE_DIVIDER_10
  • TIMER_A_CLOCKSOURCE_DIVIDER_12
  • TIMER_A_CLOCKSOURCE_DIVIDER_14
  • TIMER_A_CLOCKSOURCE_DIVIDER_16
  • TIMER_A_CLOCKSOURCE_DIVIDER_20
  • TIMER_A_CLOCKSOURCE_DIVIDER_24
  • TIMER_A_CLOCKSOURCE_DIVIDER_28
  • TIMER_A_CLOCKSOURCE_DIVIDER_32
  • TIMER_A_CLOCKSOURCE_DIVIDER_40
  • TIMER_A_CLOCKSOURCE_DIVIDER_48
  • TIMER_A_CLOCKSOURCE_DIVIDER_56
  • TIMER_A_CLOCKSOURCE_DIVIDER_64
timerPeriodis the specified Timer_A period
timerInterruptEnable_TAIEis to enable or disable Timer_A interrupt. Valid values are
  • TIMER_A_TAIE_INTERRUPT_ENABLE
  • TIMER_A_TAIE_INTERRUPT_DISABLE [Default value]
captureCompareInterruptEnable_CCR0_CCIEis to enable or disable Timer_A CCR0 captureComapre interrupt. Valid values are
  • TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE and
  • TIMER_A_CCIE_CCR0_INTERRUPT_DISABLE [Default value]
timerCleardecides if Timer_A clock divider, count direction, count need to be reset. Valid values are
  • TIMER_A_DO_CLEAR
  • TIMER_A_SKIP_CLEAR [Default value]

This API does not start the timer. Timer needs to be started when required using the Timer_A_startCounter API.

Returns
None

References ASSERT, _Timer_A_UpDownModeConfig::captureCompareInterruptEnable_CCR0_CCIE, _Timer_A_UpDownModeConfig::clockSource, _Timer_A_UpDownModeConfig::clockSourceDivider, TIMER_A_CCIE_CCR0_INTERRUPT_ENABLE, TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CMSIS, TIMER_A_DO_CLEAR, TIMER_A_SKIP_CLEAR, TIMER_A_STOP_MODE, TIMER_A_TAIE_INTERRUPT_ENABLE, TIMER_A_UPDOWN_MODE, _Timer_A_UpDownModeConfig::timerClear, _Timer_A_UpDownModeConfig::timerInterruptEnable_TAIE, and _Timer_A_UpDownModeConfig::timerPeriod.

void Timer_A_initCapture ( uint32_t  timer,
const Timer_A_CaptureModeConfig config 
)

Initializes Capture Mode

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A capture mode

Configuration options for Timer_A_CaptureModeConfig structure.


Parameters
captureRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
captureModeis the capture mode selected. Valid values are
  • TIMER_A_CAPTUREMODE_NO_CAPTURE [Default value]
  • TIMER_A_CAPTUREMODE_RISING_EDGE
  • TIMER_A_CAPTUREMODE_FALLING_EDGE
  • TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE
captureInputSelectdecides the Input Select
  • TIMER_A_CAPTURE_INPUTSELECT_CCIxA [Default value]
  • TIMER_A_CAPTURE_INPUTSELECT_CCIxB
  • TIMER_A_CAPTURE_INPUTSELECT_GND
  • TIMER_A_CAPTURE_INPUTSELECT_Vcc
synchronizeCaptureSourcedecides if capture source should be synchronized with timer clock Valid values are
  • TIMER_A_CAPTURE_ASYNCHRONOUS [Default value]
  • TIMER_A_CAPTURE_SYNCHRONOUS
captureInterruptEnableis to enable or disable timer captureComapre interrupt. Valid values are
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE [Default value]
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE
captureOutputModespecifies the ouput mode. Valid values are
  • TIMER_A_OUTPUTMODE_OUTBITVALUE [Default value],
  • TIMER_A_OUTPUTMODE_SET,
  • TIMER_A_OUTPUTMODE_TOGGLE_RESET,
  • TIMER_A_OUTPUTMODE_SET_RESET
  • TIMER_A_OUTPUTMODE_TOGGLE,
  • TIMER_A_OUTPUTMODE_RESET,
  • TIMER_A_OUTPUTMODE_TOGGLE_SET,
  • TIMER_A_OUTPUTMODE_RESET_SET
Returns
None

References ASSERT, _Timer_A_CaptureModeConfig::captureInputSelect, _Timer_A_CaptureModeConfig::captureInterruptEnable, _Timer_A_CaptureModeConfig::captureMode, _Timer_A_CaptureModeConfig::captureOutputMode, _Timer_A_CaptureModeConfig::captureRegister, _Timer_A_CaptureModeConfig::synchronizeCaptureSource, TIMER_A_CAPTURE_ASYNCHRONOUS, TIMER_A_CAPTURE_INPUTSELECT_CCIxA, TIMER_A_CAPTURE_INPUTSELECT_CCIxB, TIMER_A_CAPTURE_INPUTSELECT_GND, TIMER_A_CAPTURE_INPUTSELECT_Vcc, TIMER_A_CAPTURE_SYNCHRONOUS, TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE, TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, TIMER_A_CAPTURECOMPARE_REGISTER_6, TIMER_A_CAPTUREMODE_FALLING_EDGE, TIMER_A_CAPTUREMODE_NO_CAPTURE, TIMER_A_CAPTUREMODE_RISING_AND_FALLING_EDGE, TIMER_A_CAPTUREMODE_RISING_EDGE, TIMER_A_DO_CLEAR, TIMER_A_OUTPUTMODE_OUTBITVALUE, TIMER_A_OUTPUTMODE_RESET, TIMER_A_OUTPUTMODE_RESET_SET, TIMER_A_OUTPUTMODE_SET, TIMER_A_OUTPUTMODE_SET_RESET, TIMER_A_OUTPUTMODE_TOGGLE, TIMER_A_OUTPUTMODE_TOGGLE_RESET, TIMER_A_OUTPUTMODE_TOGGLE_SET, and TIMER_A_TAIE_INTERRUPT_ENABLE.

void Timer_A_initCompare ( uint32_t  timer,
const Timer_A_CompareModeConfig config 
)

Initializes Compare Mode

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A compare mode

Configuration options for Timer_A_CompareModeConfig structure.


Parameters
compareRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
compareInterruptEnableis to enable or disable timer captureComapre interrupt. Valid values are
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE and
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE [Default value]
compareOutputModespecifies the output mode. Valid values are
  • TIMER_A_OUTPUTMODE_OUTBITVALUE [Default value],
  • TIMER_A_OUTPUTMODE_SET,
  • TIMER_A_OUTPUTMODE_TOGGLE_RESET,
  • TIMER_A_OUTPUTMODE_SET_RESET
  • TIMER_A_OUTPUTMODE_TOGGLE,
  • TIMER_A_OUTPUTMODE_RESET,
  • TIMER_A_OUTPUTMODE_TOGGLE_SET,
  • TIMER_A_OUTPUTMODE_RESET_SET
compareValueis the count to be compared with in compare mode
Returns
None

References ASSERT, _Timer_A_CompareModeConfig::compareInterruptEnable, _Timer_A_CompareModeConfig::compareOutputMode, _Timer_A_CompareModeConfig::compareRegister, _Timer_A_CompareModeConfig::compareValue, OFS_TAxR, TIMER_A_CAPTURECOMPARE_INTERRUPT_DISABLE, TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, TIMER_A_CAPTURECOMPARE_REGISTER_6, TIMER_A_OUTPUTMODE_OUTBITVALUE, TIMER_A_OUTPUTMODE_RESET, TIMER_A_OUTPUTMODE_RESET_SET, TIMER_A_OUTPUTMODE_SET, TIMER_A_OUTPUTMODE_SET_RESET, TIMER_A_OUTPUTMODE_TOGGLE, TIMER_A_OUTPUTMODE_TOGGLE_RESET, and TIMER_A_OUTPUTMODE_TOGGLE_SET.

void Timer_A_clearTimer ( uint32_t  timer)

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

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
None

References TIMER_A_CMSIS.

uint_fast8_t Timer_A_getSynchronizedCaptureCompareInput ( uint32_t  timer,
uint_fast16_t  captureCompareRegister,
uint_fast16_t  synchronizedSetting 
)

Get synchronized capture compare input

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
synchronizedSettingis to select type of capture compare input. Valid values are
  • TIMER_A_READ_CAPTURE_COMPARE_INPUT
  • TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
Returns
TIMER_A_CAPTURECOMPARE_INPUT_HIGH or
  • TIMER_A_CAPTURECOMPARE_INPUT_LOW

References ASSERT, TIMER_A_CAPTURECOMPARE_INPUT_HIGH, TIMER_A_CAPTURECOMPARE_INPUT_LOW, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, TIMER_A_CAPTURECOMPARE_REGISTER_6, TIMER_A_READ_CAPTURE_COMPARE_INPUT, and TIMER_A_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT.

uint_fast8_t Timer_A_getOutputForOutputModeOutBitValue ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Get ouput bit for output mode

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
Returns
TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH or
  • TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW

References ASSERT, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, TIMER_A_CAPTURECOMPARE_REGISTER_6, TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH, and TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW.

uint_fast16_t Timer_A_getCaptureCompareCount ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Get current capture compare count

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
Returns
current count as uint16_t

References ASSERT, OFS_TAxR, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, and TIMER_A_CAPTURECOMPARE_REGISTER_6.

void Timer_A_setOutputForOutputModeOutBitValue ( uint32_t  timer,
uint_fast16_t  captureCompareRegister,
uint_fast8_t  outputModeOutBitValue 
)

Set ouput bit for output mode

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisterselects the Capture register being used. are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to datasheet to ensure the device has the capture compare register being used
outputModeOutBitValuethe value to be set for out bit. Valid values are:
  • TIMER_A_OUTPUTMODE_OUTBITVALUE_HIGH
  • TIMER_A_OUTPUTMODE_OUTBITVALUE_LOW
Returns
None

References TIMER_A_setOutputForOutputModeOutBitValue.

void Timer_A_generatePWM ( uint32_t  timer,
const Timer_A_PWMConfig config 
)

Generate a PWM with timer running in up mode

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
configConfiguration structure for Timer_A PWM mode

Configuration options for Timer_A_PWMConfig structure.


Parameters
clockSourceselects Clock source. Valid values are
  • TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK
  • TIMER_A_CLOCKSOURCE_ACLK
  • TIMER_A_CLOCKSOURCE_SMCLK
  • TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK
clockSourceDivideris the divider for Clock source. Valid values are
  • TIMER_A_CLOCKSOURCE_DIVIDER_1
  • TIMER_A_CLOCKSOURCE_DIVIDER_2
  • TIMER_A_CLOCKSOURCE_DIVIDER_4
  • TIMER_A_CLOCKSOURCE_DIVIDER_8
  • TIMER_A_CLOCKSOURCE_DIVIDER_3
  • TIMER_A_CLOCKSOURCE_DIVIDER_5
  • TIMER_A_CLOCKSOURCE_DIVIDER_6
  • TIMER_A_CLOCKSOURCE_DIVIDER_7
  • TIMER_A_CLOCKSOURCE_DIVIDER_10
  • TIMER_A_CLOCKSOURCE_DIVIDER_12
  • TIMER_A_CLOCKSOURCE_DIVIDER_14
  • TIMER_A_CLOCKSOURCE_DIVIDER_16
  • TIMER_A_CLOCKSOURCE_DIVIDER_20
  • TIMER_A_CLOCKSOURCE_DIVIDER_24
  • TIMER_A_CLOCKSOURCE_DIVIDER_28
  • TIMER_A_CLOCKSOURCE_DIVIDER_32
  • TIMER_A_CLOCKSOURCE_DIVIDER_40
  • TIMER_A_CLOCKSOURCE_DIVIDER_48
  • TIMER_A_CLOCKSOURCE_DIVIDER_56
  • TIMER_A_CLOCKSOURCE_DIVIDER_64
timerPeriodselects the desired timer period
compareRegisterselects the compare register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6

    Refer to datasheet to ensure the device has the capture compare register being used
compareOutputModespecifies the ouput mode. Valid values are:
  • TIMER_A_OUTPUTMODE_OUTBITVALUE,
  • TIMER_A_OUTPUTMODE_SET,
  • TIMER_A_OUTPUTMODE_TOGGLE_RESET,
  • TIMER_A_OUTPUTMODE_SET_RESET
  • TIMER_A_OUTPUTMODE_TOGGLE,
  • TIMER_A_OUTPUTMODE_RESET,
  • TIMER_A_OUTPUTMODE_TOGGLE_SET,
  • TIMER_A_OUTPUTMODE_RESET_SET
dutyCyclespecifies the dutycycle for the generated waveform
Returns
None

References ASSERT, _Timer_A_PWMConfig::clockSource, _Timer_A_PWMConfig::clockSourceDivider, _Timer_A_PWMConfig::compareOutputMode, _Timer_A_PWMConfig::compareRegister, _Timer_A_PWMConfig::dutyCycle, OFS_TAxCCTL0, OFS_TAxR, TIMER_A_CAPTURECOMPARE_INTERRUPT_ENABLE, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, TIMER_A_CAPTURECOMPARE_REGISTER_6, TIMER_A_CLOCKSOURCE_ACLK, TIMER_A_CLOCKSOURCE_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_INVERTED_EXTERNAL_TXCLK, TIMER_A_CLOCKSOURCE_SMCLK, TIMER_A_CMSIS, TIMER_A_DO_CLEAR, TIMER_A_OUTPUTMODE_OUTBITVALUE, TIMER_A_OUTPUTMODE_RESET, TIMER_A_OUTPUTMODE_RESET_SET, TIMER_A_OUTPUTMODE_SET, TIMER_A_OUTPUTMODE_SET_RESET, TIMER_A_OUTPUTMODE_TOGGLE, TIMER_A_OUTPUTMODE_TOGGLE_RESET, TIMER_A_OUTPUTMODE_TOGGLE_SET, TIMER_A_TAIE_INTERRUPT_ENABLE, TIMER_A_UP_MODE, TIMER_A_UPDOWN_MODE, and _Timer_A_PWMConfig::timerPeriod.

void Timer_A_stopTimer ( uint32_t  timer)

Stops the timer

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
None

References TIMER_A_CMSIS.

void Timer_A_setCompareValue ( uint32_t  timer,
uint_fast16_t  compareRegister,
uint_fast16_t  compareValue 
)

Sets the value of the capture-compare register

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
compareRegisterselects the Capture register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6

    Refer to datasheet to ensure the device has the capture compare register being used
compareValueis the count to be compared with in compare mode
Returns
None

References ASSERT, OFS_TAxR, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, and TIMER_A_CAPTURECOMPARE_REGISTER_6.

uint16_t Timer_A_getCounterValue ( uint32_t  timer)

Returns the current value of the specified timer. Note that according to the Timer A user guide, reading the value of the counter is unreliable if the system clock is asynchronous from the timer clock. The API addresses this concern by reading the timer count register twice and then determining the integrity of the value. If the two values are within 10 timer counts of each other, the value is deemed safe and returned. If not, the process is repeated until a reliable timer value is determined.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
The value of the specified timer

References TIMER_A_CMSIS, and TIMER_A_THRESHOLD.

void Timer_A_clearInterruptFlag ( uint32_t  timer)

Clears the Timer TAIFG interrupt flag

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
None

References TIMER_A_CMSIS.

void Timer_A_clearCaptureCompareInterrupt ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Clears the capture-compare interrupt flag

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisterselects the Capture-compare register being used. Valid values are
  • TIMER_A_CAPTURECOMPARE_REGISTER_0
  • TIMER_A_CAPTURECOMPARE_REGISTER_1
  • TIMER_A_CAPTURECOMPARE_REGISTER_2
  • TIMER_A_CAPTURECOMPARE_REGISTER_3
  • TIMER_A_CAPTURECOMPARE_REGISTER_4
  • TIMER_A_CAPTURECOMPARE_REGISTER_5
  • TIMER_A_CAPTURECOMPARE_REGISTER_6
    Refer to the datasheet to ensure the device has the capture compare register being used
Returns
None

References ASSERT, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, and TIMER_A_CAPTURECOMPARE_REGISTER_6.

void Timer_A_enableInterrupt ( uint32_t  timer)

Enable timer interrupt

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
None

References TIMER_A_CMSIS.

void Timer_A_disableInterrupt ( uint32_t  timer)

Disable timer interrupt

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
None

References TIMER_A_CMSIS.

uint32_t Timer_A_getInterruptStatus ( uint32_t  timer)

Get timer interrupt status

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
uint32_t. Return interrupt status. Valid values are
  • TIMER_A_INTERRUPT_PENDING
  • TIMER_A_INTERRUPT_NOT_PENDING

References TIMER_A_CMSIS.

Referenced by Timer_A_getEnabledInterruptStatus().

uint32_t Timer_A_getEnabledInterruptStatus ( uint32_t  timer)

Get timer interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
Returns
uint32_t. Return interrupt status. Valid values are
  • TIMER_A_INTERRUPT_PENDING
  • TIMER_A_INTERRUPT_NOT_PENDING

References TIMER_A_CMSIS, and Timer_A_getInterruptStatus().

void Timer_A_enableCaptureCompareInterrupt ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Enable capture compare interrupt

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisteris the selected capture compare register
Returns
None

References ASSERT, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, and TIMER_A_CAPTURECOMPARE_REGISTER_6.

void Timer_A_disableCaptureCompareInterrupt ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Disable capture compare interrupt

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisteris the selected capture compare register
Returns
None

References ASSERT, TIMER_A_CAPTURECOMPARE_REGISTER_0, TIMER_A_CAPTURECOMPARE_REGISTER_1, TIMER_A_CAPTURECOMPARE_REGISTER_2, TIMER_A_CAPTURECOMPARE_REGISTER_3, TIMER_A_CAPTURECOMPARE_REGISTER_4, TIMER_A_CAPTURECOMPARE_REGISTER_5, and TIMER_A_CAPTURECOMPARE_REGISTER_6.

uint32_t Timer_A_getCaptureCompareInterruptStatus ( uint32_t  timer,
uint_fast16_t  captureCompareRegister,
uint_fast16_t  mask 
)

Return capture compare interrupt status

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisteris the selected capture compare register
maskis the mask for the interrupt status Mask value is the logical OR of any of the following:
  • TIMER_A_CAPTURE_OVERFLOW
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG
Returns
uint32_t. The mask of the set flags. Valid values is an OR of
  • TIMER_A_CAPTURE_OVERFLOW,
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG

Referenced by Timer_A_getCaptureCompareEnabledInterruptStatus().

uint32_t Timer_A_getCaptureCompareEnabledInterruptStatus ( uint32_t  timer,
uint_fast16_t  captureCompareRegister 
)

Return capture compare interrupt status masked with the enabled interrupts. This function is useful to call in ISRs to get a list of pending interrupts that are actually enabled and could have caused the ISR.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
captureCompareRegisteris the selected capture compare register
Returns
uint32_t. The mask of the set flags. Valid values is an OR of
  • TIMER_A_CAPTURE_OVERFLOW,
  • TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG

References TIMER_A_CAPTURE_OVERFLOW, TIMER_A_CAPTURECOMPARE_INTERRUPT_FLAG, and Timer_A_getCaptureCompareInterruptStatus().

void Timer_A_registerInterrupt ( uint32_t  timer,
uint_fast8_t  interruptSelect,
void(*)(void)  intHandler 
)

Registers an interrupt handler for the timer capture compare interrupt.

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
interruptSelectSelects which timer interrupt handler to register. For the timer module, there are two separate interrupt handlers that can be registered:
  • TIMER_A_CCR0_INTERRUPT Corresponds to the interrupt for CCR0
  • TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT Corresponds to the interrupt for CCR1-6, as well as the overflow interrupt.
intHandleris a pointer to the function to be called when the timer capture compare interrupt occurs.

This function registers the handler to be called when a timer interrupt occurs. This function enables the global interrupt in the interrupt controller; specific Timer_Ainterrupts must be enabled via Timer_A_enableInterrupt(). It is the interrupt handler's responsibility to clear the interrupt source via Timer_A_clearCaptureCompareInterrupt().

Returns
None.

References ASSERT, Interrupt_enableInterrupt(), Interrupt_registerInterrupt(), TIMER_A_CCR0_INTERRUPT, and TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT.

void Timer_A_unregisterInterrupt ( uint32_t  timer,
uint_fast8_t  interruptSelect 
)

Unregisters the interrupt handler for the timer

Parameters
timeris the instance of the Timer_A module. Valid parameters vary from part to part, but can include:
  • TIMER_A0_MODULE
  • TIMER_A1_MODULE
  • TIMER_A2_MODULE
  • TIMER_A3_MODULE
interruptSelectSelects which timer interrupt handler to register. For the timer module, there are two separate interrupt handlers that can be registered:
  • TIMER_A_CCR0_INTERRUPT Corresponds to the interrupt for CCR0
  • TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT Corresponds to the interrupt for CCR1-6, as well as the overflow interrupt.

This function unregisters the handler to be called when timer interrupt occurs. This function also masks off the interrupt in the interrupt controller so that the interrupt handler no longer is called.

See also
Interrupt_registerInterrupt() for important information about registering interrupt handlers.
Returns
None.

References ASSERT, Interrupt_disableInterrupt(), Interrupt_unregisterInterrupt(), TIMER_A_CCR0_INTERRUPT, and TIMER_A_CCRX_AND_OVERFLOW_INTERRUPT.


Copyright 2014, Texas Instruments Incorporated