MSP430 DriverLib for MSP430F5xx_6xx Devices  2.91.13.01
timer_d

Functions

void Timer_D_startCounter (uint16_t baseAddress, uint16_t timerMode)
 Starts Timer_D counter. More...
 
void Timer_D_initContinuousMode (uint16_t baseAddress, Timer_D_initContinuousModeParam *param)
 Configures timer in continuous mode. More...
 
void Timer_D_initUpMode (uint16_t baseAddress, Timer_D_initUpModeParam *param)
 Configures timer in up mode. More...
 
void Timer_D_initUpDownMode (uint16_t baseAddress, Timer_D_initUpDownModeParam *param)
 Configures timer in up down mode. More...
 
void Timer_D_initCaptureMode (uint16_t baseAddress, Timer_D_initCaptureModeParam *param)
 Initializes Capture Mode. More...
 
void Timer_D_initCompareMode (uint16_t baseAddress, Timer_D_initCompareModeParam *param)
 Initializes Compare Mode. More...
 
void Timer_D_enableTimerInterrupt (uint16_t baseAddress)
 Enable timer interrupt. More...
 
void Timer_D_enableHighResInterrupt (uint16_t baseAddress, uint16_t mask)
 Enable High Resolution interrupt. More...
 
void Timer_D_disableTimerInterrupt (uint16_t baseAddress)
 Disable timer interrupt. More...
 
void Timer_D_disableHighResInterrupt (uint16_t baseAddress, uint16_t mask)
 Disable High Resolution interrupt. More...
 
uint32_t Timer_D_getTimerInterruptStatus (uint16_t baseAddress)
 Get timer interrupt status. More...
 
void Timer_D_enableCaptureCompareInterrupt (uint16_t baseAddress, uint16_t captureCompareRegister)
 Enable capture compare interrupt. More...
 
void Timer_D_disableCaptureCompareInterrupt (uint16_t baseAddress, uint16_t captureCompareRegister)
 Disable capture compare interrupt. More...
 
uint32_t Timer_D_getCaptureCompareInterruptStatus (uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t mask)
 Return capture compare interrupt status. More...
 
uint16_t Timer_D_getHighResInterruptStatus (uint16_t baseAddress, uint16_t mask)
 Returns High Resolution interrupt status. More...
 
void Timer_D_clear (uint16_t baseAddress)
 Reset/Clear the timer clock divider, count direction, count. More...
 
void Timer_D_clearHighResInterrupt (uint16_t baseAddress, uint16_t mask)
 Clears High Resolution interrupt status. More...
 
uint8_t Timer_D_getSynchronizedCaptureCompareInput (uint16_t baseAddress, uint16_t captureCompareRegister, uint16_t synchronized)
 Get synchronized capturecompare input. More...
 
uint8_t Timer_D_getOutputForOutputModeOutBitValue (uint16_t baseAddress, uint16_t captureCompareRegister)
 Get output bit for output mode. More...
 
uint16_t Timer_D_getCaptureCompareCount (uint16_t baseAddress, uint16_t captureCompareRegister)
 Get current capturecompare count. More...
 
uint16_t Timer_D_getCaptureCompareLatchCount (uint16_t baseAddress, uint16_t captureCompareRegister)
 Get current capture compare latch register count. More...
 
uint8_t Timer_D_getCaptureCompareInputSignal (uint16_t baseAddress, uint16_t captureCompareRegister)
 Get current capturecompare input signal. More...
 
void Timer_D_setOutputForOutputModeOutBitValue (uint16_t baseAddress, uint16_t captureCompareRegister, uint8_t outputModeOutBitValue)
 Set output bit for output mode. More...
 
void Timer_D_outputPWM (uint16_t baseAddress, Timer_D_outputPWMParam *param)
 Generate a PWM with timer running in up mode. More...
 
void Timer_D_stop (uint16_t baseAddress)
 Stops the timer. More...
 
void Timer_D_setCompareValue (uint16_t baseAddress, uint16_t compareRegister, uint16_t compareValue)
 Sets the value of the capture-compare register. More...
 
void Timer_D_clearTimerInterrupt (uint16_t baseAddress)
 Clears the Timer TDIFG interrupt flag. More...
 
void Timer_D_clearCaptureCompareInterrupt (uint16_t baseAddress, uint16_t captureCompareRegister)
 Clears the capture-compare interrupt flag. More...
 
