STM8L15x Standard Peripherals Drivers: stm8l15x_tim3.h File Reference

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

stm8l15x_tim3.h File Reference

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

#include "stm8l15x.h"

Go to the source code of this file.

Defines

#define IS_TIM3_AUTOMATIC_OUTPUT_STATE(STATE)
 Macro TIM3 AOE Bit Set/Reset.
#define IS_TIM3_BREAK_POLARITY(POLARITY)
 Macro Break Polarity.
#define IS_TIM3_BREAK_STATE(STATE)
 Macro Break Input enable/disable.
#define IS_TIM3_CHANNEL(CHANNEL)
 Macro TIM3 Channel.
#define IS_TIM3_CLEAR_FLAG(FLAG)   ((((FLAG) & (uint16_t)0xE100) == 0x0000) && ((FLAG) != 0x0000))
#define IS_TIM3_COUNTER_MODE(MODE)
 Macro TIM3 Counter Mode.
#define IS_TIM3_DMA_SOURCE(SOURCE)
 Macro TIM3 DMA sources.
#define IS_TIM3_ENCODER_MODE(MODE)
 Macro TIM3 encoder mode.
#define IS_TIM3_EVENT_SOURCE(SOURCE)   ((((SOURCE) & (uint8_t)0x18) == 0x00) && ((SOURCE) != 0x00))
 Macro TIM3 event source.
#define IS_TIM3_EXT_FILTER(EXTFILTER)   ((EXTFILTER) <= 0x0F)
 Macro TIM3 External Trigger Filter.
#define IS_TIM3_EXT_POLARITY(POLARITY)
 Macro TIM3 Trigger Polarity.
#define IS_TIM3_EXT_PRESCALER(PRESCALER)
 Macro TIM3 external trigger prescaler.
#define IS_TIM3_FORCED_ACTION(ACTION)
 Macro used by the assert function to check the different functions parameters.
#define IS_TIM3_GET_FLAG(FLAG)
 Macro TIM3 Flags.
#define IS_TIM3_GET_IT(IT)
#define IS_TIM3_IC_FILTER(ICFILTER)   ((ICFILTER) <= 0x0F)
 Macro TIM3 Input Capture Filter Value.
#define IS_TIM3_IC_POLARITY(POLARITY)
 Macro TIM3 IC POLARITY.
#define IS_TIM3_IC_PRESCALER(PRESCALER)
 Macro TIM3 IC PRESCALER.
#define IS_TIM3_IC_SELECTION(SELECTION)
 Macro TIM3 IC SELECTION.
#define IS_TIM3_IT(IT)   ((IT) != 0x00)
 Macro TIM3 Interrupts.
#define IS_TIM3_LOCK_LEVEL(LEVEL)
 Macro Lock levels.
#define IS_TIM3_OC_MODE(MODE)
 Macro TIM3 Output Compare and PWM modes.
#define IS_TIM3_OC_POLARITY(POLARITY)
 Macro TIM3 Output Compare Polarity.
#define IS_TIM3_OCIDLE_STATE(STATE)
 Macro TIM3 OC IDLE STATE.
#define IS_TIM3_OCM(MODE)
#define IS_TIM3_OPM_MODE(MODE)
 Macro TIM3 One Pulse Mode.
#define IS_TIM3_OSSI_STATE(STATE)
 Macro OSSI: Off-State Selection for Idle mode states.
#define IS_TIM3_OUTPUT_STATE(STATE)
 Macro TIM3 Output Compare states.
#define IS_TIM3_PRESCALER(PRESCALER)
 Macro TIM3 Prescaler.
#define IS_TIM3_PRESCALER_RELOAD(RELOAD)
 Macro TIM3 Prescaler Reload.
#define IS_TIM3_SLAVE_MODE(MODE)
 Macro TIM3 Slave mode.
#define IS_TIM3_TIX_TRIGGER_SELECTION(SELECTION)
#define IS_TIM3_TIXCLK_SOURCE(SOURCE)
 Macro TIM3 TIx external Clock Selection.
#define IS_TIM3_TRGO_SOURCE(SOURCE)
 Macro TIM3 TRGO source.
#define IS_TIM3_TRIGGER_SELECTION(SELECTION)
 Macro TIM3 Trigger Selection.
#define IS_TIM3_UPDATE_SOURCE(SOURCE)
 Macro TIM3 update source.

Enumerations

