cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Wed Mar 02 09:58:28 2016 +0100
Revision:
115:87f2f5183dfb
Child:
116:c0f6e94411f5
Release 115 of the mbed library

Changes:
- new targets - NUCLEO_F746ZG
- Bugfix - STM32F7 + STM32L4 - RTC init fix
- Bugfix - STM32L4 Set NVIC_RAM_VECTOR_ADDRESS to 0x10000000
- B96B_F446VE - CAN addition
- Changed target name from NZ32SC151 to NZ32_SC151

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 115:87f2f5183dfb 1 /**
Kojto 115:87f2f5183dfb 2 ******************************************************************************
Kojto 115:87f2f5183dfb 3 * @file stm32f7xx_hal_tim_ex.h
Kojto 115:87f2f5183dfb 4 * @author MCD Application Team
Kojto 115:87f2f5183dfb 5 * @version V1.0.1
Kojto 115:87f2f5183dfb 6 * @date 25-June-2015
Kojto 115:87f2f5183dfb 7 * @brief Header file of TIM HAL Extension module.
Kojto 115:87f2f5183dfb 8 ******************************************************************************
Kojto 115:87f2f5183dfb 9 * @attention
Kojto 115:87f2f5183dfb 10 *
Kojto 115:87f2f5183dfb 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 115:87f2f5183dfb 12 *
Kojto 115:87f2f5183dfb 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 115:87f2f5183dfb 14 * are permitted provided that the following conditions are met:
Kojto 115:87f2f5183dfb 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 115:87f2f5183dfb 16 * this list of conditions and the following disclaimer.
Kojto 115:87f2f5183dfb 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 115:87f2f5183dfb 18 * this list of conditions and the following disclaimer in the documentation
Kojto 115:87f2f5183dfb 19 * and/or other materials provided with the distribution.
Kojto 115:87f2f5183dfb 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 115:87f2f5183dfb 21 * may be used to endorse or promote products derived from this software
Kojto 115:87f2f5183dfb 22 * without specific prior written permission.
Kojto 115:87f2f5183dfb 23 *
Kojto 115:87f2f5183dfb 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 115:87f2f5183dfb 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 115:87f2f5183dfb 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 115:87f2f5183dfb 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 115:87f2f5183dfb 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 115:87f2f5183dfb 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 115:87f2f5183dfb 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 115:87f2f5183dfb 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 115:87f2f5183dfb 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 115:87f2f5183dfb 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 115:87f2f5183dfb 34 *
Kojto 115:87f2f5183dfb 35 ******************************************************************************
Kojto 115:87f2f5183dfb 36 */
Kojto 115:87f2f5183dfb 37
Kojto 115:87f2f5183dfb 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 115:87f2f5183dfb 39 #ifndef __STM32F7xx_HAL_TIM_EX_H
Kojto 115:87f2f5183dfb 40 #define __STM32F7xx_HAL_TIM_EX_H
Kojto 115:87f2f5183dfb 41
Kojto 115:87f2f5183dfb 42 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 43 extern "C" {
Kojto 115:87f2f5183dfb 44 #endif
Kojto 115:87f2f5183dfb 45
Kojto 115:87f2f5183dfb 46 /* Includes ------------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 47 #include "stm32f7xx_hal_def.h"
Kojto 115:87f2f5183dfb 48
Kojto 115:87f2f5183dfb 49 /** @addtogroup STM32F7xx_HAL_Driver
Kojto 115:87f2f5183dfb 50 * @{
Kojto 115:87f2f5183dfb 51 */
Kojto 115:87f2f5183dfb 52
Kojto 115:87f2f5183dfb 53 /** @addtogroup TIMEx
Kojto 115:87f2f5183dfb 54 * @{
Kojto 115:87f2f5183dfb 55 */
Kojto 115:87f2f5183dfb 56
Kojto 115:87f2f5183dfb 57 /* Exported types ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 58 /** @defgroup TIMEx_Exported_Types TIM Exported Types
Kojto 115:87f2f5183dfb 59 * @{
Kojto 115:87f2f5183dfb 60 */
Kojto 115:87f2f5183dfb 61
Kojto 115:87f2f5183dfb 62 /**
Kojto 115:87f2f5183dfb 63 * @brief TIM Hall sensor Configuration Structure definition
Kojto 115:87f2f5183dfb 64 */
Kojto 115:87f2f5183dfb 65
Kojto 115:87f2f5183dfb 66 typedef struct
Kojto 115:87f2f5183dfb 67 {
Kojto 115:87f2f5183dfb 68
Kojto 115:87f2f5183dfb 69 uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
Kojto 115:87f2f5183dfb 70 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
Kojto 115:87f2f5183dfb 71
Kojto 115:87f2f5183dfb 72 uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
Kojto 115:87f2f5183dfb 73 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
Kojto 115:87f2f5183dfb 74
Kojto 115:87f2f5183dfb 75 uint32_t IC1Filter; /*!< Specifies the input capture filter.
Kojto 115:87f2f5183dfb 76 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 115:87f2f5183dfb 77 uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
Kojto 115:87f2f5183dfb 78 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
Kojto 115:87f2f5183dfb 79 } TIM_HallSensor_InitTypeDef;
Kojto 115:87f2f5183dfb 80
Kojto 115:87f2f5183dfb 81 /**
Kojto 115:87f2f5183dfb 82 * @brief TIM Master configuration Structure definition
Kojto 115:87f2f5183dfb 83 */
Kojto 115:87f2f5183dfb 84 typedef struct {
Kojto 115:87f2f5183dfb 85 uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection.
Kojto 115:87f2f5183dfb 86 This parameter can be a value of @ref TIM_Master_Mode_Selection */
Kojto 115:87f2f5183dfb 87 uint32_t MasterOutputTrigger2; /*!< Trigger output2 (TRGO2) selection
Kojto 115:87f2f5183dfb 88 This parameter can be a value of @ref TIMEx_Master_Mode_Selection_2 */
Kojto 115:87f2f5183dfb 89 uint32_t MasterSlaveMode; /*!< Master/slave mode selection.
Kojto 115:87f2f5183dfb 90 This parameter can be a value of @ref TIM_Master_Slave_Mode */
Kojto 115:87f2f5183dfb 91 }TIM_MasterConfigTypeDef;
Kojto 115:87f2f5183dfb 92
Kojto 115:87f2f5183dfb 93 /**
Kojto 115:87f2f5183dfb 94 * @brief TIM Break input(s) and Dead time configuration Structure definition
Kojto 115:87f2f5183dfb 95 * @note 2 break inputs can be configured (BKIN and BKIN2) with configurable
Kojto 115:87f2f5183dfb 96 * filter and polarity.
Kojto 115:87f2f5183dfb 97 */
Kojto 115:87f2f5183dfb 98 typedef struct
Kojto 115:87f2f5183dfb 99 {
Kojto 115:87f2f5183dfb 100 uint32_t OffStateRunMode; /*!< TIM off state in run mode.
Kojto 115:87f2f5183dfb 101 This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */
Kojto 115:87f2f5183dfb 102 uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode.
Kojto 115:87f2f5183dfb 103 This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */
Kojto 115:87f2f5183dfb 104 uint32_t LockLevel; /*!< TIM Lock level.
Kojto 115:87f2f5183dfb 105 This parameter can be a value of @ref TIM_Lock_level */
Kojto 115:87f2f5183dfb 106 uint32_t DeadTime; /*!< TIM dead Time.
Kojto 115:87f2f5183dfb 107 This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */
Kojto 115:87f2f5183dfb 108 uint32_t BreakState; /*!< TIM Break State.
Kojto 115:87f2f5183dfb 109 This parameter can be a value of @ref TIM_Break_Input_enable_disable */
Kojto 115:87f2f5183dfb 110 uint32_t BreakPolarity; /*!< TIM Break input polarity.
Kojto 115:87f2f5183dfb 111 This parameter can be a value of @ref TIM_Break_Polarity */
Kojto 115:87f2f5183dfb 112 uint32_t BreakFilter; /*!< Specifies the break input filter.
Kojto 115:87f2f5183dfb 113 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 115:87f2f5183dfb 114 uint32_t Break2State; /*!< TIM Break2 State
Kojto 115:87f2f5183dfb 115 This parameter can be a value of @ref TIMEx_Break2_Input_enable_disable */
Kojto 115:87f2f5183dfb 116 uint32_t Break2Polarity; /*!< TIM Break2 input polarity
Kojto 115:87f2f5183dfb 117 This parameter can be a value of @ref TIMEx_Break2_Polarity */
Kojto 115:87f2f5183dfb 118 uint32_t Break2Filter; /*!< TIM break2 input filter.
Kojto 115:87f2f5183dfb 119 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
Kojto 115:87f2f5183dfb 120 uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state
Kojto 115:87f2f5183dfb 121 This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */
Kojto 115:87f2f5183dfb 122 } TIM_BreakDeadTimeConfigTypeDef;
Kojto 115:87f2f5183dfb 123
Kojto 115:87f2f5183dfb 124 /**
Kojto 115:87f2f5183dfb 125 * @}
Kojto 115:87f2f5183dfb 126 */
Kojto 115:87f2f5183dfb 127
Kojto 115:87f2f5183dfb 128 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 129 /** @defgroup TIMEx_Exported_Constants TIMEx Exported Constants
Kojto 115:87f2f5183dfb 130 * @{
Kojto 115:87f2f5183dfb 131 */
Kojto 115:87f2f5183dfb 132
Kojto 115:87f2f5183dfb 133 /** @defgroup TIMEx_Channel TIMEx Channel
Kojto 115:87f2f5183dfb 134 * @{
Kojto 115:87f2f5183dfb 135 */
Kojto 115:87f2f5183dfb 136
Kojto 115:87f2f5183dfb 137 #define TIM_CHANNEL_1 ((uint32_t)0x0000)
Kojto 115:87f2f5183dfb 138 #define TIM_CHANNEL_2 ((uint32_t)0x0004)
Kojto 115:87f2f5183dfb 139 #define TIM_CHANNEL_3 ((uint32_t)0x0008)
Kojto 115:87f2f5183dfb 140 #define TIM_CHANNEL_4 ((uint32_t)0x000C)
Kojto 115:87f2f5183dfb 141 #define TIM_CHANNEL_5 ((uint32_t)0x0010)
Kojto 115:87f2f5183dfb 142 #define TIM_CHANNEL_6 ((uint32_t)0x0014)
Kojto 115:87f2f5183dfb 143 #define TIM_CHANNEL_ALL ((uint32_t)0x003C)
Kojto 115:87f2f5183dfb 144
Kojto 115:87f2f5183dfb 145 /**
Kojto 115:87f2f5183dfb 146 * @}
Kojto 115:87f2f5183dfb 147 */
Kojto 115:87f2f5183dfb 148
Kojto 115:87f2f5183dfb 149 /** @defgroup TIMEx_Output_Compare_and_PWM_modes TIMEx Output Compare and PWM Modes
Kojto 115:87f2f5183dfb 150 * @{
Kojto 115:87f2f5183dfb 151 */
Kojto 115:87f2f5183dfb 152 #define TIM_OCMODE_TIMING ((uint32_t)0x0000)
Kojto 115:87f2f5183dfb 153 #define TIM_OCMODE_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 154 #define TIM_OCMODE_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_1)
Kojto 115:87f2f5183dfb 155 #define TIM_OCMODE_TOGGLE ((uint32_t)TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 156 #define TIM_OCMODE_PWM1 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1)
Kojto 115:87f2f5183dfb 157 #define TIM_OCMODE_PWM2 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 158 #define TIM_OCMODE_FORCED_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 159 #define TIM_OCMODE_FORCED_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 160
Kojto 115:87f2f5183dfb 161 #define TIM_OCMODE_RETRIGERRABLE_OPM1 ((uint32_t)TIM_CCMR1_OC1M_3)
Kojto 115:87f2f5183dfb 162 #define TIM_OCMODE_RETRIGERRABLE_OPM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 163 #define TIM_OCMODE_COMBINED_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 164 #define TIM_OCMODE_COMBINED_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 165 #define TIM_OCMODE_ASSYMETRIC_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 166 #define TIM_OCMODE_ASSYMETRIC_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M)
Kojto 115:87f2f5183dfb 167 /**
Kojto 115:87f2f5183dfb 168 * @}
Kojto 115:87f2f5183dfb 169 */
Kojto 115:87f2f5183dfb 170
Kojto 115:87f2f5183dfb 171 /** @defgroup TIMEx_Remap TIMEx Remap
Kojto 115:87f2f5183dfb 172 * @{
Kojto 115:87f2f5183dfb 173 */
Kojto 115:87f2f5183dfb 174 #define TIM_TIM2_TIM8_TRGO (0x00000000)
Kojto 115:87f2f5183dfb 175 #define TIM_TIM2_ETH_PTP (0x00000400)
Kojto 115:87f2f5183dfb 176 #define TIM_TIM2_USBFS_SOF (0x00000800)
Kojto 115:87f2f5183dfb 177 #define TIM_TIM2_USBHS_SOF (0x00000C00)
Kojto 115:87f2f5183dfb 178 #define TIM_TIM5_GPIO (0x00000000)
Kojto 115:87f2f5183dfb 179 #define TIM_TIM5_LSI (0x00000040)
Kojto 115:87f2f5183dfb 180 #define TIM_TIM5_LSE (0x00000080)
Kojto 115:87f2f5183dfb 181 #define TIM_TIM5_RTC (0x000000C0)
Kojto 115:87f2f5183dfb 182 #define TIM_TIM11_GPIO (0x00000000)
Kojto 115:87f2f5183dfb 183 #define TIM_TIM11_SPDIFRX (0x00000001)
Kojto 115:87f2f5183dfb 184 #define TIM_TIM11_HSE (0x00000002)
Kojto 115:87f2f5183dfb 185 #define TIM_TIM11_MCO1 (0x00000003)
Kojto 115:87f2f5183dfb 186 /**
Kojto 115:87f2f5183dfb 187 * @}
Kojto 115:87f2f5183dfb 188 */
Kojto 115:87f2f5183dfb 189
Kojto 115:87f2f5183dfb 190 /** @defgroup TIMEx_ClearInput_Source TIMEx Clear Input Source
Kojto 115:87f2f5183dfb 191 * @{
Kojto 115:87f2f5183dfb 192 */
Kojto 115:87f2f5183dfb 193 #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001)
Kojto 115:87f2f5183dfb 194 #define TIM_CLEARINPUTSOURCE_OCREFCLR ((uint32_t)0x0002)
Kojto 115:87f2f5183dfb 195 #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000)
Kojto 115:87f2f5183dfb 196 /**
Kojto 115:87f2f5183dfb 197 * @}
Kojto 115:87f2f5183dfb 198 */
Kojto 115:87f2f5183dfb 199
Kojto 115:87f2f5183dfb 200 /** @defgroup TIMEx_Break2_Input_enable_disable TIMEx Break input 2 Enable
Kojto 115:87f2f5183dfb 201 * @{
Kojto 115:87f2f5183dfb 202 */
Kojto 115:87f2f5183dfb 203 #define TIM_BREAK2_DISABLE ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 204 #define TIM_BREAK2_ENABLE ((uint32_t)TIM_BDTR_BK2E)
Kojto 115:87f2f5183dfb 205 /**
Kojto 115:87f2f5183dfb 206 * @}
Kojto 115:87f2f5183dfb 207 */
Kojto 115:87f2f5183dfb 208
Kojto 115:87f2f5183dfb 209 /** @defgroup TIMEx_Break2_Polarity TIMEx Break2 Polarity
Kojto 115:87f2f5183dfb 210 * @{
Kojto 115:87f2f5183dfb 211 */
Kojto 115:87f2f5183dfb 212 #define TIM_BREAK2POLARITY_LOW ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 213 #define TIM_BREAK2POLARITY_HIGH (TIM_BDTR_BK2P)
Kojto 115:87f2f5183dfb 214 /**
Kojto 115:87f2f5183dfb 215 * @}
Kojto 115:87f2f5183dfb 216 */
Kojto 115:87f2f5183dfb 217
Kojto 115:87f2f5183dfb 218 /** @defgroup TIMEx_Group_Channel5 TIMEx Group Channel 5 and Channel 1, 2 or 3
Kojto 115:87f2f5183dfb 219 * @{
Kojto 115:87f2f5183dfb 220 */
Kojto 115:87f2f5183dfb 221 #define TIM_GROUPCH5_NONE (uint32_t)0x00000000 /* !< No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC */
Kojto 115:87f2f5183dfb 222 #define TIM_GROUPCH5_OC1REFC (TIM_CCR5_GC5C1) /* !< OC1REFC is the logical AND of OC1REFC and OC5REF */
Kojto 115:87f2f5183dfb 223 #define TIM_GROUPCH5_OC2REFC (TIM_CCR5_GC5C2) /* !< OC2REFC is the logical AND of OC2REFC and OC5REF */
Kojto 115:87f2f5183dfb 224 #define TIM_GROUPCH5_OC3REFC (TIM_CCR5_GC5C3) /* !< OC3REFC is the logical AND of OC3REFC and OC5REF */
Kojto 115:87f2f5183dfb 225 /**
Kojto 115:87f2f5183dfb 226 * @}
Kojto 115:87f2f5183dfb 227 */
Kojto 115:87f2f5183dfb 228
Kojto 115:87f2f5183dfb 229 /** @defgroup TIMEx_Master_Mode_Selection_2 TIMEx Master Mode Selection 2 (TRGO2)
Kojto 115:87f2f5183dfb 230 * @{
Kojto 115:87f2f5183dfb 231 */
Kojto 115:87f2f5183dfb 232 #define TIM_TRGO2_RESET ((uint32_t)0x00000000)
Kojto 115:87f2f5183dfb 233 #define TIM_TRGO2_ENABLE ((uint32_t)(TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 234 #define TIM_TRGO2_UPDATE ((uint32_t)(TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 235 #define TIM_TRGO2_OC1 ((uint32_t)(TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 236 #define TIM_TRGO2_OC1REF ((uint32_t)(TIM_CR2_MMS2_2))
Kojto 115:87f2f5183dfb 237 #define TIM_TRGO2_OC2REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 238 #define TIM_TRGO2_OC3REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 239 #define TIM_TRGO2_OC4REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 240 #define TIM_TRGO2_OC5REF ((uint32_t)(TIM_CR2_MMS2_3))
Kojto 115:87f2f5183dfb 241 #define TIM_TRGO2_OC6REF ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 242 #define TIM_TRGO2_OC4REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 243 #define TIM_TRGO2_OC6REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 244 #define TIM_TRGO2_OC4REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2))
Kojto 115:87f2f5183dfb 245 #define TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 246 #define TIM_TRGO2_OC5REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 |TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 247 #define TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 248 /**
Kojto 115:87f2f5183dfb 249 * @}
Kojto 115:87f2f5183dfb 250 */
Kojto 115:87f2f5183dfb 251
Kojto 115:87f2f5183dfb 252 /** @defgroup TIMEx_Slave_Mode TIMEx Slave mode
Kojto 115:87f2f5183dfb 253 * @{
Kojto 115:87f2f5183dfb 254 */
Kojto 115:87f2f5183dfb 255 #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000)
Kojto 115:87f2f5183dfb 256 #define TIM_SLAVEMODE_RESET ((uint32_t)(TIM_SMCR_SMS_2))
Kojto 115:87f2f5183dfb 257 #define TIM_SLAVEMODE_GATED ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_0))
Kojto 115:87f2f5183dfb 258 #define TIM_SLAVEMODE_TRIGGER ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1))
Kojto 115:87f2f5183dfb 259 #define TIM_SLAVEMODE_EXTERNAL1 ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0))
Kojto 115:87f2f5183dfb 260 #define TIM_SLAVEMODE_COMBINED_RESETTRIGGER ((uint32_t)(TIM_SMCR_SMS_3))
Kojto 115:87f2f5183dfb 261 /**
Kojto 115:87f2f5183dfb 262 * @}
Kojto 115:87f2f5183dfb 263 */
Kojto 115:87f2f5183dfb 264 /**
Kojto 115:87f2f5183dfb 265 * @}
Kojto 115:87f2f5183dfb 266 */
Kojto 115:87f2f5183dfb 267
Kojto 115:87f2f5183dfb 268 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 269 /** @defgroup TIMEx_Exported_Macros TIMEx Exported Macros
Kojto 115:87f2f5183dfb 270 * @{
Kojto 115:87f2f5183dfb 271 */
Kojto 115:87f2f5183dfb 272
Kojto 115:87f2f5183dfb 273 /**
Kojto 115:87f2f5183dfb 274 * @brief Sets the TIM Capture Compare Register value on runtime without
Kojto 115:87f2f5183dfb 275 * calling another time ConfigChannel function.
Kojto 115:87f2f5183dfb 276 * @param __HANDLE__: TIM handle.
Kojto 115:87f2f5183dfb 277 * @param __CHANNEL__ : TIM Channels to be configured.
Kojto 115:87f2f5183dfb 278 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 279 * @arg TIM_CHANNEL_1: TIM Channel 1 selected
Kojto 115:87f2f5183dfb 280 * @arg TIM_CHANNEL_2: TIM Channel 2 selected
Kojto 115:87f2f5183dfb 281 * @arg TIM_CHANNEL_3: TIM Channel 3 selected
Kojto 115:87f2f5183dfb 282 * @arg TIM_CHANNEL_4: TIM Channel 4 selected
Kojto 115:87f2f5183dfb 283 * @arg TIM_CHANNEL_5: TIM Channel 5 selected
Kojto 115:87f2f5183dfb 284 * @arg TIM_CHANNEL_6: TIM Channel 6 selected
Kojto 115:87f2f5183dfb 285 * @param __COMPARE__: specifies the Capture Compare register new value.
Kojto 115:87f2f5183dfb 286 * @retval None
Kojto 115:87f2f5183dfb 287 */
Kojto 115:87f2f5183dfb 288 #define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \
Kojto 115:87f2f5183dfb 289 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 290 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 291 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 292 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 293 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 294 ((__HANDLE__)->Instance->CCR6 |= (__COMPARE__)))
Kojto 115:87f2f5183dfb 295
Kojto 115:87f2f5183dfb 296 /**
Kojto 115:87f2f5183dfb 297 * @brief Gets the TIM Capture Compare Register value on runtime
Kojto 115:87f2f5183dfb 298 * @param __HANDLE__: TIM handle.
Kojto 115:87f2f5183dfb 299 * @param __CHANNEL__ : TIM Channel associated with the capture compare register
Kojto 115:87f2f5183dfb 300 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 301 * @arg TIM_CHANNEL_1: get capture/compare 1 register value
Kojto 115:87f2f5183dfb 302 * @arg TIM_CHANNEL_2: get capture/compare 2 register value
Kojto 115:87f2f5183dfb 303 * @arg TIM_CHANNEL_3: get capture/compare 3 register value
Kojto 115:87f2f5183dfb 304 * @arg TIM_CHANNEL_4: get capture/compare 4 register value
Kojto 115:87f2f5183dfb 305 * @arg TIM_CHANNEL_5: get capture/compare 5 register value
Kojto 115:87f2f5183dfb 306 * @arg TIM_CHANNEL_6: get capture/compare 6 register value
Kojto 115:87f2f5183dfb 307 * @retval None
Kojto 115:87f2f5183dfb 308 */
Kojto 115:87f2f5183dfb 309 #define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \
Kojto 115:87f2f5183dfb 310 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\
Kojto 115:87f2f5183dfb 311 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\
Kojto 115:87f2f5183dfb 312 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\
Kojto 115:87f2f5183dfb 313 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4) :\
Kojto 115:87f2f5183dfb 314 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5) :\
Kojto 115:87f2f5183dfb 315 ((__HANDLE__)->Instance->CCR6))
Kojto 115:87f2f5183dfb 316
Kojto 115:87f2f5183dfb 317 /**
Kojto 115:87f2f5183dfb 318 * @}
Kojto 115:87f2f5183dfb 319 */
Kojto 115:87f2f5183dfb 320
Kojto 115:87f2f5183dfb 321 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 322 /** @addtogroup TIMEx_Exported_Functions
Kojto 115:87f2f5183dfb 323 * @{
Kojto 115:87f2f5183dfb 324 */
Kojto 115:87f2f5183dfb 325
Kojto 115:87f2f5183dfb 326 /** @addtogroup TIMEx_Exported_Functions_Group1
Kojto 115:87f2f5183dfb 327 * @{
Kojto 115:87f2f5183dfb 328 */
Kojto 115:87f2f5183dfb 329 /* Timer Hall Sensor functions **********************************************/
Kojto 115:87f2f5183dfb 330 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig);
Kojto 115:87f2f5183dfb 331 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 332
Kojto 115:87f2f5183dfb 333 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 334 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 335
Kojto 115:87f2f5183dfb 336 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 337 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 338 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 339 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 340 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 341 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 342 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 343 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 344 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 345 /**
Kojto 115:87f2f5183dfb 346 * @}
Kojto 115:87f2f5183dfb 347 */
Kojto 115:87f2f5183dfb 348
Kojto 115:87f2f5183dfb 349 /** @addtogroup TIMEx_Exported_Functions_Group2
Kojto 115:87f2f5183dfb 350 * @{
Kojto 115:87f2f5183dfb 351 */
Kojto 115:87f2f5183dfb 352 /* Timer Complementary Output Compare functions *****************************/
Kojto 115:87f2f5183dfb 353 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 354 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 355 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 356
Kojto 115:87f2f5183dfb 357 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 358 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 359 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 360
Kojto 115:87f2f5183dfb 361 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 362 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 363 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 364 /**
Kojto 115:87f2f5183dfb 365 * @}
Kojto 115:87f2f5183dfb 366 */
Kojto 115:87f2f5183dfb 367
Kojto 115:87f2f5183dfb 368 /** @addtogroup TIMEx_Exported_Functions_Group3
Kojto 115:87f2f5183dfb 369 * @{
Kojto 115:87f2f5183dfb 370 */
Kojto 115:87f2f5183dfb 371 /* Timer Complementary PWM functions ****************************************/
Kojto 115:87f2f5183dfb 372 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 373 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 374 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 375
Kojto 115:87f2f5183dfb 376 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 377 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 378 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 379 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 380 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 381 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 382 /**
Kojto 115:87f2f5183dfb 383 * @}
Kojto 115:87f2f5183dfb 384 */
Kojto 115:87f2f5183dfb 385
Kojto 115:87f2f5183dfb 386 /** @addtogroup TIMEx_Exported_Functions_Group4
Kojto 115:87f2f5183dfb 387 * @{
Kojto 115:87f2f5183dfb 388 */
Kojto 115:87f2f5183dfb 389 /* Timer Complementary One Pulse functions **********************************/
Kojto 115:87f2f5183dfb 390 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 391 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 392 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 393
Kojto 115:87f2f5183dfb 394 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 395 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 396 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 397 /**
Kojto 115:87f2f5183dfb 398 * @}
Kojto 115:87f2f5183dfb 399 */
Kojto 115:87f2f5183dfb 400
Kojto 115:87f2f5183dfb 401 /** @addtogroup TIMEx_Exported_Functions_Group5
Kojto 115:87f2f5183dfb 402 * @{
Kojto 115:87f2f5183dfb 403 */
Kojto 115:87f2f5183dfb 404 /* Extension Control functions ************************************************/
Kojto 115:87f2f5183dfb 405 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 406 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 407 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 408 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig);
Kojto 115:87f2f5183dfb 409 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
Kojto 115:87f2f5183dfb 410 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap);
Kojto 115:87f2f5183dfb 411 HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t OCRef);
Kojto 115:87f2f5183dfb 412 /**
Kojto 115:87f2f5183dfb 413 * @}
Kojto 115:87f2f5183dfb 414 */
Kojto 115:87f2f5183dfb 415
Kojto 115:87f2f5183dfb 416 /** @addtogroup TIMEx_Exported_Functions_Group6
Kojto 115:87f2f5183dfb 417 * @{
Kojto 115:87f2f5183dfb 418 */
Kojto 115:87f2f5183dfb 419 /* Extension Callback *********************************************************/
Kojto 115:87f2f5183dfb 420 void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 421 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 422 void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 423 /**
Kojto 115:87f2f5183dfb 424 * @}
Kojto 115:87f2f5183dfb 425 */
Kojto 115:87f2f5183dfb 426
Kojto 115:87f2f5183dfb 427 /** @addtogroup TIMEx_Exported_Functions_Group7
Kojto 115:87f2f5183dfb 428 * @{
Kojto 115:87f2f5183dfb 429 */
Kojto 115:87f2f5183dfb 430 /* Extension Peripheral State functions **************************************/
Kojto 115:87f2f5183dfb 431 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 432 /**
Kojto 115:87f2f5183dfb 433 * @}
Kojto 115:87f2f5183dfb 434 */
Kojto 115:87f2f5183dfb 435
Kojto 115:87f2f5183dfb 436 /**
Kojto 115:87f2f5183dfb 437 * @}
Kojto 115:87f2f5183dfb 438 */
Kojto 115:87f2f5183dfb 439
Kojto 115:87f2f5183dfb 440 /* Private types -------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 441 /* Private variables ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 442 /* Private constants ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 443 /* Private macros ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 444 /** @defgroup TIMEx_Private_Macros TIMEx Private Macros
Kojto 115:87f2f5183dfb 445 * @{
Kojto 115:87f2f5183dfb 446 */
Kojto 115:87f2f5183dfb 447 #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 448 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 115:87f2f5183dfb 449 ((CHANNEL) == TIM_CHANNEL_3) || \
Kojto 115:87f2f5183dfb 450 ((CHANNEL) == TIM_CHANNEL_4) || \
Kojto 115:87f2f5183dfb 451 ((CHANNEL) == TIM_CHANNEL_5) || \
Kojto 115:87f2f5183dfb 452 ((CHANNEL) == TIM_CHANNEL_6) || \
Kojto 115:87f2f5183dfb 453 ((CHANNEL) == TIM_CHANNEL_ALL))
Kojto 115:87f2f5183dfb 454
Kojto 115:87f2f5183dfb 455 #define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 456 ((CHANNEL) == TIM_CHANNEL_2))
Kojto 115:87f2f5183dfb 457
Kojto 115:87f2f5183dfb 458 #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 459 ((CHANNEL) == TIM_CHANNEL_2))
Kojto 115:87f2f5183dfb 460
Kojto 115:87f2f5183dfb 461 #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 462 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 115:87f2f5183dfb 463 ((CHANNEL) == TIM_CHANNEL_3))
Kojto 115:87f2f5183dfb 464 #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \
Kojto 115:87f2f5183dfb 465 ((MODE) == TIM_OCMODE_PWM2) || \
Kojto 115:87f2f5183dfb 466 ((MODE) == TIM_OCMODE_COMBINED_PWM1) || \
Kojto 115:87f2f5183dfb 467 ((MODE) == TIM_OCMODE_COMBINED_PWM2) || \
Kojto 115:87f2f5183dfb 468 ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM1) || \
Kojto 115:87f2f5183dfb 469 ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM2))
Kojto 115:87f2f5183dfb 470
Kojto 115:87f2f5183dfb 471 #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \
Kojto 115:87f2f5183dfb 472 ((MODE) == TIM_OCMODE_ACTIVE) || \
Kojto 115:87f2f5183dfb 473 ((MODE) == TIM_OCMODE_INACTIVE) || \
Kojto 115:87f2f5183dfb 474 ((MODE) == TIM_OCMODE_TOGGLE) || \
Kojto 115:87f2f5183dfb 475 ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \
Kojto 115:87f2f5183dfb 476 ((MODE) == TIM_OCMODE_FORCED_INACTIVE) || \
Kojto 115:87f2f5183dfb 477 ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM1) || \
Kojto 115:87f2f5183dfb 478 ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM2))
Kojto 115:87f2f5183dfb 479 #define IS_TIM_REMAP(__TIM_REMAP__) (((__TIM_REMAP__) == TIM_TIM2_TIM8_TRGO)||\
Kojto 115:87f2f5183dfb 480 ((__TIM_REMAP__) == TIM_TIM2_ETH_PTP)||\
Kojto 115:87f2f5183dfb 481 ((__TIM_REMAP__) == TIM_TIM2_USBFS_SOF)||\
Kojto 115:87f2f5183dfb 482 ((__TIM_REMAP__) == TIM_TIM2_USBHS_SOF)||\
Kojto 115:87f2f5183dfb 483 ((__TIM_REMAP__) == TIM_TIM5_GPIO)||\
Kojto 115:87f2f5183dfb 484 ((__TIM_REMAP__) == TIM_TIM5_LSI)||\
Kojto 115:87f2f5183dfb 485 ((__TIM_REMAP__) == TIM_TIM5_LSE)||\
Kojto 115:87f2f5183dfb 486 ((__TIM_REMAP__) == TIM_TIM5_RTC)||\
Kojto 115:87f2f5183dfb 487 ((__TIM_REMAP__) == TIM_TIM11_GPIO)||\
Kojto 115:87f2f5183dfb 488 ((__TIM_REMAP__) == TIM_TIM11_SPDIFRX)||\
Kojto 115:87f2f5183dfb 489 ((__TIM_REMAP__) == TIM_TIM11_HSE)||\
Kojto 115:87f2f5183dfb 490 ((__TIM_REMAP__) == TIM_TIM11_MCO1))
Kojto 115:87f2f5183dfb 491 #define IS_TIM_DEADTIME(__DEADTIME__) ((__DEADTIME__) <= 0xFF)
Kojto 115:87f2f5183dfb 492 #define IS_TIM_BREAK_FILTER(__FILTER__) ((__FILTER__) <= 0xF)
Kojto 115:87f2f5183dfb 493 #define IS_TIM_CLEARINPUT_SOURCE(MODE) (((MODE) == TIM_CLEARINPUTSOURCE_ETR) || \
Kojto 115:87f2f5183dfb 494 ((MODE) == TIM_CLEARINPUTSOURCE_OCREFCLR) || \
Kojto 115:87f2f5183dfb 495 ((MODE) == TIM_CLEARINPUTSOURCE_NONE))
Kojto 115:87f2f5183dfb 496 #define IS_TIM_BREAK2_STATE(STATE) (((STATE) == TIM_BREAK2_ENABLE) || \
Kojto 115:87f2f5183dfb 497 ((STATE) == TIM_BREAK2_DISABLE))
Kojto 115:87f2f5183dfb 498 #define IS_TIM_BREAK2_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAK2POLARITY_LOW) || \
Kojto 115:87f2f5183dfb 499 ((__POLARITY__) == TIM_BREAK2POLARITY_HIGH))
Kojto 115:87f2f5183dfb 500 #define IS_TIM_GROUPCH5(OCREF) ((((OCREF) & 0x1FFFFFFF) == 0x00000000))
Kojto 115:87f2f5183dfb 501 #define IS_TIM_TRGO2_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO2_RESET) || \
Kojto 115:87f2f5183dfb 502 ((SOURCE) == TIM_TRGO2_ENABLE) || \
Kojto 115:87f2f5183dfb 503 ((SOURCE) == TIM_TRGO2_UPDATE) || \
Kojto 115:87f2f5183dfb 504 ((SOURCE) == TIM_TRGO2_OC1) || \
Kojto 115:87f2f5183dfb 505 ((SOURCE) == TIM_TRGO2_OC1REF) || \
Kojto 115:87f2f5183dfb 506 ((SOURCE) == TIM_TRGO2_OC2REF) || \
Kojto 115:87f2f5183dfb 507 ((SOURCE) == TIM_TRGO2_OC3REF) || \
Kojto 115:87f2f5183dfb 508 ((SOURCE) == TIM_TRGO2_OC3REF) || \
Kojto 115:87f2f5183dfb 509 ((SOURCE) == TIM_TRGO2_OC4REF) || \
Kojto 115:87f2f5183dfb 510 ((SOURCE) == TIM_TRGO2_OC5REF) || \
Kojto 115:87f2f5183dfb 511 ((SOURCE) == TIM_TRGO2_OC6REF) || \
Kojto 115:87f2f5183dfb 512 ((SOURCE) == TIM_TRGO2_OC4REF_RISINGFALLING) || \
Kojto 115:87f2f5183dfb 513 ((SOURCE) == TIM_TRGO2_OC6REF_RISINGFALLING) || \
Kojto 115:87f2f5183dfb 514 ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_RISING) || \
Kojto 115:87f2f5183dfb 515 ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING) || \
Kojto 115:87f2f5183dfb 516 ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_RISING) || \
Kojto 115:87f2f5183dfb 517 ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING))
Kojto 115:87f2f5183dfb 518 #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \
Kojto 115:87f2f5183dfb 519 ((MODE) == TIM_SLAVEMODE_RESET) || \
Kojto 115:87f2f5183dfb 520 ((MODE) == TIM_SLAVEMODE_GATED) || \
Kojto 115:87f2f5183dfb 521 ((MODE) == TIM_SLAVEMODE_TRIGGER) || \
Kojto 115:87f2f5183dfb 522 ((MODE) == TIM_SLAVEMODE_EXTERNAL1) || \
Kojto 115:87f2f5183dfb 523 ((MODE) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER))
Kojto 115:87f2f5183dfb 524
Kojto 115:87f2f5183dfb 525 /**
Kojto 115:87f2f5183dfb 526 * @}
Kojto 115:87f2f5183dfb 527 */
Kojto 115:87f2f5183dfb 528
Kojto 115:87f2f5183dfb 529 /* Private functions ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 530 /** @defgroup TIMEx_Private_Functions TIMEx Private Functions
Kojto 115:87f2f5183dfb 531 * @{
Kojto 115:87f2f5183dfb 532 */
Kojto 115:87f2f5183dfb 533
Kojto 115:87f2f5183dfb 534 /**
Kojto 115:87f2f5183dfb 535 * @}
Kojto 115:87f2f5183dfb 536 */
Kojto 115:87f2f5183dfb 537
Kojto 115:87f2f5183dfb 538 /**
Kojto 115:87f2f5183dfb 539 * @}
Kojto 115:87f2f5183dfb 540 */
Kojto 115:87f2f5183dfb 541
Kojto 115:87f2f5183dfb 542 /**
Kojto 115:87f2f5183dfb 543 * @}
Kojto 115:87f2f5183dfb 544 */
Kojto 115:87f2f5183dfb 545
Kojto 115:87f2f5183dfb 546 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 547 }
Kojto 115:87f2f5183dfb 548 #endif
Kojto 115:87f2f5183dfb 549
Kojto 115:87f2f5183dfb 550 #endif /* __STM32F7xx_HAL_TIM_EX_H */
Kojto 115:87f2f5183dfb 551
Kojto 115:87f2f5183dfb 552 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/