uint8_t Timer_D_initHighResGeneratorInFreeRunningMode (uint16_t baseAddress, uint8_t desiredHighResFrequency)
 Configures Timer_D in free running mode. More...
 
void Timer_D_initHighResGeneratorInRegulatedMode (uint16_t baseAddress, Timer_D_initHighResGeneratorInRegulatedModeParam *param)
 Configures Timer_D in Regulated mode. More...
 
void Timer_D_combineTDCCRToOutputPWM (uint16_t baseAddress, Timer_D_combineTDCCRToOutputPWMParam *param)
 Combine TDCCR to get PWM. More...
 
void Timer_D_selectLatchingGroup (uint16_t baseAddress, uint16_t groupLatch)
 Selects Timer_D Latching Group. More...
 
void Timer_D_selectCounterLength (uint16_t baseAddress, uint16_t counterLength)
 Selects Timer_D counter length. More...
 
void Timer_D_initCompareLatchLoadEvent (uint16_t baseAddress, uint16_t compareRegister, uint16_t compareLatchLoadEvent)
 Selects Compare Latch Load Event. More...
 
void Timer_D_disableHighResFastWakeup (uint16_t baseAddress)
 Disable High Resolution fast wakeup. More...
 
void Timer_D_enableHighResFastWakeup (uint16_t baseAddress)
 Enable High Resolution fast wakeup. More...
 
void Timer_D_disableHighResClockEnhancedAccuracy (uint16_t baseAddress)
 Disable High Resolution Clock Enhanced Accuracy. More...
 
void Timer_D_enableHighResClockEnhancedAccuracy (uint16_t baseAddress)
 Enable High Resolution Clock Enhanced Accuracy. More...
 
void Timer_D_disableHighResGeneratorForceON (uint16_t baseAddress)
 Disable High Resolution Clock Enhanced Accuracy. More...
 
void Timer_D_enableHighResGeneratorForceON (uint16_t baseAddress)
 Enable High Resolution Clock Enhanced Accuracy. More...
 
void Timer_D_selectHighResCoarseClockRange (uint16_t baseAddress, uint16_t highResCoarseClockRange)
 Select High Resolution Coarse Clock Range. More...
 
void Timer_D_selectHighResClockRange (uint16_t baseAddress, uint16_t highResClockRange)
 Select High Resolution Clock Range Selection. More...
 
uint16_t Timer_D_getCounterValue (uint16_t baseAddress)
 Reads the current timer count value. More...
 
void Timer_D_setOutputMode (uint16_t baseAddress, uint16_t compareRegister, uint16_t compareOutputMode)
 Sets the output mode. More...
 

Detailed Description

Function Documentation

§ Timer_D_clear()

void Timer_D_clear ( uint16_t  baseAddress)

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

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits of TDxCTL0 register.

Returns
None

§ Timer_D_clearCaptureCompareInterrupt()

void Timer_D_clearCaptureCompareInterrupt ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Clears the capture-compare interrupt flag.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture-compare register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6

Modified bits are CCIFG of TDxCCTLn register.

Returns
None

References Timer_D_initHighResGeneratorInFreeRunningMode().

§ Timer_D_clearHighResInterrupt()

void Timer_D_clearHighResInterrupt ( uint16_t  baseAddress,
uint16_t  mask 
)

Clears High Resolution interrupt status.

Parameters
baseAddressis the base address of the TIMER_D module.
maskis the mask for the interrupts to clear Mask value is the logical OR of any of the following:
  • TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
  • TIMER_D_HIGH_RES_FREQUENCY_LOCK
  • TIMER_D_HIGH_RES_FAIL_HIGH
  • TIMER_D_HIGH_RES_FAIL_LOW

Modified bits of TDxHINT register.

Returns
None

References Timer_D_getSynchronizedCaptureCompareInput().

§ Timer_D_clearTimerInterrupt()

void Timer_D_clearTimerInterrupt ( uint16_t  baseAddress)

Clears the Timer TDIFG interrupt flag.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDIFG of TDxCTL0 register.

Returns
None

§ Timer_D_combineTDCCRToOutputPWM()

void Timer_D_combineTDCCRToOutputPWM ( uint16_t  baseAddress,
Timer_D_combineTDCCRToOutputPWMParam param 
)

Combine TDCCR to get PWM.

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for PWM generation using two CCRs.

