STM8L15x Standard Peripherals Drivers: stm8l15x_tim5.h File Reference

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_tim5.h File Reference

This file contains all the functions prototypes for the TIM5 firmware library. More...

#include "stm8l15x.h"

Go to the source code of this file.

Defines

#define IS_TIM5_AUTOMATIC_OUTPUT_STATE(STATE)
#define IS_TIM5_BREAK_POLARITY(POLARITY)
#define IS_TIM5_BREAK_STATE(STATE)
#define IS_TIM5_CHANNEL(CHANNEL)
#define IS_TIM5_CLEAR_FLAG(FLAG)   ((((FLAG) & (uint16_t)0xE100) == 0x0000) && ((FLAG) != 0x0000))
#define IS_TIM5_COUNTER_MODE(MODE)
#define IS_TIM5_DMA_SOURCE(SOURCE)
#define IS_TIM5_ENCODER_MODE(MODE)
#define IS_TIM5_EVENT_SOURCE(SOURCE)
#define IS_TIM5_EXT_FILTER(EXTFILTER)   ((EXTFILTER) <= 0x0F)
 Macro TIM5 External Trigger Filter.
#define IS_TIM5_EXT_POLARITY(POLARITY)
#define IS_TIM5_EXT_PRESCALER(PRESCALER)
#define IS_TIM5_FORCED_ACTION(ACTION)
#define IS_TIM5_GET_FLAG(FLAG)
#define IS_TIM5_GET_IT(IT)
#define IS_TIM5_IC_FILTER(ICFILTER)   ((ICFILTER) <= 0x0F)
 Macro TIM5 Input Capture Filter Value.
#define IS_TIM5_IC_POLARITY(POLARITY)
#define IS_TIM5_IC_PRESCALER(PRESCALER)
#define IS_TIM5_IC_SELECTION(SELECTION)
#define IS_TIM5_IT(IT)   ((IT) != 0x00)
#define IS_TIM5_LOCK_LEVEL(LEVEL)
#define IS_TIM5_OC_MODE(MODE)
#define IS_TIM5_OC_POLARITY(POLARITY)
#define IS_TIM5_OCIDLE_STATE(STATE)
#define IS_TIM5_OCM(MODE)
#define IS_TIM5_OPM_MODE(MODE)
#define IS_TIM5_OSSI_STATE(STATE)
#define IS_TIM5_OUTPUT_STATE(STATE)
#define IS_TIM5_PRESCALER(PRESCALER)
#define IS_TIM5_PRESCALER_RELOAD(RELOAD)
#define IS_TIM5_SLAVE_MODE(MODE)
#define IS_TIM5_TIX_TRIGGER_SELECTION(SELECTION)
#define IS_TIM5_TIXCLK_SOURCE(SOURCE)
#define IS_TIM5_TRGO_SOURCE(SOURCE)
#define IS_TIM5_TRIGGER_SELECTION(SELECTION)
#define IS_TIM5_UPDATE_SOURCE(SOURCE)

Enumerations