enum  TIM3_AutomaticOutput_TypeDef { TIM3_AutomaticOutput_Enable = ((uint8_t)0x40), TIM3_AutomaticOutput_Disable = ((uint8_t)0x00) }
enum  TIM3_BreakPolarity_TypeDef { TIM3_BreakPolarity_High = ((uint8_t)0x20), TIM3_BreakPolarity_Low = ((uint8_t)0x00) }
enum  TIM3_BreakState_TypeDef { TIM3_BreakState_Disable = ((uint8_t)0x00), TIM3_BreakState_Enable = ((uint8_t)0x10) }
enum  TIM3_Channel_TypeDef { TIM3_Channel_1 = ((uint8_t)0x00), TIM3_Channel_2 = ((uint8_t)0x01) }
enum  TIM3_CounterMode_TypeDef {
  TIM3_CounterMode_Up = ((uint8_t)0x00), TIM3_CounterMode_Down = ((uint8_t)0x10), TIM3_CounterMode_CenterAligned1 = ((uint8_t)0x20), TIM3_CounterMode_CenterAligned2 = ((uint8_t)0x40),
  TIM3_CounterMode_CenterAligned3 = ((uint8_t)0x60)
}
enum  TIM3_DMASource_TypeDef { TIM3_DMASource_Update = ((uint8_t)0x01), TIM3_DMASource_CC1 = ((uint8_t)0x02), TIM3_DMASource_CC2 = ((uint8_t)0x04) }
enum  TIM3_EncoderMode_TypeDef { TIM3_EncoderMode_TI1 = ((uint8_t)0x01), TIM3_EncoderMode_TI2 = ((uint8_t)0x02), TIM3_EncoderMode_TI12 = ((uint8_t)0x03) }
enum  TIM3_EventSource_TypeDef {
  TIM3_EventSource_Update = ((uint8_t)0x01), TIM3_EventSource_CC1 = ((uint8_t)0x02), TIM3_EventSource_CC2 = ((uint8_t)0x04), TIM3_EventSource_Trigger = ((uint8_t)0x40),
  TIM3_EventSource_Break = ((uint8_t)0x80)
}
enum  TIM3_ExtTRGPolarity_TypeDef { TIM3_ExtTRGPolarity_Inverted = ((uint8_t)0x80), TIM3_ExtTRGPolarity_NonInverted = ((uint8_t)0x00) }
enum  TIM3_ExtTRGPSC_TypeDef { TIM3_ExtTRGPSC_OFF = ((uint8_t)0x00), TIM3_ExtTRGPSC_DIV2 = ((uint8_t)0x10), TIM3_ExtTRGPSC_DIV4 = ((uint8_t)0x20), TIM3_ExtTRGPSC_DIV8 = ((uint8_t)0x30) }
enum  TIM3_FLAG_TypeDef {
  TIM3_FLAG_Update = ((uint16_t)0x0001), TIM3_FLAG_CC1 = ((uint16_t)0x0002), TIM3_FLAG_CC2 = ((uint16_t)0x0004), TIM3_FLAG_Trigger = ((uint16_t)0x0040),
  TIM3_FLAG_Break = ((uint16_t)0x0080), TIM3_FLAG_CC1OF = ((uint16_t)0x0200), TIM3_FLAG_CC2OF = ((uint16_t)0x0400)
}
enum  TIM3_ForcedAction_TypeDef { TIM3_ForcedAction_Active = ((uint8_t)0x50), TIM3_ForcedAction_Inactive = ((uint8_t)0x40) }
enum  TIM3_ICPolarity_TypeDef { TIM3_ICPolarity_Rising = ((uint8_t)0x00), TIM3_ICPolarity_Falling = ((uint8_t)0x01) }
enum  TIM3_ICPSC_TypeDef { TIM3_ICPSC_DIV1 = ((uint8_t)0x00), TIM3_ICPSC_DIV2 = ((uint8_t)0x04), TIM3_ICPSC_DIV4 = ((uint8_t)0x08), TIM3_ICPSC_DIV8 = ((uint8_t)0x0C) }
enum  TIM3_ICSelection_TypeDef { TIM3_ICSelection_DirectTI = ((uint8_t)0x01), TIM3_ICSelection_IndirectTI = ((uint8_t)0x02), TIM3_ICSelection_TRGI = ((uint8_t)0x03) }
enum  TIM3_IT_TypeDef {
  TIM3_IT_Update = ((uint8_t)0x01), TIM3_IT_CC1 = ((uint8_t)0x02), TIM3_IT_CC2 = ((uint8_t)0x04), TIM3_IT_Trigger = ((uint8_t)0x40),
  TIM3_IT_Break = ((uint8_t)0x80)
}
enum  TIM3_LockLevel_TypeDef { TIM3_LockLevel_Off = ((uint8_t)0x00), TIM3_LockLevel_1 = ((uint8_t)0x01), TIM3_LockLevel_2 = ((uint8_t)0x02), TIM3_LockLevel_3 = ((uint8_t)0x03) }
enum  TIM3_OCIdleState_TypeDef { TIM3_OCIdleState_Reset = ((uint8_t)0x00), TIM3_OCIdleState_Set = ((uint8_t)0x01) }
enum  TIM3_OCMode_TypeDef {
  TIM3_OCMode_Timing = ((uint8_t)0x00), TIM3_OCMode_Active = ((uint8_t)0x10), TIM3_OCMode_Inactive = ((uint8_t)0x20), TIM3_OCMode_Toggle = ((uint8_t)0x30),
  TIM3_OCMode_PWM1 = ((uint8_t)0x60), TIM3_OCMode_PWM2 = ((uint8_t)0x70)
}
enum  TIM3_OCPolarity_TypeDef { TIM3_OCPolarity_High = ((uint8_t)0x00), TIM3_OCPolarity_Low = ((uint8_t)0x01) }
enum  TIM3_OPMode_TypeDef { TIM3_OPMode_Single = ((uint8_t)0x01), TIM3_OPMode_Repetitive = ((uint8_t)0x00) }
enum  TIM3_OSSIState_TypeDef { TIM3_OSSIState_Enable = ((uint8_t)0x04), TIM3_OSSIState_Disable = ((uint8_t)0x00) }
enum  TIM3_OutputState_TypeDef { TIM3_OutputState_Disable = ((uint8_t)0x00), TIM3_OutputState_Enable = ((uint8_t)0x01) }
enum  TIM3_Prescaler_TypeDef {
  TIM3_Prescaler_1 = ((uint8_t)0x00), TIM3_Prescaler_2 = ((uint8_t)0x01), TIM3_Prescaler_4 = ((uint8_t)0x02), TIM3_Prescaler_8 = ((uint8_t)0x03),
  TIM3_Prescaler_16 = ((uint8_t)0x04), TIM3_Prescaler_32 = ((uint8_t)0x05), TIM3_Prescaler_64 = ((uint8_t)0x06), TIM3_Prescaler_128 = ((uint8_t)0x07)
}
enum  TIM3_PSCReloadMode_TypeDef { TIM3_PSCReloadMode_Update = ((uint8_t)0x00), TIM3_PSCReloadMode_Immediate = ((uint8_t)0x01) }
enum  TIM3_SlaveMode_TypeDef { TIM3_SlaveMode_Reset = ((uint8_t)0x04), TIM3_SlaveMode_Gated = ((uint8_t)0x05), TIM3_SlaveMode_Trigger = ((uint8_t)0x06), TIM3_SlaveMode_External1 = ((uint8_t)0x07) }
enum  TIM3_TIxExternalCLK1Source_TypeDef { TIM3_TIxExternalCLK1Source_TI1ED = ((uint8_t)0x40), TIM3_TIxExternalCLK1Source_TI1 = ((uint8_t)0x50), TIM3_TIxExternalCLK1Source_TI2 = ((uint8_t)0x60) }
enum  TIM3_TRGOSource_TypeDef {
  TIM3_TRGOSource_Reset = ((uint8_t)0x00), TIM3_TRGOSource_Enable = ((uint8_t)0x10), TIM3_TRGOSource_Update = ((uint8_t)0x20), TIM3_TRGOSource_OC1 = ((uint8_t)0x30),
  TIM3_TRGOSource_OC1REF = ((uint8_t)0x40), TIM3_TRGOSource_OC2REF = ((uint8_t)0x50)
}
enum  TIM3_TRGSelection_TypeDef {
  TIM3_TRGSelection_TIM4 = ((uint8_t)0x00), TIM3_TRGSelection_TIM1 = ((uint8_t)0x10), TIM3_TRGSelection_TIM5 = ((uint8_t)0x20), TIM3_TRGSelection_TIM2 = ((uint8_t)0x30),
  TIM3_TRGSelection_TI1F_ED = ((uint8_t)0x40), TIM3_TRGSelection_TI1FP1 = ((uint8_t)0x50), TIM3_TRGSelection_TI2FP2 = ((uint8_t)0x60), TIM3_TRGSelection_ETRF = ((uint8_t)0x70)
}
enum  TIM3_UpdateSource_TypeDef { TIM3_UpdateSource_Global = ((uint8_t)0x00), TIM3_UpdateSource_Regular = ((uint8_t)0x01) }

