STM8L15x Standard Peripherals Drivers
|
TIM1 driver modules. More...
Modules | |
TIM1_Exported_Types | |
TIM1_Exported_Macros | |
TIM1_Private_Functions_Prototypes | |
TIM1_Private_Functions | |
Functions | |
void | TIM1_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM1 peripheral Preload register on ARR. | |
void | TIM1_BDTRConfig (TIM1_OSSIState_TypeDef TIM1_OSSIState, TIM1_LockLevel_TypeDef TIM1_LockLevel, uint8_t TIM1_DeadTime, TIM1_BreakState_TypeDef TIM1_Break, TIM1_BreakPolarity_TypeDef TIM1_BreakPolarity, TIM1_AutomaticOutput_TypeDef TIM1_AutomaticOutput) |
Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable). | |
void | TIM1_CCPreloadControl (FunctionalState NewState) |
Sets or Resets the TIM1 peripheral Capture Compare Preload Control bit. | |
void | TIM1_CCxCmd (TIM1_Channel_TypeDef TIM1_Channel, FunctionalState NewState) |
Enables or disables the TIM1 Capture Compare Channel x (x=1,..,4). | |
void | TIM1_CCxNCmd (TIM1_Channel_TypeDef TIM1_Channel, FunctionalState NewState) |
Enables or disables the TIM1 Capture Compare Channel xN (xN=1,..,3). | |
void | TIM1_ClearFlag (TIM1_FLAG_TypeDef TIM1_FLAG) |
Clears the TIM1�s pending flags. | |
void | TIM1_ClearITPendingBit (TIM1_IT_TypeDef TIM1_IT) |
Clears the TIM1's interrupt pending bits. | |
void | TIM1_ClearOC1Ref (FunctionalState NewState) |
Clears or safeguards the OC1REF signal. | |
void | TIM1_ClearOC2Ref (FunctionalState NewState) |
Clears or safeguards the OC2REF signal. | |
void | TIM1_ClearOC3Ref (FunctionalState NewState) |
Clears or safeguards the OC3REF signal. | |
void | TIM1_ClearOC4Ref (FunctionalState NewState) |
Clears or safeguards the OC4REF signal. | |
void | TIM1_Cmd (FunctionalState NewState) |
Enables or disables the TIM1 peripheral. | |
void | TIM1_CounterModeConfig (TIM1_CounterMode_TypeDef TIM1_CounterMode) |
Specifies the TIM1 Counter Mode to be used. | |
void | TIM1_CtrlPWMOutputs (FunctionalState NewState) |
Enables or disables the TIM1 peripheral Main Outputs. | |
void | TIM1_DeInit (void) |
Deinitializes the TIM1 peripheral registers to their default reset values. | |
void | TIM1_DMACmd (TIM1_DMASource_TypeDef TIM1_DMASource, FunctionalState NewState) |
Enables or disables the TIM�s DMA Requests. | |
void | TIM1_DMAConfig (TIM1_DMABase_TypeDef TIM1_DMABase, TIM1_DMABurstLength_TypeDef TIM1_DMABurstLength) |
Configures the TIM1�s DMA interface. | |
void | TIM1_EncoderInterfaceConfig (TIM1_EncoderMode_TypeDef TIM1_EncoderMode, TIM1_ICPolarity_TypeDef TIM1_IC1Polarity, TIM1_ICPolarity_TypeDef TIM1_IC2Polarity) |
Configures the TIM1 Encoder Interface. | |
void | TIM1_ETRClockMode1Config (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM1 External clock Mode1. | |
void | TIM1_ETRClockMode2Config (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM1 External clock Mode2. | |
void | TIM1_ETRConfig (TIM1_ExtTRGPSC_TypeDef TIM1_ExtTRGPrescaler, TIM1_ExtTRGPolarity_TypeDef TIM1_ExtTRGPolarity, uint8_t ExtTRGFilter) |
Configures the TIM1 External Trigger. | |
void | TIM1_ForcedOC1Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction) |
Forces the TIM1 Channel1 output waveform to active or inactive level. | |
void | TIM1_ForcedOC2Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction) |
Forces the TIM1 Channel2 output waveform to active or inactive level. | |
void | TIM1_ForcedOC3Config (TIM1_ForcedAction_TypeDef TIM1_ForcedAction) |
Forces the TIM1 Channel3 output waveform to active or inactive level. | |
void | TIM1_GenerateEvent (TIM1_EventSource_TypeDef TIM1_EventSource) |
Configures the TIM1 event to be generated by software. | |
uint16_t | TIM1_GetCapture1 (void) |
Gets the TIM1 Input Capture 1 value. | |
uint16_t | TIM1_GetCapture2 (void) |
Gets the TIM1 Input Capture 2 value. | |
uint16_t | TIM1_GetCapture3 (void) |
Gets the TIM1 Input Capture 3 value. | |
uint16_t | TIM1_GetCapture4 (void) |
Gets the TIM1 Input Capture 4 value. | |
uint16_t | TIM1_GetCounter (void) |
Gets the TIM1 Counter value. | |
FlagStatus | TIM1_GetFlagStatus (TIM1_FLAG_TypeDef TIM1_FLAG) |
Checks whether the specified TIM1 flag is set or not. | |
ITStatus | TIM1_GetITStatus (TIM1_IT_TypeDef TIM1_IT) |
Checks whether the TIM1 interrupt has occurred or not. | |
uint16_t | TIM1_GetPrescaler (void) |
Gets the TIM1 Prescaler value. | |
void | TIM1_ICInit (TIM1_Channel_TypeDef TIM1_Channel, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, TIM1_ICSelection_TypeDef TIM1_ICSelection, TIM1_ICPSC_TypeDef TIM1_ICPrescaler, uint8_t TIM1_ICFilter) |
Initializes the TIM1 peripheral according to the specified parameters. | |
void | TIM1_InternalClockConfig (void) |
Configures the TIM1 internal Clock. | |
void | TIM1_ITConfig (TIM1_IT_TypeDef TIM1_IT, FunctionalState NewState) |
Enables or disables the specified TIM1 interrupts. | |
void | TIM1_OC1FastConfig (FunctionalState NewState) |
Configures the TIM1 Capture Compare 1 Fast feature. | |
void | TIM1_OC1Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState) |
Initializes the TIM1 Channel1 according to the specified parameters. | |
void | TIM1_OC1NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity) |
Configures the TIM1 Channel 1N polarity. | |
void | TIM1_OC1PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity) |
Configures the TIM1 Channel 1 polarity. | |
void | TIM1_OC1PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM1 peripheral Preload Register on CCR1. | |
void | TIM1_OC2FastConfig (FunctionalState NewState) |
Configures the TIM1 Capture Compare 2 Fast feature. | |
void | TIM1_OC2Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState) |
Initializes the TIM1 Channel2 according to the specified parameters. | |
void | TIM1_OC2NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity) |
Configures the TIM1 Channel 2N polarity. | |
void | TIM1_OC2PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity) |
Configures the TIM1 Channel 2 polarity. | |
void | TIM1_OC2PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM1 peripheral Preload Register on CCR2. | |
void | TIM1_OC3FastConfig (FunctionalState NewState) |
Configures the TIM1 Capture Compare 3 Fast feature. | |
void | TIM1_OC3Init (TIM1_OCMode_TypeDef TIM1_OCMode, TIM1_OutputState_TypeDef TIM1_OutputState, TIM1_OutputNState_TypeDef TIM1_OutputNState, uint16_t TIM1_Pulse, TIM1_OCPolarity_TypeDef TIM1_OCPolarity, TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity, TIM1_OCIdleState_TypeDef TIM1_OCIdleState, TIM1_OCNIdleState_TypeDef TIM1_OCNIdleState) |
Initializes the TIM1 Channel3 according to the specified parameters. | |
void | TIM1_OC3NPolarityConfig (TIM1_OCNPolarity_TypeDef TIM1_OCNPolarity) |
Configures the TIM1 Channel 3N polarity. | |
void | TIM1_OC3PolarityConfig (TIM1_OCPolarity_TypeDef TIM1_OCPolarity) |
Configures the TIM1 Channel 3 polarity. | |
void | TIM1_OC3PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM1 peripheral Preload Register on CCR3. | |
void | TIM1_OC4PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM1 peripheral Preload Register on CCR4. | |
void | TIM1_PrescalerConfig (uint16_t Prescaler, TIM1_PSCReloadMode_TypeDef TIM1_PSCReloadMode) |
Configures the TIM1 Prescaler. | |
void | TIM1_PWMIConfig (TIM1_Channel_TypeDef TIM1_Channel, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, TIM1_ICSelection_TypeDef TIM1_ICSelection, TIM1_ICPSC_TypeDef TIM1_ICPrescaler, uint8_t TIM1_ICFilter) |
Configures the TIM1 peripheral in PWM Input Mode according to the specified parameters. | |
void | TIM1_SelectCCDMA (FunctionalState NewState) |
Selects the TIM1 peripheral Capture Compare DMA source. | |
void | TIM1_SelectCOM (FunctionalState NewState) |
Selects the TIM1 peripheral Commutation event. | |
void | TIM1_SelectHallSensor (FunctionalState NewState) |
Enables or Disables the TIM�s Hall sensor interface. | |
void | TIM1_SelectInputTrigger (TIM1_TRGSelection_TypeDef TIM1_InputTriggerSource) |
Selects the TIM1 Input Trigger source. | |
void | TIM1_SelectMasterSlaveMode (FunctionalState NewState) |
Sets or Resets the TIM1 Master/Slave Mode. | |
void | TIM1_SelectOCREFClear (TIM1_OCReferenceClear_TypeDef TIM1_OCReferenceClear) |
Selects the OCReference Clear source. | |
void | TIM1_SelectOCxM (TIM1_Channel_TypeDef TIM1_Channel, TIM1_OCMode_TypeDef TIM1_OCMode) |
Selects the TIM1 Output Compare Mode. | |
void | TIM1_SelectOnePulseMode (TIM1_OPMode_TypeDef TIM1_OPMode) |
Selects the TIM1�s One Pulse Mode. | |
void | TIM1_SelectOutputTrigger (TIM1_TRGOSource_TypeDef TIM1_TRGOSource) |
Selects the TIM1 Trigger Output Mode. | |
void | TIM1_SelectSlaveMode (TIM1_SlaveMode_TypeDef TIM1_SlaveMode) |
Selects the TIM1 Slave Mode. | |
void | TIM1_SetAutoreload (uint16_t Autoreload) |
Sets the TIM1 Autoreload Register value. | |
void | TIM1_SetCompare1 (uint16_t Compare1) |
Sets the TIM1 Capture Compare1 Register value. | |
void | TIM1_SetCompare2 (uint16_t Compare2) |
Sets the TIM1 Capture Compare2 Register value. | |
void | TIM1_SetCompare3 (uint16_t Compare3) |
Sets the TIM1 Capture Compare3 Register value. | |
void | TIM1_SetCompare4 (uint16_t Compare4) |
Sets the TIM1 Capture Compare4 Register value. | |
void | TIM1_SetCounter (uint16_t Counter) |
Sets the TIM1 Counter Register value. | |
void | TIM1_SetIC1Prescaler (TIM1_ICPSC_TypeDef TIM1_IC1Prescaler) |
Sets the TIM1 Input Capture 1 prescaler. | |
void | TIM1_SetIC2Prescaler (TIM1_ICPSC_TypeDef TIM1_IC2Prescaler) |
Sets the TIM1 Input Capture 2 prescaler. | |
void | TIM1_SetIC3Prescaler (TIM1_ICPSC_TypeDef TIM1_IC3Prescaler) |
Sets the TIM1 Input Capture 3 prescaler. | |
void | TIM1_SetIC4Prescaler (TIM1_ICPSC_TypeDef TIM1_IC4Prescaler) |
Sets the TIM1 Input Capture 4 prescaler. | |
void | TIM1_TimeBaseInit (uint16_t TIM1_Prescaler, TIM1_CounterMode_TypeDef TIM1_CounterMode, uint16_t TIM1_Period, uint8_t TIM1_RepetitionCounter) |
Initializes the TIM1 Time Base Unit according to the specified parameters. | |
void | TIM1_TIxExternalClockConfig (TIM1_TIxExternalCLK1Source_TypeDef TIM1_TIxExternalCLKSource, TIM1_ICPolarity_TypeDef TIM1_ICPolarity, uint8_t ICFilter) |
Configures the TIM1 Trigger as External Clock. | |
void | TIM1_UpdateDisableConfig (FunctionalState NewState) |
Enables or Disables the TIM1 Update event. | |
void | TIM1_UpdateRequestConfig (TIM1_UpdateSource_TypeDef TIM1_UpdateSource) |
Selects the TIM1 Update Request Interrupt source. |
Detailed Description
TIM1 driver modules.
Function Documentation
void TIM1_ARRPreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables TIM1 peripheral Preload register on ARR.
Definition at line 420 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_ARPE.
void TIM1_BDTRConfig | ( | TIM1_OSSIState_TypeDef | TIM1_OSSIState, |
TIM1_LockLevel_TypeDef | TIM1_LockLevel, | ||
uint8_t | TIM1_DeadTime, | ||
TIM1_BreakState_TypeDef | TIM1_Break, | ||
TIM1_BreakPolarity_TypeDef | TIM1_BreakPolarity, | ||
TIM1_AutomaticOutput_TypeDef | TIM1_AutomaticOutput | ||
) |
Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
Definition at line 797 of file stm8l15x_tim1.c.
References IS_TIM1_AUTOMATIC_OUTPUT_STATE, IS_TIM1_BREAK_POLARITY, IS_TIM1_BREAK_STATE, IS_TIM1_LOCK_LEVEL, IS_TIM1_OSSI_STATE, and TIM1.
void TIM1_CCPreloadControl | ( | FunctionalState | NewState | ) |
Sets or Resets the TIM1 peripheral Capture Compare Preload Control bit.
Definition at line 957 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCPC.
void TIM1_CCxCmd | ( | TIM1_Channel_TypeDef | TIM1_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM1 Capture Compare Channel x (x=1,..,4).
Definition at line 1462 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_CHANNEL, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC2E, TIM1_CCER2_CC3E, TIM1_CCER2_CC4E, TIM1_Channel_1, TIM1_Channel_2, and TIM1_Channel_3.
void TIM1_CCxNCmd | ( | TIM1_Channel_TypeDef | TIM1_Channel, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM1 Capture Compare Channel xN (xN=1,..,3).
Definition at line 1529 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_COMPLEMENTARY_CHANNEL, TIM1, TIM1_CCER1_CC1NE, TIM1_CCER1_CC2NE, TIM1_CCER2_CC3NE, TIM1_Channel_1, and TIM1_Channel_2.
void TIM1_ClearFlag | ( | TIM1_FLAG_TypeDef | TIM1_FLAG | ) |
Clears the TIM1�s pending flags.
Definition at line 2083 of file stm8l15x_tim1.c.
References IS_TIM1_CLEAR_FLAG, and TIM1.
void TIM1_ClearITPendingBit | ( | TIM1_IT_TypeDef | TIM1_IT | ) |
Clears the TIM1's interrupt pending bits.
Definition at line 2146 of file stm8l15x_tim1.c.
References IS_TIM1_IT, and TIM1.
void TIM1_ClearOC1Ref | ( | FunctionalState | NewState | ) |
Clears or safeguards the OC1REF signal.
Definition at line 1184 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.
void TIM1_ClearOC2Ref | ( | FunctionalState | NewState | ) |
Clears or safeguards the OC2REF signal.
Definition at line 1206 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.
void TIM1_ClearOC3Ref | ( | FunctionalState | NewState | ) |
Clears or safeguards the OC3REF signal.
Definition at line 1228 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.
void TIM1_ClearOC4Ref | ( | FunctionalState | NewState | ) |
Clears or safeguards the OC4REF signal.
Definition at line 1250 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxCE.
void TIM1_Cmd | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral.
Definition at line 466 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_CEN.
void TIM1_CounterModeConfig | ( | TIM1_CounterMode_TypeDef | TIM1_CounterMode | ) |
Specifies the TIM1 Counter Mode to be used.
Definition at line 297 of file stm8l15x_tim1.c.
References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.
void TIM1_CtrlPWMOutputs | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral Main Outputs.
Definition at line 828 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_BKR_MOE.
void TIM1_DeInit | ( | void | ) |
Deinitializes the TIM1 peripheral registers to their default reset values.
Definition at line 175 of file stm8l15x_tim1.c.
References TIM1, TIM1_ARRH_RESET_VALUE, TIM1_ARRL_RESET_VALUE, TIM1_BKR_RESET_VALUE, TIM1_CCER1_RESET_VALUE, TIM1_CCER2_RESET_VALUE, TIM1_CCMR1_RESET_VALUE, TIM1_CCMR2_RESET_VALUE, TIM1_CCMR3_RESET_VALUE, TIM1_CCMR4_RESET_VALUE, TIM1_CCR1H_RESET_VALUE, TIM1_CCR1L_RESET_VALUE, TIM1_CCR2H_RESET_VALUE, TIM1_CCR2L_RESET_VALUE, TIM1_CCR3H_RESET_VALUE, TIM1_CCR3L_RESET_VALUE, TIM1_CCR4H_RESET_VALUE, TIM1_CCR4L_RESET_VALUE, TIM1_CNTRH_RESET_VALUE, TIM1_CNTRL_RESET_VALUE, TIM1_CR1_RESET_VALUE, TIM1_CR2_RESET_VALUE, TIM1_DTR_RESET_VALUE, TIM1_ETR_RESET_VALUE, TIM1_IER_RESET_VALUE, TIM1_OISR_RESET_VALUE, TIM1_PSCRH_RESET_VALUE, TIM1_PSCRL_RESET_VALUE, TIM1_RCR_RESET_VALUE, TIM1_SMCR_RESET_VALUE, TIM1_SR1_RESET_VALUE, and TIM1_SR2_RESET_VALUE.
void TIM1_DMACmd | ( | TIM1_DMASource_TypeDef | TIM1_DMASource, |
FunctionalState | NewState | ||
) |
Enables or disables the TIM�s DMA Requests.
Definition at line 2183 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_DMA_SOURCE, and TIM1.
void TIM1_DMAConfig | ( | TIM1_DMABase_TypeDef | TIM1_DMABase, |
TIM1_DMABurstLength_TypeDef | TIM1_DMABurstLength | ||
) |
Configures the TIM1�s DMA interface.
Definition at line 2161 of file stm8l15x_tim1.c.
References IS_TIM1_DMABase, IS_TIM1_DMABurstLength, and TIM1.
void TIM1_EncoderInterfaceConfig | ( | TIM1_EncoderMode_TypeDef | TIM1_EncoderMode, |
TIM1_ICPolarity_TypeDef | TIM1_IC1Polarity, | ||
TIM1_ICPolarity_TypeDef | TIM1_IC2Polarity | ||
) |
Configures the TIM1 Encoder Interface.
Definition at line 2541 of file stm8l15x_tim1.c.
References CCMR_TIxDirect_Set, IS_TIM1_ENCODER_MODE, IS_TIM1_IC_POLARITY, TIM1, TIM1_CCER1_CC1P, TIM1_CCER1_CC2P, TIM1_CCMR_CCxS, TIM1_ICPolarity_Rising, TIM1_SMCR_MSM, and TIM1_SMCR_TS.
void TIM1_ETRClockMode1Config | ( | TIM1_ExtTRGPSC_TypeDef | TIM1_ExtTRGPrescaler, |
TIM1_ExtTRGPolarity_TypeDef | TIM1_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM1 External clock Mode1.
Definition at line 2308 of file stm8l15x_tim1.c.
References IS_TIM1_EXT_POLARITY, IS_TIM1_EXT_PRESCALER, IS_TIM1_EXT_TRG_FILTER, TIM1, TIM1_ETRConfig(), TIM1_SlaveMode_External1, TIM1_SMCR_SMS, TIM1_SMCR_TS, and TIM1_TRGSelection_ETRF.
void TIM1_ETRClockMode2Config | ( | TIM1_ExtTRGPSC_TypeDef | TIM1_ExtTRGPrescaler, |
TIM1_ExtTRGPolarity_TypeDef | TIM1_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM1 External clock Mode2.
Definition at line 2341 of file stm8l15x_tim1.c.
References IS_TIM1_EXT_POLARITY, IS_TIM1_EXT_PRESCALER, TIM1, TIM1_ETR_ECE, and TIM1_ETRConfig().
void TIM1_ETRConfig | ( | TIM1_ExtTRGPSC_TypeDef | TIM1_ExtTRGPrescaler, |
TIM1_ExtTRGPolarity_TypeDef | TIM1_ExtTRGPolarity, | ||
uint8_t | ExtTRGFilter | ||
) |
Configures the TIM1 External Trigger.
Definition at line 2493 of file stm8l15x_tim1.c.
References IS_TIM1_EXT_TRG_FILTER, and TIM1.
Referenced by TIM1_ETRClockMode1Config(), and TIM1_ETRClockMode2Config().
void TIM1_ForcedOC1Config | ( | TIM1_ForcedAction_TypeDef | TIM1_ForcedAction | ) |
Forces the TIM1 Channel1 output waveform to active or inactive level.
Definition at line 981 of file stm8l15x_tim1.c.
References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.
void TIM1_ForcedOC2Config | ( | TIM1_ForcedAction_TypeDef | TIM1_ForcedAction | ) |
Forces the TIM1 Channel2 output waveform to active or inactive level.
Definition at line 998 of file stm8l15x_tim1.c.
References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.
void TIM1_ForcedOC3Config | ( | TIM1_ForcedAction_TypeDef | TIM1_ForcedAction | ) |
Forces the TIM1 Channel3 output waveform to active or inactive level.
Definition at line 1015 of file stm8l15x_tim1.c.
References IS_TIM1_FORCED_ACTION, TIM1, and TIM1_CCMR_OCM.
void TIM1_GenerateEvent | ( | TIM1_EventSource_TypeDef | TIM1_EventSource | ) |
Configures the TIM1 event to be generated by software.
Definition at line 2017 of file stm8l15x_tim1.c.
References IS_TIM1_EVENT_SOURCE, and TIM1.
uint16_t TIM1_GetCapture1 | ( | void | ) |
Gets the TIM1 Input Capture 1 value.
Definition at line 1797 of file stm8l15x_tim1.c.
References TIM1.
uint16_t TIM1_GetCapture2 | ( | void | ) |
Gets the TIM1 Input Capture 2 value.
Definition at line 1818 of file stm8l15x_tim1.c.
References TIM1.
uint16_t TIM1_GetCapture3 | ( | void | ) |
Gets the TIM1 Input Capture 3 value.
Definition at line 1839 of file stm8l15x_tim1.c.
References TIM1.
uint16_t TIM1_GetCapture4 | ( | void | ) |
Gets the TIM1 Input Capture 4 value.
Definition at line 1859 of file stm8l15x_tim1.c.
References TIM1.
uint16_t TIM1_GetCounter | ( | void | ) |
FlagStatus TIM1_GetFlagStatus | ( | TIM1_FLAG_TypeDef | TIM1_FLAG | ) |
Checks whether the specified TIM1 flag is set or not.
Definition at line 2043 of file stm8l15x_tim1.c.
References IS_TIM1_GET_FLAG, RESET, SET, and TIM1.
ITStatus TIM1_GetITStatus | ( | TIM1_IT_TypeDef | TIM1_IT | ) |
Checks whether the TIM1 interrupt has occurred or not.
Definition at line 2108 of file stm8l15x_tim1.c.
References IS_TIM1_GET_IT, RESET, SET, and TIM1.
uint16_t TIM1_GetPrescaler | ( | void | ) |
void TIM1_ICInit | ( | TIM1_Channel_TypeDef | TIM1_Channel, |
TIM1_ICPolarity_TypeDef | TIM1_ICPolarity, | ||
TIM1_ICSelection_TypeDef | TIM1_ICSelection, | ||
TIM1_ICPSC_TypeDef | TIM1_ICPrescaler, | ||
uint8_t | TIM1_ICFilter | ||
) |
Initializes the TIM1 peripheral according to the specified parameters.
- Note:
- If the channel 3 is selected the TIM1_ICSelection_IndirectTI parameter is forbidden.
- If the channel 4 is selected the TIM1_ICSelection_DirectTI parameter is forbidden.
Definition at line 1658 of file stm8l15x_tim1.c.
References IS_TIM1_CHANNEL, IS_TIM1_IC_FILTER, IS_TIM1_IC_POLARITY, IS_TIM1_IC_PRESCALER, IS_TIM1_IC_SELECTION, TI1_Config(), TI2_Config(), TI3_Config(), TI4_Config(), TIM1_Channel_1, TIM1_Channel_2, TIM1_Channel_3, TIM1_SetIC1Prescaler(), TIM1_SetIC2Prescaler(), TIM1_SetIC3Prescaler(), and TIM1_SetIC4Prescaler().
void TIM1_InternalClockConfig | ( | void | ) |
Configures the TIM1 internal Clock.
Definition at line 2245 of file stm8l15x_tim1.c.
References TIM1, and TIM1_SMCR_SMS.
void TIM1_ITConfig | ( | TIM1_IT_TypeDef | TIM1_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified TIM1 interrupts.
Definition at line 1985 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, IS_TIM1_IT, and TIM1.
void TIM1_OC1FastConfig | ( | FunctionalState | NewState | ) |
Configures the TIM1 Capture Compare 1 Fast feature.
Definition at line 1118 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.
void TIM1_OC1Init | ( | TIM1_OCMode_TypeDef | TIM1_OCMode, |
TIM1_OutputState_TypeDef | TIM1_OutputState, | ||
TIM1_OutputNState_TypeDef | TIM1_OutputNState, | ||
uint16_t | TIM1_Pulse, | ||
TIM1_OCPolarity_TypeDef | TIM1_OCPolarity, | ||
TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity, | ||
TIM1_OCIdleState_TypeDef | TIM1_OCIdleState, | ||
TIM1_OCNIdleState_TypeDef | TIM1_OCNIdleState | ||
) |
Initializes the TIM1 Channel1 according to the specified parameters.
Definition at line 571 of file stm8l15x_tim1.c.
References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC1NE, TIM1_CCER1_CC1NP, TIM1_CCER1_CC1P, TIM1_CCMR_OCM, TIM1_OISR_OIS1, and TIM1_OISR_OIS1N.
void TIM1_OC1NPolarityConfig | ( | TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity | ) |
Configures the TIM1 Channel 1N polarity.
Definition at line 1298 of file stm8l15x_tim1.c.
References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER1_CC1NP, and TIM1_OCNPolarity_High.
void TIM1_OC1PolarityConfig | ( | TIM1_OCPolarity_TypeDef | TIM1_OCPolarity | ) |
Configures the TIM1 Channel 1 polarity.
Definition at line 1274 of file stm8l15x_tim1.c.
References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER1_CC1P, and TIM1_OCPolarity_High.
void TIM1_OC1PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral Preload Register on CCR1.
Definition at line 1030 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.
void TIM1_OC2FastConfig | ( | FunctionalState | NewState | ) |
Configures the TIM1 Capture Compare 2 Fast feature.
Definition at line 1140 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.
void TIM1_OC2Init | ( | TIM1_OCMode_TypeDef | TIM1_OCMode, |
TIM1_OutputState_TypeDef | TIM1_OutputState, | ||
TIM1_OutputNState_TypeDef | TIM1_OutputNState, | ||
uint16_t | TIM1_Pulse, | ||
TIM1_OCPolarity_TypeDef | TIM1_OCPolarity, | ||
TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity, | ||
TIM1_OCIdleState_TypeDef | TIM1_OCIdleState, | ||
TIM1_OCNIdleState_TypeDef | TIM1_OCNIdleState | ||
) |
Initializes the TIM1 Channel2 according to the specified parameters.
Definition at line 652 of file stm8l15x_tim1.c.
References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER1_CC2E, TIM1_CCER1_CC2NE, TIM1_CCER1_CC2NP, TIM1_CCER1_CC2P, TIM1_CCMR_OCM, TIM1_OISR_OIS2, and TIM1_OISR_OIS2N.
void TIM1_OC2NPolarityConfig | ( | TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity | ) |
Configures the TIM1 Channel 2N polarity.
Definition at line 1346 of file stm8l15x_tim1.c.
References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER1_CC2NP, and TIM1_OCNPolarity_High.
void TIM1_OC2PolarityConfig | ( | TIM1_OCPolarity_TypeDef | TIM1_OCPolarity | ) |
Configures the TIM1 Channel 2 polarity.
Definition at line 1322 of file stm8l15x_tim1.c.
References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER1_CC2P, and TIM1_OCPolarity_High.
void TIM1_OC2PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral Preload Register on CCR2.
Definition at line 1052 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.
void TIM1_OC3FastConfig | ( | FunctionalState | NewState | ) |
Configures the TIM1 Capture Compare 3 Fast feature.
Definition at line 1162 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxFE.
void TIM1_OC3Init | ( | TIM1_OCMode_TypeDef | TIM1_OCMode, |
TIM1_OutputState_TypeDef | TIM1_OutputState, | ||
TIM1_OutputNState_TypeDef | TIM1_OutputNState, | ||
uint16_t | TIM1_Pulse, | ||
TIM1_OCPolarity_TypeDef | TIM1_OCPolarity, | ||
TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity, | ||
TIM1_OCIdleState_TypeDef | TIM1_OCIdleState, | ||
TIM1_OCNIdleState_TypeDef | TIM1_OCNIdleState | ||
) |
Initializes the TIM1 Channel3 according to the specified parameters.
Definition at line 729 of file stm8l15x_tim1.c.
References IS_TIM1_OC_MODE, IS_TIM1_OC_POLARITY, IS_TIM1_OCIDLE_STATE, IS_TIM1_OCN_POLARITY, IS_TIM1_OCNIDLE_STATE, IS_TIM1_OUTPUT_STATE, IS_TIM1_OUTPUTN_STATE, TIM1, TIM1_CCER2_CC3E, TIM1_CCER2_CC3NE, TIM1_CCER2_CC3NP, TIM1_CCER2_CC3P, TIM1_CCMR_OCM, TIM1_OISR_OIS3, and TIM1_OISR_OIS3N.
void TIM1_OC3NPolarityConfig | ( | TIM1_OCNPolarity_TypeDef | TIM1_OCNPolarity | ) |
Configures the TIM1 Channel 3N polarity.
Definition at line 1394 of file stm8l15x_tim1.c.
References IS_TIM1_OCN_POLARITY, TIM1, TIM1_CCER2_CC3NP, and TIM1_OCNPolarity_High.
void TIM1_OC3PolarityConfig | ( | TIM1_OCPolarity_TypeDef | TIM1_OCPolarity | ) |
Configures the TIM1 Channel 3 polarity.
Definition at line 1370 of file stm8l15x_tim1.c.
References IS_TIM1_OC_POLARITY, TIM1, TIM1_CCER2_CC3P, and TIM1_OCPolarity_High.
void TIM1_OC3PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral Preload Register on CCR3.
Definition at line 1074 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.
void TIM1_OC4PreloadConfig | ( | FunctionalState | NewState | ) |
Enables or disables the TIM1 peripheral Preload Register on CCR4.
Definition at line 1096 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CCMR_OCxPE.
void TIM1_PrescalerConfig | ( | uint16_t | Prescaler, |
TIM1_PSCReloadMode_TypeDef | TIM1_PSCReloadMode | ||
) |
Configures the TIM1 Prescaler.
Definition at line 273 of file stm8l15x_tim1.c.
References IS_TIM1_PRESCALER_RELOAD, and TIM1.
void TIM1_PWMIConfig | ( | TIM1_Channel_TypeDef | TIM1_Channel, |
TIM1_ICPolarity_TypeDef | TIM1_ICPolarity, | ||
TIM1_ICSelection_TypeDef | TIM1_ICSelection, | ||
TIM1_ICPSC_TypeDef | TIM1_ICPrescaler, | ||
uint8_t | TIM1_ICFilter | ||
) |
Configures the TIM1 peripheral in PWM Input Mode according to the specified parameters.
Definition at line 1727 of file stm8l15x_tim1.c.
References IS_TIM1_IC_POLARITY, IS_TIM1_IC_PRESCALER, IS_TIM1_IC_SELECTION, IS_TIM1_PWMI_CHANNEL, TI1_Config(), TI2_Config(), TIM1_Channel_1, TIM1_ICPolarity_Falling, TIM1_ICPolarity_Rising, TIM1_ICSelection_DirectTI, TIM1_ICSelection_IndirectTI, TIM1_SetIC1Prescaler(), and TIM1_SetIC2Prescaler().
void TIM1_SelectCCDMA | ( | FunctionalState | NewState | ) |
Selects the TIM1 peripheral Capture Compare DMA source.
Definition at line 2207 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCDS.
void TIM1_SelectCOM | ( | FunctionalState | NewState | ) |
Selects the TIM1 peripheral Commutation event.
Definition at line 1434 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_CCUS.
void TIM1_SelectHallSensor | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM�s Hall sensor interface.
Definition at line 2583 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR2_TI1S.
void TIM1_SelectInputTrigger | ( | TIM1_TRGSelection_TypeDef | TIM1_InputTriggerSource | ) |
Selects the TIM1 Input Trigger source.
Definition at line 2404 of file stm8l15x_tim1.c.
References IS_TIM1_TRIGGER_SELECTION, TIM1, and TIM1_SMCR_TS.
Referenced by TIM1_TIxExternalClockConfig().
void TIM1_SelectMasterSlaveMode | ( | FunctionalState | NewState | ) |
Sets or Resets the TIM1 Master/Slave Mode.
Definition at line 2461 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_SMCR_MSM.
void TIM1_SelectOCREFClear | ( | TIM1_OCReferenceClear_TypeDef | TIM1_OCReferenceClear | ) |
Selects the OCReference Clear source.
Definition at line 1418 of file stm8l15x_tim1.c.
References IS_TIM1_OCREFERENCECECLEAR_SOURCE, TIM1, and TIM1_SMCR_OCCS.
void TIM1_SelectOCxM | ( | TIM1_Channel_TypeDef | TIM1_Channel, |
TIM1_OCMode_TypeDef | TIM1_OCMode | ||
) |
Selects the TIM1 Output Compare Mode.
This function disables the selected channel before changing the Output Compare Mode.
- Note:
- User has to enable this channel using TIM1_CCxCmd and TIM1_CCxNCmd functions.
Definition at line 865 of file stm8l15x_tim1.c.
References IS_TIM1_CHANNEL, IS_TIM1_OCM, TIM1, TIM1_CCER1_CC1E, TIM1_CCER1_CC2E, TIM1_CCER2_CC3E, TIM1_CCMR_OCM, TIM1_Channel_1, and TIM1_Channel_2.
void TIM1_SelectOnePulseMode | ( | TIM1_OPMode_TypeDef | TIM1_OPMode | ) |
Selects the TIM1�s One Pulse Mode.
Definition at line 444 of file stm8l15x_tim1.c.
References IS_TIM1_OPM_MODE, TIM1, TIM1_CR1_OPM, and TIM1_OPMode_Repetitive.
void TIM1_SelectOutputTrigger | ( | TIM1_TRGOSource_TypeDef | TIM1_TRGOSource | ) |
Selects the TIM1 Trigger Output Mode.
Definition at line 2427 of file stm8l15x_tim1.c.
References IS_TIM1_TRGO_SOURCE, TIM1, and TIM1_CR2_MMS.
void TIM1_SelectSlaveMode | ( | TIM1_SlaveMode_TypeDef | TIM1_SlaveMode | ) |
Selects the TIM1 Slave Mode.
Definition at line 2445 of file stm8l15x_tim1.c.
References IS_TIM1_SLAVE_MODE, TIM1, and TIM1_SMCR_SMS.
void TIM1_SetAutoreload | ( | uint16_t | Autoreload | ) |
Sets the TIM1 Autoreload Register value.
Definition at line 327 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCompare1 | ( | uint16_t | Compare1 | ) |
Sets the TIM1 Capture Compare1 Register value.
Definition at line 904 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCompare2 | ( | uint16_t | Compare2 | ) |
Sets the TIM1 Capture Compare2 Register value.
Definition at line 918 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCompare3 | ( | uint16_t | Compare3 | ) |
Sets the TIM1 Capture Compare3 Register value.
Definition at line 931 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCompare4 | ( | uint16_t | Compare4 | ) |
Sets the TIM1 Capture Compare4 Register value.
Definition at line 944 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetCounter | ( | uint16_t | Counter | ) |
Sets the TIM1 Counter Register value.
Definition at line 314 of file stm8l15x_tim1.c.
References TIM1.
void TIM1_SetIC1Prescaler | ( | TIM1_ICPSC_TypeDef | TIM1_IC1Prescaler | ) |
Sets the TIM1 Input Capture 1 prescaler.
Definition at line 1884 of file stm8l15x_tim1.c.
References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.
Referenced by TIM1_ICInit(), and TIM1_PWMIConfig().
void TIM1_SetIC2Prescaler | ( | TIM1_ICPSC_TypeDef | TIM1_IC2Prescaler | ) |
Sets the TIM1 Input Capture 2 prescaler.
Definition at line 1903 of file stm8l15x_tim1.c.
References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.
Referenced by TIM1_ICInit(), and TIM1_PWMIConfig().
void TIM1_SetIC3Prescaler | ( | TIM1_ICPSC_TypeDef | TIM1_IC3Prescaler | ) |
Sets the TIM1 Input Capture 3 prescaler.
Definition at line 1922 of file stm8l15x_tim1.c.
References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.
Referenced by TIM1_ICInit().
void TIM1_SetIC4Prescaler | ( | TIM1_ICPSC_TypeDef | TIM1_IC4Prescaler | ) |
Sets the TIM1 Input Capture 4 prescaler.
Definition at line 1942 of file stm8l15x_tim1.c.
References IS_TIM1_IC_PRESCALER, TIM1, and TIM1_CCMR_ICxPSC.
Referenced by TIM1_ICInit().
void TIM1_TimeBaseInit | ( | uint16_t | TIM1_Prescaler, |
TIM1_CounterMode_TypeDef | TIM1_CounterMode, | ||
uint16_t | TIM1_Period, | ||
uint8_t | TIM1_RepetitionCounter | ||
) |
Initializes the TIM1 Time Base Unit according to the specified parameters.
Definition at line 235 of file stm8l15x_tim1.c.
References IS_TIM1_COUNTER_MODE, TIM1, TIM1_CR1_CMS, and TIM1_CR1_DIR.
void TIM1_TIxExternalClockConfig | ( | TIM1_TIxExternalCLK1Source_TypeDef | TIM1_TIxExternalCLKSource, |
TIM1_ICPolarity_TypeDef | TIM1_ICPolarity, | ||
uint8_t | ICFilter | ||
) |
Configures the TIM1 Trigger as External Clock.
Definition at line 2266 of file stm8l15x_tim1.c.
References IS_TIM1_IC_FILTER, IS_TIM1_IC_POLARITY, IS_TIM1_TIXCLK_SOURCE, TI1_Config(), TI2_Config(), TIM1, TIM1_ICSelection_DirectTI, TIM1_SelectInputTrigger(), TIM1_SlaveMode_External1, and TIM1_TIxExternalCLK1Source_TI2.
void TIM1_UpdateDisableConfig | ( | FunctionalState | NewState | ) |
Enables or Disables the TIM1 Update event.
Definition at line 374 of file stm8l15x_tim1.c.
References DISABLE, IS_FUNCTIONAL_STATE, TIM1, and TIM1_CR1_UDIS.
void TIM1_UpdateRequestConfig | ( | TIM1_UpdateSource_TypeDef | TIM1_UpdateSource | ) |
Selects the TIM1 Update Request Interrupt source.
Definition at line 398 of file stm8l15x_tim1.c.
References IS_TIM1_UPDATE_SOURCE, TIM1, TIM1_CR1_URS, and TIM1_UpdateSource_Global.