enum  TIM5_AutomaticOutput_TypeDef { TIM5_AutomaticOutput_Enable = ((uint8_t)0x40), TIM5_AutomaticOutput_Disable = ((uint8_t)0x00) }
enum  TIM5_BreakPolarity_TypeDef { TIM5_BreakPolarity_High = ((uint8_t)0x20), TIM5_BreakPolarity_Low = ((uint8_t)0x00) }
enum  TIM5_BreakState_TypeDef { TIM5_BreakState_Disable = ((uint8_t)0x00), TIM5_BreakState_Enable = ((uint8_t)0x10) }
enum  TIM5_Channel_TypeDef { TIM5_Channel_1 = ((uint8_t)0x00), TIM5_Channel_2 = ((uint8_t)0x01) }
enum  TIM5_CounterMode_TypeDef {
  TIM5_CounterMode_Up = ((uint8_t)0x00), TIM5_CounterMode_Down = ((uint8_t)0x10), TIM5_CounterMode_CenterAligned1 = ((uint8_t)0x20), TIM5_CounterMode_CenterAligned2 = ((uint8_t)0x40),
  TIM5_CounterMode_CenterAligned3 = ((uint8_t)0x60)
}
enum  TIM5_DMASource_TypeDef { TIM5_DMASource_Update = ((uint8_t)0x01), TIM5_DMASource_CC1 = ((uint8_t)0x02), TIM5_DMASource_CC2 = ((uint8_t)0x04) }
enum  TIM5_EncoderMode_TypeDef { TIM5_EncoderMode_TI1 = ((uint8_t)0x01), TIM5_EncoderMode_TI2 = ((uint8_t)0x02), TIM5_EncoderMode_TI12 = ((uint8_t)0x03) }
enum  TIM5_EventSource_TypeDef {
  TIM5_EventSource_Update = ((uint8_t)0x01), TIM5_EventSource_CC1 = ((uint8_t)0x02), TIM5_EventSource_CC2 = ((uint8_t)0x04), TIM5_EventSource_Trigger = ((uint8_t)0x40),
  TIM5_EventSource_Break = ((uint8_t)0x80)
}
enum  TIM5_ExtTRGPolarity_TypeDef { TIM5_ExtTRGPolarity_Inverted = ((uint8_t)0x80), TIM5_ExtTRGPolarity_NonInverted = ((uint8_t)0x00) }
enum  TIM5_ExtTRGPSC_TypeDef { TIM5_ExtTRGPSC_OFF = ((uint8_t)0x00), TIM5_ExtTRGPSC_DIV2 = ((uint8_t)0x10), TIM5_ExtTRGPSC_DIV4 = ((uint8_t)0x20), TIM5_ExtTRGPSC_DIV8 = ((uint8_t)0x30) }
enum  TIM5_FLAG_TypeDef {
  TIM5_FLAG_Update = ((uint16_t)0x0001), TIM5_FLAG_CC1 = ((uint16_t)0x0002), TIM5_FLAG_CC2 = ((uint16_t)0x0004), TIM5_FLAG_Trigger = ((uint16_t)0x0040),
  TIM5_FLAG_Break = ((uint16_t)0x0080), TIM5_FLAG_CC1OF = ((uint16_t)0x0200), TIM5_FLAG_CC2OF = ((uint16_t)0x0400)
}
enum  TIM5_ForcedAction_TypeDef { TIM5_ForcedAction_Active = ((uint8_t)0x50), TIM5_ForcedAction_Inactive = ((uint8_t)0x40) }
enum  TIM5_ICPolarity_TypeDef { TIM5_ICPolarity_Rising = ((uint8_t)0x00), TIM5_ICPolarity_Falling = ((uint8_t)0x01) }
enum  TIM5_ICPSC_TypeDef { TIM5_ICPSC_DIV1 = ((uint8_t)0x00), TIM5_ICPSC_DIV2 = ((uint8_t)0x04), TIM5_ICPSC_DIV4 = ((uint8_t)0x08), TIM5_ICPSC_DIV8 = ((uint8_t)0x0C) }
enum  TIM5_ICSelection_TypeDef { TIM5_ICSelection_DirectTI = ((uint8_t)0x01), TIM5_ICSelection_IndirectTI = ((uint8_t)0x02), TIM5_ICSelection_TRGI = ((uint8_t)0x03) }
enum  TIM5_IT_TypeDef {
  TIM5_IT_Update = ((uint8_t)0x01), TIM5_IT_CC1 = ((uint8_t)0x02), TIM5_IT_CC2 = ((uint8_t)0x04), TIM5_IT_Trigger = ((uint8_t)0x40),
  TIM5_IT_Break = ((uint8_t)0x80)
}
enum  TIM5_LockLevel_TypeDef { TIM5_LockLevel_Off = ((uint8_t)0x00), TIM5_LockLevel_1 = ((uint8_t)0x01), TIM5_LockLevel_2 = ((uint8_t)0x02), TIM5_LockLevel_3 = ((uint8_t)0x03) }
enum  TIM5_OCIdleState_TypeDef { TIM5_OCIdleState_Reset = ((uint8_t)0x00), TIM5_OCIdleState_Set = ((uint8_t)0x01) }
enum  TIM5_OCMode_TypeDef {
  TIM5_OCMode_Timing = ((uint8_t)0x00), TIM5_OCMode_Active = ((uint8_t)0x10), TIM5_OCMode_Inactive = ((uint8_t)0x20), TIM5_OCMode_Toggle = ((uint8_t)0x30),
  TIM5_OCMode_PWM1 = ((uint8_t)0x60), TIM5_OCMode_PWM2 = ((uint8_t)0x70)
}
enum  TIM5_OCPolarity_TypeDef { TIM5_OCPolarity_High = ((uint8_t)0x00), TIM5_OCPolarity_Low = ((uint8_t)0x01) }
enum  TIM5_OPMode_TypeDef { TIM5_OPMode_Single = ((uint8_t)0x01), TIM5_OPMode_Repetitive = ((uint8_t)0x00) }
enum  TIM5_OSSIState_TypeDef { TIM5_OSSIState_Enable = ((uint8_t)0x04), TIM5_OSSIState_Disable = ((uint8_t)0x00) }
enum  TIM5_OutputState_TypeDef { TIM5_OutputState_Disable = ((uint8_t)0x00), TIM5_OutputState_Enable = ((uint8_t)0x01) }
enum  TIM5_Prescaler_TypeDef {
  TIM5_Prescaler_1 = ((uint8_t)0x00), TIM5_Prescaler_2 = ((uint8_t)0x01), TIM5_Prescaler_4 = ((uint8_t)0x02), TIM5_Prescaler_8 = ((uint8_t)0x03),
  TIM5_Prescaler_16 = ((uint8_t)0x04), TIM5_Prescaler_32 = ((uint8_t)0x05), TIM5_Prescaler_64 = ((uint8_t)0x06), TIM5_Prescaler_128 = ((uint8_t)0x07)
}
enum  TIM5_PSCReloadMode_TypeDef { TIM5_PSCReloadMode_Update = ((uint8_t)0x00), TIM5_PSCReloadMode_Immediate = ((uint8_t)0x01) }
enum  TIM5_SlaveMode_TypeDef { TIM5_SlaveMode_Reset = ((uint8_t)0x04), TIM5_SlaveMode_Gated = ((uint8_t)0x05), TIM5_SlaveMode_Trigger = ((uint8_t)0x06), TIM5_SlaveMode_External1 = ((uint8_t)0x07) }
enum  TIM5_TIxExternalCLK1Source_TypeDef { TIM5_TIxExternalCLK1Source_TI1ED = ((uint8_t)0x40), TIM5_TIxExternalCLK1Source_TI1 = ((uint8_t)0x50), TIM5_TIxExternalCLK1Source_TI2 = ((uint8_t)0x60) }
enum  TIM5_TRGOSource_TypeDef {
  TIM5_TRGOSource_Reset = ((uint8_t)0x00), TIM5_TRGOSource_Enable = ((uint8_t)0x10), TIM5_TRGOSource_Update = ((uint8_t)0x20), TIM5_TRGOSource_OC1 = ((uint8_t)0x30),
  TIM5_TRGOSource_OC1REF = ((uint8_t)0x40), TIM5_TRGOSource_OC2REF = ((uint8_t)0x50)
}
enum  TIM5_TRGSelection_TypeDef {
  TIM5_TRGSelection_TIM4 = ((uint8_t)0x00), TIM5_TRGSelection_TIM1 = ((uint8_t)0x10), TIM5_TRGSelection_TIM3 = ((uint8_t)0x20), TIM5_TRGSelection_TIM2 = ((uint8_t)0x30),
  TIM5_TRGSelection_TI1F_ED = ((uint8_t)0x40), TIM5_TRGSelection_TI1FP1 = ((uint8_t)0x50), TIM5_TRGSelection_TI2FP2 = ((uint8_t)0x60), TIM5_TRGSelection_ETRF = ((uint8_t)0x70)
}
enum  TIM5_UpdateSource_TypeDef { TIM5_UpdateSource_Global = ((uint8_t)0x00), TIM5_UpdateSource_Regular = ((uint8_t)0x01) }