Functions

void TIM3_ARRPreloadConfig (FunctionalState NewState)
 Enables or disables TIM3 peripheral Preload register on ARR.
void TIM3_BKRConfig (TIM3_OSSIState_TypeDef TIM3_OSSIState, TIM3_LockLevel_TypeDef TIM3_LockLevel, TIM3_BreakState_TypeDef TIM3_BreakState, TIM3_BreakPolarity_TypeDef TIM3_BreakPolarity, TIM3_AutomaticOutput_TypeDef TIM3_AutomaticOutput)
 Configures the Break feature, dead time, Lock level, the OSSI, and the AOE(automatic output enable).
void TIM3_CCxCmd (TIM3_Channel_TypeDef TIM3_Channel, FunctionalState NewState)
 Enables or disables the TIM3 Capture Compare Channel x.
void TIM3_ClearFlag (TIM3_FLAG_TypeDef TIM3_FLAG)
 Clears the TIM�s pending flags.
void TIM3_ClearITPendingBit (TIM3_IT_TypeDef TIM3_IT)
 Clears the TIM's interrupt pending bits.
void TIM3_Cmd (FunctionalState NewState)
 Enables or disables the TIM3 peripheral.
void TIM3_CounterModeConfig (TIM3_CounterMode_TypeDef TIM3_CounterMode)
 Specifies the TIM3 Counter Mode to be used.