Modified bits of TDxCCTLn register, bits of TDxCCR0 register, bits of TDxCCTL0 register, bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_combineTDCCRToOutputPWMParam::clockingMode, Timer_D_combineTDCCRToOutputPWMParam::clockSource, Timer_D_combineTDCCRToOutputPWMParam::clockSourceDivider, Timer_D_combineTDCCRToOutputPWMParam::combineCCRRegistersCombination, Timer_D_combineTDCCRToOutputPWMParam::compareOutputMode, Timer_D_combineTDCCRToOutputPWMParam::dutyCycle1, Timer_D_combineTDCCRToOutputPWMParam::dutyCycle2, and Timer_D_combineTDCCRToOutputPWMParam::timerPeriod.

§ Timer_D_disableCaptureCompareInterrupt()

void Timer_D_disableCaptureCompareInterrupt ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Disable capture compare interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisteris the selected capture compare register Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6

Modified bits of TDxCCTLn register.

Returns
None

§ Timer_D_disableHighResClockEnhancedAccuracy()

void Timer_D_disableHighResClockEnhancedAccuracy ( uint16_t  baseAddress)

Disable High Resolution Clock Enhanced Accuracy.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHEAEN of TDxHCTL0 register.

Returns
None

§ Timer_D_disableHighResFastWakeup()

void Timer_D_disableHighResFastWakeup ( uint16_t  baseAddress)

Disable High Resolution fast wakeup.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHFW of TDxHCTL0 register.

Returns
None

§ Timer_D_disableHighResGeneratorForceON()

void Timer_D_disableHighResGeneratorForceON ( uint16_t  baseAddress)

Disable High Resolution Clock Enhanced Accuracy.

High-resolution generator is on if the Timer_D counter

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHRON of TDxHCTL0 register.

Returns
None

§ Timer_D_disableHighResInterrupt()

void Timer_D_disableHighResInterrupt ( uint16_t  baseAddress,
uint16_t  mask 
)

Disable High Resolution interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.
maskis the mask of interrupts to disable Mask value is the logical OR of any of the following:
  • TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
  • TIMER_D_HIGH_RES_FREQUENCY_LOCK
  • TIMER_D_HIGH_RES_FAIL_HIGH
  • TIMER_D_HIGH_RES_FAIL_LOW

Modified bits of TDxHINT register.

Returns
None

§ Timer_D_disableTimerInterrupt()

void Timer_D_disableTimerInterrupt ( uint16_t  baseAddress)

Disable timer interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits of TDxCTL0 register.

Returns
None

§ Timer_D_enableCaptureCompareInterrupt()

void Timer_D_enableCaptureCompareInterrupt ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Enable capture compare interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisteris the selected capture compare register Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6

Modified bits of TDxCCTLn register.

Returns
None

§ Timer_D_enableHighResClockEnhancedAccuracy()

void Timer_D_enableHighResClockEnhancedAccuracy ( uint16_t  baseAddress)

Enable High Resolution Clock Enhanced Accuracy.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHEAEN of TDxHCTL0 register.

Returns
None

§ Timer_D_enableHighResFastWakeup()

void Timer_D_enableHighResFastWakeup ( uint16_t  baseAddress)

Enable High Resolution fast wakeup.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHFW of TDxHCTL0 register.

Returns
None

§ Timer_D_enableHighResGeneratorForceON()

void Timer_D_enableHighResGeneratorForceON ( uint16_t  baseAddress)

Enable High Resolution Clock Enhanced Accuracy.

High-resolution generator is on in all Timer_D MCx modes. The PMM remains in high-current mode.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits are TDHRON of TDxHCTL0 register.

Returns
None

§ Timer_D_enableHighResInterrupt()

void Timer_D_enableHighResInterrupt ( uint16_t  baseAddress,
uint16_t  mask 
)

Enable High Resolution interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.
maskis the mask of interrupts to enable Mask value is the logical OR of any of the following:
  • TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
  • TIMER_D_HIGH_RES_FREQUENCY_LOCK
  • TIMER_D_HIGH_RES_FAIL_HIGH
  • TIMER_D_HIGH_RES_FAIL_LOW

Modified bits of TDxHINT register.

Returns
None

§ Timer_D_enableTimerInterrupt()

void Timer_D_enableTimerInterrupt ( uint16_t  baseAddress)

Enable timer interrupt.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits of TDxCTL0 register.

Returns
None

§ Timer_D_getCaptureCompareCount()

