TIM driver modules.
More...
TIM driver modules.
#define CCER_CCE_SET ((uint16_t)0x0001) |
#define CCER_CCE_SET ((uint16_t)0x0001) |
#define CCER_CCNE_SET ((uint16_t)0x0004) |
#define CCER_CCNE_SET ((uint16_t)0x0004) |
#define CCMR_OC13M_MASK ((uint16_t)0xFF8F) |
#define CCMR_OC13M_MASK ((uint32_t)0xFFFEFF8F) |
#define CCMR_OC24M_MASK ((uint16_t)0x8FFF) |
#define CCMR_OC24M_MASK ((uint32_t)0xFEFF8FFF) |
#define CCMR_OFFSET ((uint16_t)0x0018) |
#define CCMR_OFFSET ((uint16_t)0x0018) |
#define SMCR_ETR_MASK ((uint16_t)0x00FF) |
#define SMCR_ETR_MASK ((uint16_t)0x00FF) |
Checks whether the specified TIM flag is set or not.
- Parameters
-
TIMx | where x can be 1 to 14 to select the TIM peripheral. |
TIM_FLAG | specifies the flag to check. This parameter can be one of the following values:
- TIM_FLAG_Update: TIM update Flag
- TIM_FLAG_CC1: TIM Capture Compare 1 Flag
- TIM_FLAG_CC2: TIM Capture Compare 2 Flag
- TIM_FLAG_CC3: TIM Capture Compare 3 Flag
- TIM_FLAG_CC4: TIM Capture Compare 4 Flag
- TIM_FLAG_COM: TIM Commutation Flag
- TIM_FLAG_Trigger: TIM Trigger Flag
- TIM_FLAG_Break: TIM Break Flag
- TIM_FLAG_CC1OF: TIM Capture Compare 1 over capture Flag
- TIM_FLAG_CC2OF: TIM Capture Compare 2 over capture Flag
- TIM_FLAG_CC3OF: TIM Capture Compare 3 over capture Flag
- TIM_FLAG_CC4OF: TIM Capture Compare 4 over capture Flag
|
- Note
- TIM6 and TIM7 can have only one update flag.
-
TIM_FLAG_COM and TIM_FLAG_Break are used only with TIM1 and TIM8.
- Return values
-
The | new state of TIM_FLAG (SET or RESET). |
- Parameters
-
TIMx | where x can be 1 to 17 to select the TIM peripheral. |
TIM_FLAG | specifies the flag to check. This parameter can be one of the following values:
- TIM_FLAG_Update: TIM update Flag
- TIM_FLAG_CC1: TIM Capture Compare 1 Flag
- TIM_FLAG_CC2: TIM Capture Compare 2 Flag
- TIM_FLAG_CC3: TIM Capture Compare 3 Flag
- TIM_FLAG_CC4: TIM Capture Compare 4 Flag
- TIM_FLAG_COM: TIM Commutation Flag
- TIM_FLAG_Trigger: TIM Trigger Flag
- TIM_FLAG_Break: TIM Break Flag
- TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag
- TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag
- TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag
- TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag
|
- Note
- TIM6 and TIM7 can have only one update flag.
- TIM9, TIM12 and TIM15 can have only TIM_FLAG_Update, TIM_FLAG_CC1, TIM_FLAG_CC2 or TIM_FLAG_Trigger.
- TIM10, TIM11, TIM13, TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1.
- TIM_FLAG_Break is used only with TIM1, TIM8 and TIM15.
- TIM_FLAG_COM is used only with TIM1, TIM8, TIM15, TIM16 and TIM17.
- Return values
-
The | new state of TIM_FLAG (SET or RESET). |
Definition at line 2443 of file stm32f4xx_tim.c.
void TIM_SelectOCxM |
( |
TIM_TypeDef * |
TIMx, |
|
|
uint16_t |
TIM_Channel, |
|
|
uint16_t |
TIM_OCMode |
|
) |
| |
Selects the TIM Output Compare Mode.
- Note
- This function disables the selected channel before changing the Output Compare Mode. If needed, user has to enable this channel using TIM_CCxCmd() and TIM_CCxNCmd() functions.
- Parameters
-
TIMx | where x can be 1 to 14 except 6 and 7, to select the TIM peripheral. |
TIM_Channel | specifies the TIM Channel This parameter can be one of the following values:
- TIM_Channel_1: TIM Channel 1
- TIM_Channel_2: TIM Channel 2
- TIM_Channel_3: TIM Channel 3
- TIM_Channel_4: TIM Channel 4
|
TIM_OCMode | specifies the TIM Output Compare Mode. This parameter can be one of the following values:
- TIM_OCMode_Timing
- TIM_OCMode_Active
- TIM_OCMode_Toggle
- TIM_OCMode_PWM1
- TIM_OCMode_PWM2
- TIM_ForcedAction_Active
- TIM_ForcedAction_InActive
|
- Return values
-
- Note
- This function disables the selected channel before changing the Output Compare Mode. User has to enable this channel using TIM_CCxCmd and TIM_CCxNCmd functions.
- Parameters
-
TIMx | where x can be 1 to 17 except 6 and 7 to select the TIM peripheral. |
TIM_Channel | specifies the TIM Channel This parameter can be one of the following values:
- TIM_Channel_1: TIM Channel 1
- TIM_Channel_2: TIM Channel 2
- TIM_Channel_3: TIM Channel 3
- TIM_Channel_4: TIM Channel 4
|
TIM_OCMode | specifies the TIM Output Compare Mode. This parameter can be one of the following values:
- TIM_OCMode_Timing
- TIM_OCMode_Active
- TIM_OCMode_Toggle
- TIM_OCMode_PWM1
- TIM_OCMode_PWM2
- TIM_ForcedAction_Active
- TIM_ForcedAction_InActive
|
- Return values
-
Definition at line 1014 of file stm32f4xx_tim.c.
void TIM_SelectSlaveMode |
( |
TIM_TypeDef * |
TIMx, |
|
|
uint16_t |
TIM_SlaveMode |
|
) |
| |
Selects the TIMx Slave Mode.
- Parameters
-
TIMx | where x can be 1, 2, 3, 4, 5, 8, 9 or 12 to select the TIM peripheral. |
TIM_SlaveMode | specifies the Timer Slave Mode. This parameter can be one of the following values:
- TIM_SlaveMode_Reset: Rising edge of the selected trigger signal(TRGI) reinitialize the counter and triggers an update of the registers
- TIM_SlaveMode_Gated: The counter clock is enabled when the trigger signal (TRGI) is high
- TIM_SlaveMode_Trigger: The counter starts at a rising edge of the trigger TRGI
- TIM_SlaveMode_External1: Rising edges of the selected trigger (TRGI) clock the counter
|
- Return values
-
- Parameters
-
TIMx | where x can be 1, 2, 3, 4, 5, 8, 9, 12 or 15 to select the TIM peripheral. |
TIM_SlaveMode | specifies the Timer Slave Mode. This parameter can be one of the following values:
- TIM_SlaveMode_Reset: Rising edge of the selected trigger signal (TRGI) re-initializes the counter and triggers an update of the registers.
- TIM_SlaveMode_Gated: The counter clock is enabled when the trigger signal (TRGI) is high.
- TIM_SlaveMode_Trigger: The counter starts at a rising edge of the trigger TRGI.
- TIM_SlaveMode_External1: Rising edges of the selected trigger (TRGI) clock the counter.
|
- Return values
-
Definition at line 2959 of file stm32f4xx_tim.c.