Functions

void TIM5_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM5 peripheral Preload register on ARR.
void TIM5_BKRConfig (TIM5_OSSIState_TypeDef TIM5_OSSIState, TIM5_LockLevel_TypeDef TIM5_LockLevel, TIM5_BreakState_TypeDef TIM5_BreakState, TIM5_BreakPolarity_TypeDef TIM5_BreakPolarity, TIM5_AutomaticOutput_TypeDef TIM5_AutomaticOutput)
 Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
void TIM5_CCxCmd (TIM5_Channel_TypeDef TIM5_Channel, FunctionalState NewState)
 Enables or disables the TIM5 Capture Compare Channel x.
void TIM5_ClearFlag (TIM5_FLAG_TypeDef TIM5_FLAG)
 Clears the TIM�s pending flags.
void TIM5_ClearITPendingBit (TIM5_IT_TypeDef TIM5_IT)
 Clears the TIM's interrupt pending bits.
void TIM5_Cmd (FunctionalState NewState)
 Enables or disables the TIM5 peripheral.
void TIM5_CounterModeConfig (TIM5_CounterMode_TypeDef TIM5_CounterMode)
 Specifies the TIM5 Counter Mode to be used.
void TIM5_CtrlPWMOutputs (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Main Outputs.
void TIM5_DeInit (void)
 Deinitialize the TIM5 peripheral registers to their default reset values.
void TIM5_DMACmd (TIM5_DMASource_TypeDef TIM5_DMASource, FunctionalState NewState)
 Enables or disables the TIM5 DMA Requests.
void TIM5_EncoderInterfaceConfig (TIM5_EncoderMode_TypeDef TIM5_EncoderMode, TIM5_ICPolarity_TypeDef TIM5_IC1Polarity, TIM5_ICPolarity_TypeDef TIM5_IC2Polarity)
 Configures the TIM5 Encoder Interface.
void TIM5_ETRClockMode1Config (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External clock Mode1.
void TIM5_ETRClockMode2Config (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External clock Mode2.
void TIM5_ETRConfig (TIM5_ExtTRGPSC_TypeDef TIM5_ExtTRGPrescaler, TIM5_ExtTRGPolarity_TypeDef TIM5_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM5 External Trigger.
void TIM5_ForcedOC1Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction)
 Forces the TIM5 Channel1 output waveform to active or inactive level.
void TIM5_ForcedOC2Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction)
 Forces the TIM5 Channel2 output waveform to active or inactive level.
void TIM5_GenerateEvent (TIM5_EventSource_TypeDef TIM5_EventSource)
 Configures the TIM5 event to be generated by software.
uint16_t TIM5_GetCapture1 (void)
 Gets the TIM5 Input Capture 1 value.
uint16_t TIM5_GetCapture2 (void)
 Gets the TIM5 Input Capture 2 value.
uint16_t TIM5_GetCounter (void)
 Gets the TIM5 Counter value.
FlagStatus TIM5_GetFlagStatus (TIM5_FLAG_TypeDef TIM5_FLAG)
 Checks whether the specified TIM5 flag is set or not.
ITStatus TIM5_GetITStatus (TIM5_IT_TypeDef TIM5_IT)
 Checks whether the TIM5 interrupt has occurred or not.
TIM5_Prescaler_TypeDef TIM5_GetPrescaler (void)
 Gets the TIM5 Prescaler value.
void TIM5_ICInit (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter)
 Initializes the TIM5 peripheral according to the specified parameters.
void TIM5_InternalClockConfig (void)
 Enables the TIM5 internal Clock.
void TIM5_ITConfig (TIM5_IT_TypeDef TIM5_IT, FunctionalState NewState)
 Enables or disables the specified TIM5 interrupts.
void TIM5_OC1FastConfig (FunctionalState NewState)
 Configures the TIM5 Capture Compare 1 Fast feature.
void TIM5_OC1Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity, TIM5_OCIdleState_TypeDef TIM5_OCIdleState)
 Initializes the TIM5 Channel1 according to the specified parameters.
void TIM5_OC1PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity)
 Configures the TIM5 Channel 1 polarity.