uint16_t Timer_D_getCaptureCompareCount ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Get current capturecompare count.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
Returns
current count as uint16_t

References Timer_D_getCaptureCompareLatchCount().

Referenced by Timer_D_getOutputForOutputModeOutBitValue().

§ Timer_D_getCaptureCompareInputSignal()

uint8_t Timer_D_getCaptureCompareInputSignal ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Get current capturecompare input signal.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
Returns
One of the following:
  • TIMER_D_CAPTURECOMPARE_INPUT
  • 0x00
    indicating the current input signal

References Timer_D_setOutputForOutputModeOutBitValue().

Referenced by Timer_D_getCaptureCompareLatchCount().

§ Timer_D_getCaptureCompareInterruptStatus()

uint32_t Timer_D_getCaptureCompareInterruptStatus ( uint16_t  baseAddress,
uint16_t  captureCompareRegister,
uint16_t  mask 
)

Return capture compare interrupt status.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisteris the selected capture compare register Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
maskis the mask for the interrupt status Mask value is the logical OR of any of the following:
  • TIMER_D_CAPTURE_OVERFLOW
  • TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG
Returns
Logical OR of any of the following:
  • TIMER_D_CAPTURE_OVERFLOW
  • TIMER_D_CAPTURECOMPARE_INTERRUPT_FLAG
    indicating the status of the masked flags

§ Timer_D_getCaptureCompareLatchCount()

uint16_t Timer_D_getCaptureCompareLatchCount ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Get current capture compare latch register count.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
Returns
current count as uint16_t

References Timer_D_getCaptureCompareInputSignal().

Referenced by Timer_D_getCaptureCompareCount().

§ Timer_D_getCounterValue()

uint16_t Timer_D_getCounterValue ( uint16_t  baseAddress)

Reads the current timer count value.

Reads the current count value of the timer. There is a majority vote system in place to confirm an accurate value is returned. The Timer_D_THRESHOLD #define in the corresponding header file can be modified so that the votes must be closer together for a consensus to occur.

Parameters
baseAddressis the base address of the TIMER_D module.
Returns
Majority vote of timer count value

§ Timer_D_getHighResInterruptStatus()

uint16_t Timer_D_getHighResInterruptStatus ( uint16_t  baseAddress,
uint16_t  mask 
)

Returns High Resolution interrupt status.

Parameters
baseAddressis the base address of the TIMER_D module.
maskis the mask for the interrupt status Mask value is the logical OR of any of the following:
  • TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
  • TIMER_D_HIGH_RES_FREQUENCY_LOCK
  • TIMER_D_HIGH_RES_FAIL_HIGH
  • TIMER_D_HIGH_RES_FAIL_LOW

Modified bits of TDxHINT register.

Returns
Logical OR of any of the following:
  • TIMER_D_HIGH_RES_FREQUENCY_UNLOCK
  • TIMER_D_HIGH_RES_FREQUENCY_LOCK
  • TIMER_D_HIGH_RES_FAIL_HIGH
  • TIMER_D_HIGH_RES_FAIL_LOW
    indicating the status of the masked interrupts

§ Timer_D_getOutputForOutputModeOutBitValue()

uint8_t Timer_D_getOutputForOutputModeOutBitValue ( uint16_t  baseAddress,
uint16_t  captureCompareRegister 
)

Get output bit for output mode.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
Returns
One of the following:
  • TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH
  • TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW

References Timer_D_getCaptureCompareCount().

Referenced by Timer_D_getSynchronizedCaptureCompareInput().

§ Timer_D_getSynchronizedCaptureCompareInput()

uint8_t Timer_D_getSynchronizedCaptureCompareInput ( uint16_t  baseAddress,
uint16_t  captureCompareRegister,
uint16_t  synchronized 
)

Get synchronized capturecompare input.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
synchronizedis to select type of capture compare input. Valid values are:
  • TIMER_D_READ_SYNCHRONIZED_CAPTURECOMPAREINPUT
  • TIMER_D_READ_CAPTURE_COMPARE_INPUT
Returns
One of the following:
  • TIMER_D_CAPTURECOMPARE_INPUT_HIGH
  • TIMER_D_CAPTURECOMPARE_INPUT_LOW

References Timer_D_getOutputForOutputModeOutBitValue().

Referenced by Timer_D_clearHighResInterrupt().

§ Timer_D_getTimerInterruptStatus()