void TIM3_CtrlPWMOutputs (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Main Outputs.
void TIM3_DeInit (void)
 Deinitialize the TIM3 peripheral registers to their default reset values.
void TIM3_DMACmd (TIM3_DMASource_TypeDef TIM3_DMASource, FunctionalState NewState)
 Enables or disables the TIM3 DMA Requests.
void TIM3_EncoderInterfaceConfig (TIM3_EncoderMode_TypeDef TIM3_EncoderMode, TIM3_ICPolarity_TypeDef TIM3_IC1Polarity, TIM3_ICPolarity_TypeDef TIM3_IC2Polarity)
 Configures the TIM3 Encoder Interface.
void TIM3_ETRClockMode1Config (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External clock Mode1.
void TIM3_ETRClockMode2Config (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External clock Mode2.
void TIM3_ETRConfig (TIM3_ExtTRGPSC_TypeDef TIM3_ExtTRGPrescaler, TIM3_ExtTRGPolarity_TypeDef TIM3_ExtTRGPolarity, uint8_t ExtTRGFilter)
 Configures the TIM3 External Trigger.
void TIM3_ForcedOC1Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel1 output waveform to active or inactive level.
void TIM3_ForcedOC2Config (TIM3_ForcedAction_TypeDef TIM3_ForcedAction)
 Forces the TIM3 Channel2 output waveform to active or inactive level.
void TIM3_GenerateEvent (TIM3_EventSource_TypeDef TIM3_EventSource)
 Configures the TIM3 event to be generated by software.
uint16_t TIM3_GetCapture1 (void)
 Gets the TIM3 Input Capture 1 value.
uint16_t TIM3_GetCapture2 (void)
 Gets the TIM3 Input Capture 2 value.
uint16_t TIM3_GetCounter (void)
 Gets the TIM3 Counter value.
FlagStatus TIM3_GetFlagStatus (TIM3_FLAG_TypeDef TIM3_FLAG)
 Checks whether the specified TIM3 flag is set or not.
ITStatus TIM3_GetITStatus (TIM3_IT_TypeDef TIM3_IT)
 Checks whether the TIM3 interrupt has occurred or not.
TIM3_Prescaler_TypeDef TIM3_GetPrescaler (void)
 Gets the TIM3 Prescaler value.
void TIM3_ICInit (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Initializes the TIM3 peripheral according to the specified parameters.
void TIM3_InternalClockConfig (void)
 Enables the TIM3 internal Clock.
void TIM3_ITConfig (TIM3_IT_TypeDef TIM3_IT, FunctionalState NewState)
 Enables or disables the specified TIM3 interrupts.
void TIM3_OC1FastConfig (FunctionalState NewState)
 Configures the TIM3 Capture Compare 1 Fast feature.
void TIM3_OC1Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity, TIM3_OCIdleState_TypeDef TIM3_OCIdleState)
 Initializes the TIM3 Channel1 according to the specified parameters.
void TIM3_OC1PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 1 polarity.
void TIM3_OC1PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR1.
void TIM3_OC2FastConfig (FunctionalState NewState)
 Configures the TIM3 Capture Compare 2 Fast feature.
void TIM3_OC2Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity, TIM3_OCIdleState_TypeDef TIM3_OCIdleState)
 Initializes the TIM3 Channel2 according to the specified parameters.
void TIM3_OC2PolarityConfig (TIM3_OCPolarity_TypeDef TIM3_OCPolarity)
 Configures the TIM3 Channel 2 polarity.
void TIM3_OC2PreloadConfig (FunctionalState NewState)
 Enables or disables the TIM3 peripheral Preload Register on CCR2.
void TIM3_PrescalerConfig (TIM3_Prescaler_TypeDef Prescaler, TIM3_PSCReloadMode_TypeDef TIM3_PSCReloadMode)
 Configures the TIM3 Prescaler.
void TIM3_PWMIConfig (TIM3_Channel_TypeDef TIM3_Channel, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, TIM3_ICSelection_TypeDef TIM3_ICSelection, TIM3_ICPSC_TypeDef TIM3_ICPrescaler, uint8_t TIM3_ICFilter)
 Configures the TIM3 peripheral in PWM Input Mode according to the specified parameters.
void TIM3_SelectCCDMA (FunctionalState NewState)
 Selects the TIM3 peripheral Capture Compare DMA source.
void TIM3_SelectHallSensor (FunctionalState NewState)
 Enables or Disables the TIM�s Hall sensor interface.
void TIM3_SelectInputTrigger (TIM3_TRGSelection_TypeDef TIM3_InputTriggerSource)
 Selects the TIM3 Input Trigger source.
void TIM3_SelectMasterSlaveMode (FunctionalState NewState)
 Sets or Resets the TIM3 Master/Slave Mode.
void TIM3_SelectOCxM (TIM3_Channel_TypeDef TIM3_Channel, TIM3_OCMode_TypeDef TIM3_OCMode)
 Selects the TIM3 Output Compare Mode.
void TIM3_SelectOnePulseMode (TIM3_OPMode_TypeDef TIM3_OPMode)
 Selects the TIM�s One Pulse Mode.
void TIM3_SelectOutputTrigger (TIM3_TRGOSource_TypeDef TIM3_TRGOSource)
 Selects the TIM3 Trigger Output Mode.
void TIM3_SelectSlaveMode (TIM3_SlaveMode_TypeDef TIM3_SlaveMode)
 Selects the TIM3 Slave Mode.
void TIM3_SetAutoreload (uint16_t Autoreload)
 Sets the TIM3 Autoreload Register value.
void TIM3_SetCompare1 (uint16_t Compare)
 Sets the TIM3 Capture Compare1 Register value.
void TIM3_SetCompare2 (uint16_t Compare)
 Sets the TIM3 Capture Compare2 Register value.
void TIM3_SetCounter (uint16_t Counter)
 Sets the TIM3 Counter Register value.
void TIM3_SetIC1Prescaler (TIM3_ICPSC_TypeDef TIM3_IC1Prescaler)
 Sets the TIM3 Input Capture 1 prescaler.
void TIM3_SetIC2Prescaler (TIM3_ICPSC_TypeDef TIM3_IC2Prescaler)
 Sets the TIM3 Input Capture 2 prescaler.
void TIM3_TimeBaseInit (TIM3_Prescaler_TypeDef TIM3_Prescaler, TIM3_CounterMode_TypeDef TIM3_CounterMode, uint16_t TIM3_Period)
 Initializes the TIM3 Time Base Unit according to the specified parameters.
void TIM3_TIxExternalClockConfig (TIM3_TIxExternalCLK1Source_TypeDef TIM3_TIxExternalCLKSource, TIM3_ICPolarity_TypeDef TIM3_ICPolarity, uint8_t ICFilter)
 Configures the TIM3 Trigger as External Clock.
void TIM3_UpdateDisableConfig (FunctionalState NewState)
 Enables or Disables the TIM3 Update event.
void TIM3_UpdateRequestConfig (TIM3_UpdateSource_TypeDef TIM3_UpdateSource)
 Selects the TIM3 Update Request Interrupt source.

Detailed Description

This file contains all the functions prototypes for the TIM3 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_tim3.h.

STM8S Firmware Library: Overview

 

 

 

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