void TIM5_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Preload Register on CCR1.
void TIM5_OC2FastConfig (FunctionalState NewState)
 Configures the TIM5 Capture Compare 2 Fast feature.
void TIM5_OC2Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity, TIM5_OCIdleState_TypeDef TIM5_OCIdleState)
 Initializes the TIM5 Channel2 according to the specified parameters.
void TIM5_OC2PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity)
 Configures the TIM5 Channel 2 polarity.
void TIM5_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM5 peripheral Preload Register on CCR2.
void TIM5_PrescalerConfig (TIM5_Prescaler_TypeDef Prescaler, TIM5_PSCReloadMode_TypeDef TIM5_PSCReloadMode)
 Configures the TIM5 Prescaler.
void TIM5_PWMIConfig (TIM5_Channel_TypeDef TIM5_Channel, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, TIM5_ICSelection_TypeDef TIM5_ICSelection, TIM5_ICPSC_TypeDef TIM5_ICPrescaler, uint8_t TIM5_ICFilter)
 Configures the TIM5 peripheral in PWM Input Mode according to the specified parameters.
void TIM5_SelectCCDMA (FunctionalState NewState)
 Selects the TIM5 peripheral Capture Compare DMA source.
void TIM5_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM�s Hall sensor interface.
void TIM5_SelectInputTrigger (TIM5_TRGSelection_TypeDef TIM5_InputTriggerSource)
 Selects the TIM5 Input Trigger source.