uint32_t Timer_D_getTimerInterruptStatus ( uint16_t  baseAddress)

Get timer interrupt status.

Parameters
baseAddressis the base address of the TIMER_D module.
Returns
One of the following:
  • TIMER_D_INTERRUPT_NOT_PENDING
  • TIMER_D_INTERRUPT_PENDING
    indicating the timer interrupt status

§ Timer_D_initCaptureMode()

void Timer_D_initCaptureMode ( uint16_t  baseAddress,
Timer_D_initCaptureModeParam param 
)

Initializes Capture Mode.

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for capture mode initialization.

Modified bits of TDxCCTLn register and bits of TDxCTL2 register.

Returns
None

References Timer_D_initCaptureModeParam::captureInputSelect, Timer_D_initCaptureModeParam::captureInterruptEnable, Timer_D_initCaptureModeParam::captureMode, Timer_D_initCaptureModeParam::captureOutputMode, Timer_D_initCaptureModeParam::captureRegister, Timer_D_initCaptureModeParam::channelCaptureMode, and Timer_D_initCaptureModeParam::synchronizeCaptureSource.

§ Timer_D_initCompareLatchLoadEvent()

void Timer_D_initCompareLatchLoadEvent ( uint16_t  baseAddress,
uint16_t  compareRegister,
uint16_t  compareLatchLoadEvent 
)

Selects Compare Latch Load Event.

Parameters
baseAddressis the base address of the TIMER_D module.
compareRegisterselects the compare register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
compareLatchLoadEventselects the latch load event Valid values are:
  • TIMER_D_LATCH_ON_WRITE_TO_TDxCCRn_COMPARE_REGISTER [Default]
  • TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UP_OR_CONT_MODE
  • TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_0_IN_UPDOWN_MODE
  • TIMER_D_LATCH_WHEN_COUNTER_COUNTS_TO_CURRENT_COMPARE_LATCH_VALUE

Modified bits are CLLD of TDxCCTLn register.

Returns
None

§ Timer_D_initCompareMode()

void Timer_D_initCompareMode ( uint16_t  baseAddress,
Timer_D_initCompareModeParam param 
)

Initializes Compare Mode.

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for compare mode initialization.

Modified bits of TDxCCTLn register and bits of TDxCCRn register.

Returns
None

References Timer_D_initCompareModeParam::compareInterruptEnable, Timer_D_initCompareModeParam::compareOutputMode, Timer_D_initCompareModeParam::compareRegister, and Timer_D_initCompareModeParam::compareValue.

§ Timer_D_initContinuousMode()

void Timer_D_initContinuousMode ( uint16_t  baseAddress,
Timer_D_initContinuousModeParam param 
)

Configures timer in continuous mode.

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

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for continuous mode initialization.

Modified bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_initContinuousModeParam::clockingMode, Timer_D_initContinuousModeParam::clockSource, Timer_D_initContinuousModeParam::clockSourceDivider, Timer_D_initContinuousModeParam::timerClear, and Timer_D_initContinuousModeParam::timerInterruptEnable_TDIE.

§ Timer_D_initHighResGeneratorInFreeRunningMode()

uint8_t Timer_D_initHighResGeneratorInFreeRunningMode ( uint16_t  baseAddress,
uint8_t  desiredHighResFrequency 
)

Configures Timer_D in free running mode.

Parameters
baseAddressis the base address of the TIMER_D module.
desiredHighResFrequencyselects the desired High Resolution frequency used. Valid values are:
  • TIMER_D_HIGHRES_64MHZ
  • TIMER_D_HIGHRES_128MHZ
  • TIMER_D_HIGHRES_200MHZ
  • TIMER_D_HIGHRES_256MHZ

Modified bits of TDxHCTL1 register, bits of TDxHCTL0 register and bits of TDxCTL1 register.

Returns
STATUS_SUCCESS or STATUS_FAIL

References TLV_getInfo().

Referenced by Timer_D_clearCaptureCompareInterrupt().

§ Timer_D_initHighResGeneratorInRegulatedMode()

void Timer_D_initHighResGeneratorInRegulatedMode ( uint16_t  baseAddress,
Timer_D_initHighResGeneratorInRegulatedModeParam param 
)

Configures Timer_D in Regulated mode.

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for high resolution generator in regulated mode.

