Igor Skochinsky / Mbed 2 deprecated DriverLibrary

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

TIM_Public_Functions

TIM_Public_Functions
[TIM]

Functions

FlagStatus TIM_GetIntStatus (LPC_TIM_TypeDef *TIMx, uint8_t IntFlag)
 Get Interrupt Status.
FlagStatus TIM_GetIntCaptureStatus (LPC_TIM_TypeDef *TIMx, uint8_t IntFlag)
 Get Capture Interrupt Status.
void TIM_ClearIntPending (LPC_TIM_TypeDef *TIMx, uint8_t IntFlag)
 Clear Interrupt pending.
void TIM_ClearIntCapturePending (LPC_TIM_TypeDef *TIMx, uint8_t IntFlag)
 Clear Capture Interrupt pending.
void TIM_Cmd (LPC_TIM_TypeDef *TIMx, FunctionalState NewState)
 Start/Stop Timer/Counter device.
void TIM_ResetCounter (LPC_TIM_TypeDef *TIMx)
 Reset Timer/Counter device, Make TC and PC are synchronously reset on the next positive edge of PCLK.
void TIM_Init (LPC_TIM_TypeDef *TIMx, uint8_t TimerCounterMode, void *TIM_ConfigStruct)
 Initial Timer/Counter device Set Clock frequency for Timer Set initial configuration for Timer.
void TIM_DeInit (LPC_TIM_TypeDef *TIMx)
 Close Timer/Counter device.
void TIM_ConfigStructInit (uint8_t TimerCounterMode, void *TIM_ConfigStruct)
 Configuration for Timer at initial time.
void TIM_ConfigMatch (LPC_TIM_TypeDef *TIMx, TIM_MATCHCFG_Type *TIM_MatchConfigStruct)
 Configuration for Match register.
void TIM_ConfigCapture (LPC_TIM_TypeDef *TIMx, TIM_CAPTURECFG_Type *TIM_CaptureConfigStruct)
 Configuration for Capture register.
uint32_t TIM_GetCaptureValue (LPC_TIM_TypeDef *TIMx, uint8_t CaptureChannel)
 Read value of capture register in timer/counter device.

Function Documentation

void TIM_ClearIntCapturePending ( LPC_TIM_TypeDef *  TIMx,
uint8_t  IntFlag 
)

Clear Capture Interrupt pending.

Parameters:
[in]TIMxTimer selection, should be TIM0, TIM1, TIM2, TIM3
[in]IntFlagshould be in TIM_INT_TYPE enum
Returns:
None

Definition at line 195 of file lpc17xx_timer.c.

void TIM_ClearIntPending ( LPC_TIM_TypeDef *  TIMx,
uint8_t  IntFlag 
)

Clear Interrupt pending.

Parameters:
[in]TIMxTimer selection, should be TIM0, TIM1, TIM2, TIM3
[in]IntFlagshould be in TIM_INT_TYPE enum
Returns:
None

Definition at line 182 of file lpc17xx_timer.c.

void TIM_Cmd ( LPC_TIM_TypeDef *  TIMx,
FunctionalState  NewState 
)

Start/Stop Timer/Counter device.

Parameters:
[in]TIMxPointer to timer device
[in]NewState
  • ENABLE : set timer enable
  • DISABLE : disable timer
Returns:
None

Definition at line 341 of file lpc17xx_timer.c.

void TIM_ConfigCapture ( LPC_TIM_TypeDef *  TIMx,
TIM_CAPTURECFG_Type TIM_CaptureConfigStruct 
)

Configuration for Capture register.

Parameters:
[in]TIMxPointer to timer device

  • CaptureChannel: set the channel to capture data
  • RisingEdge : if SET, Capture at rising edge
  • FallingEdge : if SET, Capture at falling edge
  • IntOnCaption : if SET, Capture generate interrupt
[in]TIM_CaptureConfigStructPointer to TIM_CAPTURECFG_Type
Returns:
None

Definition at line 434 of file lpc17xx_timer.c.

