STM8S/A Standard Peripherals Drivers
|
This file contains all functions prototype and macros for the TIM5 peripheral. More...
#include "stm8s.h"
Go to the source code of this file.
Defines | |
#define | IS_TIM5_CHANNEL_OK(CHANNEL) |
#define | IS_TIM5_CLEAR_FLAG_OK(FLAG) ((((uint16_t)(FLAG) & 0xF1F0) == 0x0000) && ((uint16_t)(FLAG) != 0x0000)) |
#define | IS_TIM5_ENCODER_MODE_OK(MODE) |
Macro TIM5 encoder mode. | |
#define | IS_TIM5_EVENT_SOURCE_OK(SOURCE) (((SOURCE) != 0x00)) |
#define | IS_TIM5_EXT_FILTER_OK(EXTFILTER) ((EXTFILTER) <= 0x0F) |
Macro TIM5 External Trigger Filter. | |
#define | IS_TIM5_EXT_POLARITY_OK(POLARITY) |
Macro TIM5 Trigger Polarity. | |
#define | IS_TIM5_EXT_PRESCALER_OK(PRESCALER) |
Macro TIM5 external trigger prescaler. | |
#define | IS_TIM5_FORCED_ACTION_OK(ACTION) |
#define | IS_TIM5_GET_FLAG_OK(FLAG) |
#define | IS_TIM5_GET_IT_OK(IT) |
#define | IS_TIM5_IC_FILTER_OK(ICFILTER) ((ICFILTER) <= 0x0F) |
TIM5 Input Capture Filer Value. | |
#define | IS_TIM5_IC_POLARITY_OK(POLARITY) |
#define | IS_TIM5_IC_PRESCALER_OK(PRESCALER) |
#define | IS_TIM5_IC_SELECTION1_OK(SELECTION) |
#define | IS_TIM5_IC_SELECTION_OK(SELECTION) |
#define | IS_TIM5_IT_OK(IT) (((IT) != 0x00) && ((IT) <= 0x4F)) |
#define | IS_TIM5_OC_MODE_OK(MODE) |
#define | IS_TIM5_OC_POLARITY_OK(POLARITY) |
#define | IS_TIM5_OCM_OK(MODE) |
#define | IS_TIM5_OPM_MODE_OK(MODE) |
#define | IS_TIM5_OUTPUT_STATE_OK(STATE) |
#define | IS_TIM5_PRESCALER_OK(PRESCALER) |
#define | IS_TIM5_PRESCALER_RELOAD_OK(RELOAD) |
#define | IS_TIM5_PWMI_CHANNEL_OK(CHANNEL) |
#define | IS_TIM5_SLAVE_MODE_OK(MODE) |
Macro TIM5 Slave mode. | |
#define | IS_TIM5_TIX_TRIGGER_SELECTION_OK(SELECTION) |
#define | IS_TIM5_TRGO_SOURCE_OK(SOURCE) |
Macro TIM5 TRGO source. | |
#define | IS_TIM5_TRIGGER_SELECTION_OK(SELECTION) |
Macro TIM5 Trigger Selection. | |
#define | IS_TIM5_UPDATE_SOURCE_OK(SOURCE) |
Enumerations | |
enum | TIM5_Channel_TypeDef { TIM5_CHANNEL_1 = ((uint8_t)0x00), TIM5_CHANNEL_2 = ((uint8_t)0x01), TIM5_CHANNEL_3 = ((uint8_t)0x02) } |
TIM5 Channel. More... | |
enum | TIM5_EncoderMode_TypeDef { TIM5_ENCODERMODE_TI1 = ((uint8_t)0x01), TIM5_ENCODERMODE_TI2 = ((uint8_t)0x02), TIM5_ENCODERMODE_TI12 = ((uint8_t)0x03) } |
TIM5 Encoder Mode. More... | |
enum | TIM5_EventSource_TypeDef { TIM5_EVENTSOURCE_UPDATE = ((uint8_t)0x01), TIM5_EVENTSOURCE_CC1 = ((uint8_t)0x02), TIM5_EVENTSOURCE_CC2 = ((uint8_t)0x04), TIM5_EVENTSOURCE_CC3 = ((uint8_t)0x08), TIM5_EVENTSOURCE_TRIGGER = ((uint8_t)0x40) } |
TIM5 Event Source. More... | |
enum | TIM5_ExtTRGPolarity_TypeDef { TIM5_EXTTRGPOLARITY_INVERTED = ((uint8_t)0x80), TIM5_EXTTRGPOLARITY_NONINVERTED = ((uint8_t)0x00) } |
TIM5 External Trigger Polarity. More... | |
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) } |
TIM5 External Trigger Prescaler. More... | |
enum | TIM5_FLAG_TypeDef { TIM5_FLAG_UPDATE = ((uint16_t)0x0001), TIM5_FLAG_CC1 = ((uint16_t)0x0002), TIM5_FLAG_CC2 = ((uint16_t)0x0004), TIM5_FLAG_CC3 = ((uint16_t)0x0008), TIM5_FLAG_TRIGGER = ((uint16_t)0x0040), TIM5_FLAG_CC1OF = ((uint16_t)0x0200), TIM5_FLAG_CC2OF = ((uint16_t)0x0400), TIM5_FLAG_CC3OF = ((uint16_t)0x0800) } |
TIM5 Flags. More... | |
enum | TIM5_ForcedAction_TypeDef { TIM5_FORCEDACTION_ACTIVE = ((uint8_t)0x50), TIM5_FORCEDACTION_INACTIVE = ((uint8_t)0x40) } |
TIM5 Forced Action. More... | |
enum | TIM5_ICPolarity_TypeDef { TIM5_ICPOLARITY_RISING = ((uint8_t)0x00), TIM5_ICPOLARITY_FALLING = ((uint8_t)0x44) } |
TIM5 Input Capture Polarity. More... | |
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) } |
TIM5 Input Capture Prescaler. More... | |
enum | TIM5_ICSelection_TypeDef { TIM5_ICSELECTION_DIRECTTI = ((uint8_t)0x01), TIM5_ICSELECTION_INDIRECTTI = ((uint8_t)0x02), TIM5_ICSELECTION_TRGI = ((uint8_t)0x03) } |
TIM5 Input Capture Selection. More... | |
enum | TIM5_IT_TypeDef { TIM5_IT_UPDATE = ((uint8_t)0x01), TIM5_IT_CC1 = ((uint8_t)0x02), TIM5_IT_CC2 = ((uint8_t)0x04), TIM5_IT_CC3 = ((uint8_t)0x08), TIM5_IT_TRIGGER = ((uint8_t)0x40) } |
TIM5 interrupt sources. More... | |
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) } |
TIM5 Output Compare and PWM modes. More... | |
enum | TIM5_OCPolarity_TypeDef { TIM5_OCPOLARITY_HIGH = ((uint8_t)0x00), TIM5_OCPOLARITY_LOW = ((uint8_t)0x22) } |
TIM5 Output Compare Polarity. More... | |
enum | TIM5_OPMode_TypeDef { TIM5_OPMODE_SINGLE = ((uint8_t)0x01), TIM5_OPMODE_REPETITIVE = ((uint8_t)0x00) } |
TIM5 One Pulse Mode. More... | |
enum | TIM5_OutputState_TypeDef { TIM5_OUTPUTSTATE_DISABLE = ((uint8_t)0x00), TIM5_OUTPUTSTATE_ENABLE = ((uint8_t)0x11) } |
TIM5 Output Compare states. More... | |
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), TIM5_PRESCALER_256 = ((uint8_t)0x08), TIM5_PRESCALER_512 = ((uint8_t)0x09), TIM5_PRESCALER_1024 = ((uint8_t)0x0A), TIM5_PRESCALER_2048 = ((uint8_t)0x0B), TIM5_PRESCALER_4096 = ((uint8_t)0x0C), TIM5_PRESCALER_8192 = ((uint8_t)0x0D), TIM5_PRESCALER_16384 = ((uint8_t)0x0E), TIM5_PRESCALER_32768 = ((uint8_t)0x0F) } |
TIM5 Prescaler. More... | |
enum | TIM5_PSCReloadMode_TypeDef { TIM5_PSCRELOADMODE_UPDATE = ((uint8_t)0x00), TIM5_PSCRELOADMODE_IMMEDIATE = ((uint8_t)0x01) } |
TIM5 Prescaler Reload Mode. More... | |
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) } |
TIM5 Slave Mode. More... | |
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) } |
TIM5 Trigger Output Source. More... | |
enum | TIM5_TS_TypeDef { TIM5_TS_TIM6 = ((uint8_t)0x00), TIM5_TS_TIM1 = ((uint8_t)0x03) } |
TIM5 Internal Trigger Selection. More... | |
enum | TIM5_UpdateSource_TypeDef { TIM5_UPDATESOURCE_GLOBAL = ((uint8_t)0x00), TIM5_UPDATESOURCE_REGULAR = ((uint8_t)0x01) } |
TIM5 Update Source. More... | |
Functions | |
void | TIM5_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM5 peripheral Preload register on ARR. | |
void | TIM5_CCPreloadControl (FunctionalState NewState) |
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 TIM5�s pending flags. | |
void | TIM5_ClearITPendingBit (TIM5_IT_TypeDef TIM5_IT) |
Clears the TIM5's interrupt pending bits. | |
void | TIM5_Cmd (FunctionalState NewState) |
Enables or disables the TIM5 peripheral. | |
void | TIM5_DeInit (void) |
Deinitializes the TIM5 peripheral registers to their default reset values. | |
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_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_ForcedOC3Config (TIM5_ForcedAction_TypeDef TIM5_ForcedAction) |
Forces the TIM5 Channel3 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_GetCapture3 (void) |
Gets the TIM5 Input Capture 3 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_OC1Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
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_OC2Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
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_OC3Init (TIM5_OCMode_TypeDef TIM5_OCMode, TIM5_OutputState_TypeDef TIM5_OutputState, uint16_t TIM5_Pulse, TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Initializes the TIM5 Channel3 according to the specified parameters. | |
void | TIM5_OC3PolarityConfig (TIM5_OCPolarity_TypeDef TIM5_OCPolarity) |
Configures the TIM5 Channel 3 polarity. | |
void | TIM5_OC3PreloadConfig (FunctionalState NewState) |
Enables or disables the TIM5 peripheral Preload Register on CCR3. | |
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_SelectInputTrigger (TIM5_TS_TypeDef TIM5_InputTriggerSource) |
Selects the TIM5 Input Trigger source. | |
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 TIM5�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 Compare1) |
Sets the TIM5 Capture Compare1 Register value. | |
void | TIM5_SetCompare2 (uint16_t Compare2) |
Sets the TIM5 Capture Compare2 Register value. | |
void | TIM5_SetCompare3 (uint16_t Compare3) |
Sets the TIM5 Capture Compare3 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_SetIC3Prescaler (TIM5_ICPSC_TypeDef TIM5_IC3Prescaler) |
Sets the TIM5 Input Capture 3 prescaler. | |
void | TIM5_TimeBaseInit (TIM5_Prescaler_TypeDef TIM5_Prescaler, uint16_t TIM5_Period) |
Initializes the TIM5 Time Base Unit according to the specified parameters. | |
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 functions prototype and macros for the TIM5 peripheral.
- Attention:
© COPYRIGHT 2014 STMicroelectronics
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.st.com/software_license_agreement_liberty_v2
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file stm8s_tim5.h.