Modified bits of TDxHCTL0 register, bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_initHighResGeneratorInRegulatedModeParam::clockingMode, Timer_D_initHighResGeneratorInRegulatedModeParam::clockSource, Timer_D_initHighResGeneratorInRegulatedModeParam::clockSourceDivider, Timer_D_initHighResGeneratorInRegulatedModeParam::highResClockDivider, and Timer_D_initHighResGeneratorInRegulatedModeParam::highResClockMultiplyFactor.

§ Timer_D_initUpDownMode()

void Timer_D_initUpDownMode ( uint16_t  baseAddress,
Timer_D_initUpDownModeParam param 
)

Configures timer in up down mode.

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

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for up-down mode initialization.

Modified bits of TDxCCR0 register, bits of TDxCCTL0 register, bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_initUpDownModeParam::captureCompareInterruptEnable_CCR0_CCIE, Timer_D_initUpDownModeParam::clockingMode, Timer_D_initUpDownModeParam::clockSource, Timer_D_initUpDownModeParam::clockSourceDivider, Timer_D_initUpDownModeParam::timerClear, Timer_D_initUpDownModeParam::timerInterruptEnable_TDIE, and Timer_D_initUpDownModeParam::timerPeriod.

§ Timer_D_initUpMode()

void Timer_D_initUpMode ( uint16_t  baseAddress,
Timer_D_initUpModeParam param 
)

Configures timer in up mode.

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

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for up mode initialization.

Modified bits of TDxCCR0 register, bits of TDxCCTL0 register, bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_initUpModeParam::captureCompareInterruptEnable_CCR0_CCIE, Timer_D_initUpModeParam::clockingMode, Timer_D_initUpModeParam::clockSource, Timer_D_initUpModeParam::clockSourceDivider, Timer_D_initUpModeParam::timerClear, Timer_D_initUpModeParam::timerInterruptEnable_TDIE, and Timer_D_initUpModeParam::timerPeriod.

§ Timer_D_outputPWM()

void Timer_D_outputPWM ( uint16_t  baseAddress,
Timer_D_outputPWMParam param 
)

Generate a PWM with timer running in up mode.

Parameters
baseAddressis the base address of the TIMER_D module.
paramis the pointer to struct for PWM configuration.

Modified bits of TDxCCTLn register, bits of TDxCCR0 register, bits of TDxCCTL0 register, bits of TDxCTL0 register and bits of TDxCTL1 register.

Returns
None

References Timer_D_outputPWMParam::clockingMode, Timer_D_outputPWMParam::clockSource, Timer_D_outputPWMParam::clockSourceDivider, Timer_D_outputPWMParam::compareOutputMode, Timer_D_outputPWMParam::compareRegister, Timer_D_outputPWMParam::dutyCycle, and Timer_D_outputPWMParam::timerPeriod.

§ Timer_D_selectCounterLength()

void Timer_D_selectCounterLength ( uint16_t  baseAddress,
uint16_t  counterLength 
)

Selects Timer_D counter length.

Parameters
baseAddressis the base address of the TIMER_D module.
counterLengthselects the value of counter length. Valid values are:
  • TIMER_D_COUNTER_16BIT [Default]
  • TIMER_D_COUNTER_12BIT
  • TIMER_D_COUNTER_10BIT
  • TIMER_D_COUNTER_8BIT

Modified bits are CNTL of TDxCTL0 register.

Returns
None

§ Timer_D_selectHighResClockRange()

void Timer_D_selectHighResClockRange ( uint16_t  baseAddress,
uint16_t  highResClockRange 
)

Select High Resolution Clock Range Selection.

Parameters
baseAddressis the base address of the TIMER_D module.
highResClockRangeselects the High Resolution Clock Range. Refer to datasheet for frequency details Valid values are:
  • TIMER_D_CLOCK_RANGE0 [Default]
  • TIMER_D_CLOCK_RANGE1
  • TIMER_D_CLOCK_RANGE2
Returns
None

§ Timer_D_selectHighResCoarseClockRange()

void Timer_D_selectHighResCoarseClockRange ( uint16_t  baseAddress,
uint16_t  highResCoarseClockRange 
)

Select High Resolution Coarse Clock Range.

Parameters
baseAddressis the base address of the TIMER_D module.
highResCoarseClockRangeselects the High Resolution Coarse Clock Range Valid values are:
  • TIMER_D_HIGHRES_BELOW_15MHz [Default]
  • TIMER_D_HIGHRES_ABOVE_15MHz