void TIM5_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM5 Master/Slave Mode.
void TIM5_SelectOCxM (TIM5_Channel_TypeDef TIM5_Channel, TIM5_OCMode_TypeDef TIM5_OCMode)
 Selects the TIM5 Output Compare Mode.
void TIM5_SelectOnePulseMode (TIM5_OPMode_TypeDef TIM5_OPMode)
 Selects the TIM�s One Pulse Mode.
void TIM5_SelectOutputTrigger (TIM5_TRGOSource_TypeDef TIM5_TRGOSource)
 Selects the TIM5 Trigger Output Mode.
void TIM5_SelectSlaveMode (TIM5_SlaveMode_TypeDef TIM5_SlaveMode)
 Selects the TIM5 Slave Mode.
void TIM5_SetAutoreload (uint16_t Autoreload)
 Sets the TIM5 Autoreload Register value.
void TIM5_SetCompare1 (uint16_t Compare)
 Sets the TIM5 Capture Compare1 Register value.
void TIM5_SetCompare2 (uint16_t Compare)
 Sets the TIM5 Capture Compare2 Register value.
void TIM5_SetCounter (uint16_t Counter)
 Sets the TIM5 Counter Register value.
void TIM5_SetIC1Prescaler (TIM5_ICPSC_TypeDef TIM5_IC1Prescaler)
 Sets the TIM5 Input Capture 1 prescaler.
void TIM5_SetIC2Prescaler (TIM5_ICPSC_TypeDef TIM5_IC2Prescaler)
 Sets the TIM5 Input Capture 2 prescaler.
void TIM5_TimeBaseInit (TIM5_Prescaler_TypeDef TIM5_Prescaler, TIM5_CounterMode_TypeDef TIM5_CounterMode, uint16_t TIM5_Period)
 Initializes the TIM5 Time Base Unit according to the specified parameters.
void TIM5_TIxExternalClockConfig (TIM5_TIxExternalCLK1Source_TypeDef TIM5_TIxExternalCLKSource, TIM5_ICPolarity_TypeDef TIM5_ICPolarity, uint8_t ICFilter)
 Configures the TIM5 Trigger as External Clock.
void TIM5_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM5 Update event.
void TIM5_UpdateRequestConfig (TIM5_UpdateSource_TypeDef TIM5_UpdateSource)
 Selects the TIM5 Update Request Interrupt source.

Detailed Description

This file contains all the functions prototypes for the TIM5 firmware library.

Author:
MCD Application Team
Version:
V1.5.0
Date:
13-May-2011
Attention:

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

© COPYRIGHT 2011 STMicroelectronics

Definition in file stm8l15x_tim5.h.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com