void TIM_ConfigMatch ( LPC_TIM_TypeDef *  TIMx,
TIM_MATCHCFG_Type TIM_MatchConfigStruct 
)

Configuration for Match register.

Parameters:
[in]TIMxPointer to timer device
[in]TIM_MatchConfigStructPointer to TIM_MATCHCFG_Type

  • MatchChannel : choose channel 0 or 1
  • IntOnMatch : if SET, interrupt will be generated when MRxx match the value in TC
  • StopOnMatch : if SET, TC and PC will be stopped whenM Rxx match the value in TC
  • ResetOnMatch : if SET, Reset on MR0 when MRxx match the value in TC -ExtMatchOutputType: Select output for external match + 0: Do nothing for external output pin if match + 1: Force external output pin to low if match + 2: Force external output pin to high if match + 3: Toggle external output pin if match MatchValue: Set the value to be compared with TC value
Returns:
None

Definition at line 387 of file lpc17xx_timer.c.

void TIM_ConfigStructInit ( uint8_t  TimerCounterMode,
void *  TIM_ConfigStruct 
)

Configuration for Timer at initial time.

Parameters:
[in]TimerCounterModeShould be :

  • PrescaleOption = TC_PRESCALE_USVAL,
  • PrescaleValue = 1 Counter mode with
  • Caption channel 0
[in]TIM_ConfigStructpointer to TIM_TIMERCFG_Type or TIM_COUNTERCFG_Type
Returns:
None

Definition at line 213 of file lpc17xx_timer.c.

void TIM_DeInit ( LPC_TIM_TypeDef *  TIMx )

Close Timer/Counter device.

Parameters:
[in]TIMxPointer to timer device
Returns:
None

Definition at line 312 of file lpc17xx_timer.c.

uint32_t TIM_GetCaptureValue ( LPC_TIM_TypeDef *  TIMx,
uint8_t  CaptureChannel 
)

Read value of capture register in timer/counter device.

Parameters:
[in]TIMxPointer to timer/counter device
[in]CaptureChannel,:capture channel number
Returns:
Value of capture register

Definition at line 458 of file lpc17xx_timer.c.

FlagStatus TIM_GetIntCaptureStatus ( LPC_TIM_TypeDef *  TIMx,
uint8_t  IntFlag 
)

Get Capture Interrupt Status.

Parameters:
[in]TIMxTimer selection, should be TIM0, TIM1, TIM2, TIM3
[in]IntFlag
Returns:
FlagStatus
  • SET : interrupt
  • RESET : no interrupt

Definition at line 167 of file lpc17xx_timer.c.

FlagStatus TIM_GetIntStatus ( LPC_TIM_TypeDef *  TIMx,
uint8_t  IntFlag 
)

Get Interrupt Status.

Parameters:
[in]TIMxTimer selection, should be TIM0, TIM1, TIM2, TIM3
[in]IntFlag
Returns:
FlagStatus
  • SET : interrupt
  • RESET : no interrupt

Definition at line 148 of file lpc17xx_timer.c.

void TIM_Init ( LPC_TIM_TypeDef *  TIMx,
uint8_t  TimerCounterMode,
void *  TIM_ConfigStruct 
)

Initial Timer/Counter device Set Clock frequency for Timer Set initial configuration for Timer.

Parameters:
[in]TIMxTimer selection, should be TIM0, TIM1, TIM2, TIM3
[in]TimerCounterModeTIM_MODE_OPT
[in]TIM_ConfigStructpointer to TIM_TIMERCFG_Type that contains the configuration information for the specified Timer peripheral.
Returns:
None

Definition at line 240 of file lpc17xx_timer.c.

void TIM_ResetCounter ( LPC_TIM_TypeDef *  TIMx )

Reset Timer/Counter device, Make TC and PC are synchronously reset on the next positive edge of PCLK.

Parameters:
[in]TIMxPointer to timer device
Returns:
None

Definition at line 361 of file lpc17xx_timer.c.