Modified bits are TDHCLKCR of TDxHCTL1 register.

Returns
None

§ Timer_D_selectLatchingGroup()

void Timer_D_selectLatchingGroup ( uint16_t  baseAddress,
uint16_t  groupLatch 
)

Selects Timer_D Latching Group.

Parameters
baseAddressis the base address of the TIMER_D module.
groupLatchselects the group latch Valid values are:
  • TIMER_D_GROUP_NONE [Default]
  • TIMER_D_GROUP_CL12_CL23_CL56
  • TIMER_D_GROUP_CL123_CL456
  • TIMER_D_GROUP_ALL

Modified bits are TDCLGRP of TDxCTL0 register.

Returns
None

§ Timer_D_setCompareValue()

void Timer_D_setCompareValue ( uint16_t  baseAddress,
uint16_t  compareRegister,
uint16_t  compareValue 
)

Sets the value of the capture-compare register.

Parameters
baseAddressis the base address of the TIMER_D module.
compareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
compareValueis the count to be compared with in compare mode

Modified bits of TDxCCRn register.

Returns
None

§ Timer_D_setOutputForOutputModeOutBitValue()

void Timer_D_setOutputForOutputModeOutBitValue ( uint16_t  baseAddress,
uint16_t  captureCompareRegister,
uint8_t  outputModeOutBitValue 
)

Set output bit for output mode.

Parameters
baseAddressis the base address of the TIMER_D module.
captureCompareRegisterselects the Capture register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
outputModeOutBitValuethe value to be set for out bit Valid values are:
  • TIMER_D_OUTPUTMODE_OUTBITVALUE_HIGH
  • TIMER_D_OUTPUTMODE_OUTBITVALUE_LOW

Modified bits of TDxCCTLn register.

Returns
None

Referenced by Timer_D_getCaptureCompareInputSignal().

§ Timer_D_setOutputMode()

void Timer_D_setOutputMode ( uint16_t  baseAddress,
uint16_t  compareRegister,
uint16_t  compareOutputMode 
)

Sets the output mode.

Sets the output mode for the timer even the timer is already running.

Parameters
baseAddressis the base address of the TIMER_D module.
compareRegisterselects the compare register being used. Valid values are:
  • TIMER_D_CAPTURECOMPARE_REGISTER_0
  • TIMER_D_CAPTURECOMPARE_REGISTER_1
  • TIMER_D_CAPTURECOMPARE_REGISTER_2
  • TIMER_D_CAPTURECOMPARE_REGISTER_3
  • TIMER_D_CAPTURECOMPARE_REGISTER_4
  • TIMER_D_CAPTURECOMPARE_REGISTER_5
  • TIMER_D_CAPTURECOMPARE_REGISTER_6
compareOutputModespecifies the output mode. Valid values are:
  • TIMER_D_OUTPUTMODE_OUTBITVALUE [Default]
  • TIMER_D_OUTPUTMODE_SET
  • TIMER_D_OUTPUTMODE_TOGGLE_RESET
  • TIMER_D_OUTPUTMODE_SET_RESET
  • TIMER_D_OUTPUTMODE_TOGGLE
  • TIMER_D_OUTPUTMODE_RESET
  • TIMER_D_OUTPUTMODE_TOGGLE_SET
  • TIMER_D_OUTPUTMODE_RESET_SET

Modified bits are OUTMOD of TDxCCTLn register.

Returns
None

§ Timer_D_startCounter()

void Timer_D_startCounter ( uint16_t  baseAddress,
uint16_t  timerMode 
)

Starts Timer_D counter.

NOTE: This function assumes that the timer has been previously configured using Timer_D_initContinuousMode, Timer_D_initUpMode or Timer_D_initUpDownMode.

Parameters
baseAddressis the base address of the TIMER_DA module.
timerModeselects the mode of the timer Valid values are:
  • TIMER_D_STOP_MODE
  • TIMER_D_UP_MODE
  • TIMER_D_CONTINUOUS_MODE [Default]
  • TIMER_D_UPDOWN_MODE

Modified bits of TDxCTL0 register.

Returns
None

§ Timer_D_stop()

void Timer_D_stop ( uint16_t  baseAddress)

Stops the timer.

Parameters
baseAddressis the base address of the TIMER_D module.

Modified bits of TDxCTL0 register.

Returns
None

Copyright 2020, Texas Instruments Incorporated