STM8S/A Standard Peripherals Drivers
|
This file contains all functions prototype and macros for the TIM3 peripheral. More...
#include "stm8s.h"
Go to the source code of this file.
Defines | |
#define | IS_TIM3_CHANNEL_OK(CHANNEL) |
#define | IS_TIM3_CLEAR_FLAG_OK(FLAG) ((((uint16_t)(FLAG) & 0xF9F8) == 0x0000) && ((uint16_t)(FLAG)!= 0x0000)) |
#define | IS_TIM3_EVENT_SOURCE_OK(SOURCE) (((SOURCE) != 0x00)) |
#define | IS_TIM3_FORCED_ACTION_OK(ACTION) |
#define | IS_TIM3_GET_FLAG_OK(FLAG) |
#define | IS_TIM3_GET_IT_OK(IT) |
#define | IS_TIM3_IC_FILTER_OK(ICFILTER) ((ICFILTER) <= 0x0F) |
TIM3 Input Capture Filer Value. | |
#define | IS_TIM3_IC_POLARITY_OK(POLARITY) |
#define | IS_TIM3_IC_PRESCALER_OK(PRESCALER) |
#define | IS_TIM3_IC_SELECTION_OK(SELECTION) |
#define | IS_TIM3_IT_OK(IT) (((IT) != 0x00) && ((IT) <= 0x07)) |
#define | IS_TIM3_OC_MODE_OK(MODE) |
#define | IS_TIM3_OC_POLARITY_OK(POLARITY) |
#define | IS_TIM3_OCM_OK(MODE) |
#define | IS_TIM3_OPM_MODE_OK(MODE) |
#define | IS_TIM3_OUTPUT_STATE_OK(STATE) |
#define | IS_TIM3_PRESCALER_OK(PRESCALER) |
#define | IS_TIM3_PRESCALER_RELOAD_OK(RELOAD) |
#define | IS_TIM3_PWMI_CHANNEL_OK(CHANNEL) |
#define | IS_TIM3_UPDATE_SOURCE_OK(SOURCE) |
Enumerations | |
enum | TIM3_Channel_TypeDef { TIM3_CHANNEL_1 = ((uint8_t)0x00), TIM3_CHANNEL_2 = ((uint8_t)0x01) } |
TIM3 Channel. More... | |
enum | TIM3_EventSource_TypeDef { TIM3_EVENTSOURCE_UPDATE = ((uint8_t)0x01), TIM3_EVENTSOURCE_CC1 = ((uint8_t)0x02), TIM3_EVENTSOURCE_CC2 = ((uint8_t)0x04) } |
TIM3 Event Source. More... | |
enum | TIM3_FLAG_TypeDef { TIM3_FLAG_UPDATE = ((uint16_t)0x0001), TIM3_FLAG_CC1 = ((uint16_t)0x0002), TIM3_FLAG_CC2 = ((uint16_t)0x0004), TIM3_FLAG_CC1OF = ((uint16_t)0x0200), TIM3_FLAG_CC2OF = ((uint16_t)0x0400) } |
TIM3 Flags. More... | |
enum | TIM3_ForcedAction_TypeDef { TIM3_FORCEDACTION_ACTIVE = ((uint8_t)0x50), TIM3_FORCEDACTION_INACTIVE = ((uint8_t)0x40) } |
TIM3 Forced Action. More... | |
enum | TIM3_ICPolarity_TypeDef { TIM3_ICPOLARITY_RISING = ((uint8_t)0x00), TIM3_ICPOLARITY_FALLING = ((uint8_t)0x44) } |
TIM3 Input Capture Polarity. More... | |
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) } |
TIM3 Input Capture Prescaler. More... | |
enum | TIM3_ICSelection_TypeDef { TIM3_ICSELECTION_DIRECTTI = ((uint8_t)0x01), TIM3_ICSELECTION_INDIRECTTI = ((uint8_t)0x02), TIM3_ICSELECTION_TRGI = ((uint8_t)0x03) } |
TIM3 Input Capture Selection. More... | |
enum | TIM3_IT_TypeDef { TIM3_IT_UPDATE = ((uint8_t)0x01), TIM3_IT_CC1 = ((uint8_t)0x02), TIM3_IT_CC2 = ((uint8_t)0x04) } |
TIM3 interrupt sources. More... | |
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) } |
TIM3 Output Compare and PWM modes. More... | |
enum | TIM3_OCPolarity_TypeDef { TIM3_OCPOLARITY_HIGH = ((uint8_t)0x00), TIM3_OCPOLARITY_LOW = ((uint8_t)0x22) } |
TIM3 Output Compare Polarity. More... | |
enum | TIM3_OPMode_TypeDef { TIM3_OPMODE_SINGLE = ((uint8_t)0x01), TIM3_OPMODE_REPETITIVE = ((uint8_t)0x00) } |
TIM3 One Pulse Mode. More... | |
enum | TIM3_OutputState_TypeDef { TIM3_OUTPUTSTATE_DISABLE = ((uint8_t)0x00), TIM3_OUTPUTSTATE_ENABLE = ((uint8_t)0x11) } |
TIM3 Output Compare states. More... | |
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), TIM3_PRESCALER_256 = ((uint8_t)0x08), TIM3_PRESCALER_512 = ((uint8_t)0x09), TIM3_PRESCALER_1024 = ((uint8_t)0x0A), TIM3_PRESCALER_2048 = ((uint8_t)0x0B), TIM3_PRESCALER_4096 = ((uint8_t)0x0C), TIM3_PRESCALER_8192 = ((uint8_t)0x0D), TIM3_PRESCALER_16384 = ((uint8_t)0x0E), TIM3_PRESCALER_32768 = ((uint8_t)0x0F) } |
TIM3 Prescaler. More... | |
enum | TIM3_PSCReloadMode_TypeDef { TIM3_PSCRELOADMODE_UPDATE = ((uint8_t)0x00), TIM3_PSCRELOADMODE_IMMEDIATE = ((uint8_t)0x01) } |
TIM3 Prescaler Reload Mode. More... | |
enum | TIM3_UpdateSource_TypeDef { TIM3_UPDATESOURCE_GLOBAL = ((uint8_t)0x00), TIM3_UPDATESOURCE_REGULAR = ((uint8_t)0x01) } |
TIM3 Update Source. More... | |
Functions | |
void | TIM3_ARRPreloadConfig (FunctionalState NewState) |
Enables or disables TIM3 peripheral Preload register on ARR. | |
void | TIM3_CCPreloadControl (FunctionalState NewState) |
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 TIM3�s pending flags. | |
void | TIM3_ClearITPendingBit (TIM3_IT_TypeDef TIM3_IT) |
Clears the TIM3's interrupt pending bits. | |
void | TIM3_Cmd (FunctionalState NewState) |
Enables or disables the TIM3 peripheral. | |
void | TIM3_DeInit (void) |
Deinitializes the TIM3 peripheral registers to their default reset values. | |
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) |
void | TIM3_ITConfig (TIM3_IT_TypeDef TIM3_IT, FunctionalState NewState) |
Enables or disables the specified TIM3 interrupts. | |
void | TIM3_OC1Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity) |
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_OC2Init (TIM3_OCMode_TypeDef TIM3_OCMode, TIM3_OutputState_TypeDef TIM3_OutputState, uint16_t TIM3_Pulse, TIM3_OCPolarity_TypeDef TIM3_OCPolarity) |
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_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 TIM3�s One Pulse Mode. | |
void | TIM3_SetAutoreload (uint16_t Autoreload) |
Sets the TIM3 Autoreload Register value. | |
void | TIM3_SetCompare1 (uint16_t Compare1) |
Sets the TIM3 Capture Compare1 Register value. | |
void | TIM3_SetCompare2 (uint16_t Compare2) |
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, uint16_t TIM3_Period) |
Initializes the TIM3 Time Base Unit according to the specified parameters. | |
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 functions prototype and macros for the TIM3 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_tim3.h.