cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
116:c0f6e94411f5
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

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 122:f9eeca106725 5 * @version V1.1.0
Kojto 122:f9eeca106725 6 * @date 22-April-2016
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 122:f9eeca106725 11 * <h2><center>&copy; COPYRIGHT(c) 2016 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 122:f9eeca106725 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 122:f9eeca106725 124 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
Kojto 122:f9eeca106725 125 /**
Kojto 122:f9eeca106725 126 * @brief TIM Break/Break2 input configuration
Kojto 122:f9eeca106725 127 */
Kojto 122:f9eeca106725 128 typedef struct {
Kojto 122:f9eeca106725 129 uint32_t Source; /*!< Specifies the source of the timer break input.
Kojto 122:f9eeca106725 130 This parameter can be a value of @ref TIMEx_Break_Input_Source */
Kojto 122:f9eeca106725 131 uint32_t Enable; /*!< Specifies whether or not the break input source is enabled.
Kojto 122:f9eeca106725 132 This parameter can be a value of @ref TIMEx_Break_Input_Source_Enable */
Kojto 122:f9eeca106725 133 } TIMEx_BreakInputConfigTypeDef;
Kojto 122:f9eeca106725 134 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
Kojto 115:87f2f5183dfb 135 /**
Kojto 115:87f2f5183dfb 136 * @}
Kojto 116:c0f6e94411f5 137 */
Kojto 115:87f2f5183dfb 138 /* Exported constants --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 139 /** @defgroup TIMEx_Exported_Constants TIMEx Exported Constants
Kojto 115:87f2f5183dfb 140 * @{
Kojto 115:87f2f5183dfb 141 */
Kojto 115:87f2f5183dfb 142
Kojto 115:87f2f5183dfb 143 /** @defgroup TIMEx_Channel TIMEx Channel
Kojto 115:87f2f5183dfb 144 * @{
Kojto 115:87f2f5183dfb 145 */
Kojto 115:87f2f5183dfb 146
Kojto 122:f9eeca106725 147 #define TIM_CHANNEL_1 ((uint32_t)0x0000U)
Kojto 122:f9eeca106725 148 #define TIM_CHANNEL_2 ((uint32_t)0x0004U)
Kojto 122:f9eeca106725 149 #define TIM_CHANNEL_3 ((uint32_t)0x0008U)
Kojto 122:f9eeca106725 150 #define TIM_CHANNEL_4 ((uint32_t)0x000CU)
Kojto 122:f9eeca106725 151 #define TIM_CHANNEL_5 ((uint32_t)0x0010U)
Kojto 122:f9eeca106725 152 #define TIM_CHANNEL_6 ((uint32_t)0x0014U)
Kojto 122:f9eeca106725 153 #define TIM_CHANNEL_ALL ((uint32_t)0x003CU)
Kojto 115:87f2f5183dfb 154
Kojto 115:87f2f5183dfb 155 /**
Kojto 115:87f2f5183dfb 156 * @}
Kojto 115:87f2f5183dfb 157 */
Kojto 115:87f2f5183dfb 158
Kojto 115:87f2f5183dfb 159 /** @defgroup TIMEx_Output_Compare_and_PWM_modes TIMEx Output Compare and PWM Modes
Kojto 115:87f2f5183dfb 160 * @{
Kojto 115:87f2f5183dfb 161 */
Kojto 122:f9eeca106725 162 #define TIM_OCMODE_TIMING ((uint32_t)0x0000U)
Kojto 115:87f2f5183dfb 163 #define TIM_OCMODE_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 164 #define TIM_OCMODE_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_1)
Kojto 115:87f2f5183dfb 165 #define TIM_OCMODE_TOGGLE ((uint32_t)TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 166 #define TIM_OCMODE_PWM1 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1)
Kojto 115:87f2f5183dfb 167 #define TIM_OCMODE_PWM2 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 168 #define TIM_OCMODE_FORCED_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 169 #define TIM_OCMODE_FORCED_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 170
Kojto 115:87f2f5183dfb 171 #define TIM_OCMODE_RETRIGERRABLE_OPM1 ((uint32_t)TIM_CCMR1_OC1M_3)
Kojto 115:87f2f5183dfb 172 #define TIM_OCMODE_RETRIGERRABLE_OPM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0)
Kojto 115:87f2f5183dfb 173 #define TIM_OCMODE_COMBINED_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 174 #define TIM_OCMODE_COMBINED_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 175 #define TIM_OCMODE_ASSYMETRIC_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2)
Kojto 115:87f2f5183dfb 176 #define TIM_OCMODE_ASSYMETRIC_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M)
Kojto 115:87f2f5183dfb 177 /**
Kojto 115:87f2f5183dfb 178 * @}
Kojto 115:87f2f5183dfb 179 */
Kojto 115:87f2f5183dfb 180
Kojto 115:87f2f5183dfb 181 /** @defgroup TIMEx_Remap TIMEx Remap
Kojto 115:87f2f5183dfb 182 * @{
Kojto 115:87f2f5183dfb 183 */
Kojto 122:f9eeca106725 184 #define TIM_TIM2_TIM8_TRGO (0x00000000U)
Kojto 122:f9eeca106725 185 #define TIM_TIM2_ETH_PTP (0x00000400U)
Kojto 122:f9eeca106725 186 #define TIM_TIM2_USBFS_SOF (0x00000800U)
Kojto 122:f9eeca106725 187 #define TIM_TIM2_USBHS_SOF (0x00000C00U)
Kojto 122:f9eeca106725 188 #define TIM_TIM5_GPIO (0x00000000U)
Kojto 122:f9eeca106725 189 #define TIM_TIM5_LSI (0x00000040U)
Kojto 122:f9eeca106725 190 #define TIM_TIM5_LSE (0x00000080U)
Kojto 122:f9eeca106725 191 #define TIM_TIM5_RTC (0x000000C0U)
Kojto 122:f9eeca106725 192 #define TIM_TIM11_GPIO (0x00000000U)
Kojto 122:f9eeca106725 193 #define TIM_TIM11_SPDIFRX (0x00000001U)
Kojto 122:f9eeca106725 194 #define TIM_TIM11_HSE (0x00000002U)
Kojto 122:f9eeca106725 195 #define TIM_TIM11_MCO1 (0x00000003U)
Kojto 115:87f2f5183dfb 196 /**
Kojto 115:87f2f5183dfb 197 * @}
Kojto 115:87f2f5183dfb 198 */
Kojto 115:87f2f5183dfb 199
Kojto 115:87f2f5183dfb 200 /** @defgroup TIMEx_ClearInput_Source TIMEx Clear Input Source
Kojto 115:87f2f5183dfb 201 * @{
Kojto 115:87f2f5183dfb 202 */
Kojto 122:f9eeca106725 203 #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001U)
Kojto 122:f9eeca106725 204 #define TIM_CLEARINPUTSOURCE_OCREFCLR ((uint32_t)0x0002U)
Kojto 122:f9eeca106725 205 #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000U)
Kojto 115:87f2f5183dfb 206 /**
Kojto 115:87f2f5183dfb 207 * @}
Kojto 115:87f2f5183dfb 208 */
Kojto 115:87f2f5183dfb 209
Kojto 115:87f2f5183dfb 210 /** @defgroup TIMEx_Break2_Input_enable_disable TIMEx Break input 2 Enable
Kojto 115:87f2f5183dfb 211 * @{
Kojto 115:87f2f5183dfb 212 */
Kojto 122:f9eeca106725 213 #define TIM_BREAK2_DISABLE ((uint32_t)0x00000000U)
Kojto 115:87f2f5183dfb 214 #define TIM_BREAK2_ENABLE ((uint32_t)TIM_BDTR_BK2E)
Kojto 115:87f2f5183dfb 215 /**
Kojto 115:87f2f5183dfb 216 * @}
Kojto 115:87f2f5183dfb 217 */
Kojto 115:87f2f5183dfb 218
Kojto 115:87f2f5183dfb 219 /** @defgroup TIMEx_Break2_Polarity TIMEx Break2 Polarity
Kojto 115:87f2f5183dfb 220 * @{
Kojto 115:87f2f5183dfb 221 */
Kojto 122:f9eeca106725 222 #define TIM_BREAK2POLARITY_LOW ((uint32_t)0x00000000U)
Kojto 115:87f2f5183dfb 223 #define TIM_BREAK2POLARITY_HIGH (TIM_BDTR_BK2P)
Kojto 115:87f2f5183dfb 224 /**
Kojto 115:87f2f5183dfb 225 * @}
Kojto 115:87f2f5183dfb 226 */
Kojto 115:87f2f5183dfb 227
Kojto 115:87f2f5183dfb 228 /** @defgroup TIMEx_Group_Channel5 TIMEx Group Channel 5 and Channel 1, 2 or 3
Kojto 115:87f2f5183dfb 229 * @{
Kojto 115:87f2f5183dfb 230 */
Kojto 122:f9eeca106725 231 #define TIM_GROUPCH5_NONE ((uint32_t)0x00000000U) /* !< No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC */
Kojto 115:87f2f5183dfb 232 #define TIM_GROUPCH5_OC1REFC (TIM_CCR5_GC5C1) /* !< OC1REFC is the logical AND of OC1REFC and OC5REF */
Kojto 115:87f2f5183dfb 233 #define TIM_GROUPCH5_OC2REFC (TIM_CCR5_GC5C2) /* !< OC2REFC is the logical AND of OC2REFC and OC5REF */
Kojto 115:87f2f5183dfb 234 #define TIM_GROUPCH5_OC3REFC (TIM_CCR5_GC5C3) /* !< OC3REFC is the logical AND of OC3REFC and OC5REF */
Kojto 115:87f2f5183dfb 235 /**
Kojto 115:87f2f5183dfb 236 * @}
Kojto 115:87f2f5183dfb 237 */
Kojto 115:87f2f5183dfb 238
Kojto 115:87f2f5183dfb 239 /** @defgroup TIMEx_Master_Mode_Selection_2 TIMEx Master Mode Selection 2 (TRGO2)
Kojto 115:87f2f5183dfb 240 * @{
Kojto 115:87f2f5183dfb 241 */
Kojto 122:f9eeca106725 242 #define TIM_TRGO2_RESET ((uint32_t)0x00000000U)
Kojto 115:87f2f5183dfb 243 #define TIM_TRGO2_ENABLE ((uint32_t)(TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 244 #define TIM_TRGO2_UPDATE ((uint32_t)(TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 245 #define TIM_TRGO2_OC1 ((uint32_t)(TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 246 #define TIM_TRGO2_OC1REF ((uint32_t)(TIM_CR2_MMS2_2))
Kojto 115:87f2f5183dfb 247 #define TIM_TRGO2_OC2REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 248 #define TIM_TRGO2_OC3REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 249 #define TIM_TRGO2_OC4REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 250 #define TIM_TRGO2_OC5REF ((uint32_t)(TIM_CR2_MMS2_3))
Kojto 115:87f2f5183dfb 251 #define TIM_TRGO2_OC6REF ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 252 #define TIM_TRGO2_OC4REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 253 #define TIM_TRGO2_OC6REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 254 #define TIM_TRGO2_OC4REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2))
Kojto 115:87f2f5183dfb 255 #define TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0))
Kojto 115:87f2f5183dfb 256 #define TIM_TRGO2_OC5REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 |TIM_CR2_MMS2_1))
Kojto 115:87f2f5183dfb 257 #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 258 /**
Kojto 115:87f2f5183dfb 259 * @}
Kojto 115:87f2f5183dfb 260 */
Kojto 115:87f2f5183dfb 261
Kojto 115:87f2f5183dfb 262 /** @defgroup TIMEx_Slave_Mode TIMEx Slave mode
Kojto 115:87f2f5183dfb 263 * @{
Kojto 115:87f2f5183dfb 264 */
Kojto 122:f9eeca106725 265 #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000U)
Kojto 115:87f2f5183dfb 266 #define TIM_SLAVEMODE_RESET ((uint32_t)(TIM_SMCR_SMS_2))
Kojto 115:87f2f5183dfb 267 #define TIM_SLAVEMODE_GATED ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_0))
Kojto 115:87f2f5183dfb 268 #define TIM_SLAVEMODE_TRIGGER ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1))
Kojto 115:87f2f5183dfb 269 #define TIM_SLAVEMODE_EXTERNAL1 ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0))
Kojto 115:87f2f5183dfb 270 #define TIM_SLAVEMODE_COMBINED_RESETTRIGGER ((uint32_t)(TIM_SMCR_SMS_3))
Kojto 115:87f2f5183dfb 271 /**
Kojto 115:87f2f5183dfb 272 * @}
Kojto 115:87f2f5183dfb 273 */
Kojto 122:f9eeca106725 274 #if defined(STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
Kojto 122:f9eeca106725 275 /** @defgroup TIMEx_Break_Input TIM Extended Break input
Kojto 122:f9eeca106725 276 * @{
Kojto 122:f9eeca106725 277 */
Kojto 122:f9eeca106725 278 #define TIM_BREAKINPUT_BRK ((uint32_t)0x00000001U) /* !< Timer break input */
Kojto 122:f9eeca106725 279 #define TIM_BREAKINPUT_BRK2 ((uint32_t)0x00000002U) /* !< Timer break2 input */
Kojto 122:f9eeca106725 280 /**
Kojto 122:f9eeca106725 281 * @}
Kojto 122:f9eeca106725 282 */
Kojto 116:c0f6e94411f5 283
Kojto 122:f9eeca106725 284 /** @defgroup TIMEx_Break_Input_Source TIM Extended Break input source
Kojto 122:f9eeca106725 285 * @{
Kojto 122:f9eeca106725 286 */
Kojto 122:f9eeca106725 287 #define TIM_BREAKINPUTSOURCE_BKIN ((uint32_t)0x00000001U) /* !< An external source (GPIO) is connected to the BKIN pin */
Kojto 122:f9eeca106725 288 #define TIM_BREAKINPUTSOURCE_DFSDM1 ((uint32_t)0x00000008U) /* !< The analog watchdog output of the DFSDM1 peripheral is connected to the break input */
Kojto 122:f9eeca106725 289 /**
Kojto 122:f9eeca106725 290 * @}
Kojto 122:f9eeca106725 291 */
Kojto 122:f9eeca106725 292
Kojto 122:f9eeca106725 293 /** @defgroup TIMEx_Break_Input_Source_Enable TIM Extended Break input source enabling
Kojto 122:f9eeca106725 294 * @{
Kojto 122:f9eeca106725 295 */
Kojto 122:f9eeca106725 296 #define TIM_BREAKINPUTSOURCE_DISABLE ((uint32_t)0x00000000U) /* !< Break input source is disabled */
Kojto 122:f9eeca106725 297 #define TIM_BREAKINPUTSOURCE_ENABLE ((uint32_t)0x00000001U) /* !< Break input source is enabled */
Kojto 122:f9eeca106725 298 /**
Kojto 122:f9eeca106725 299 * @}
Kojto 122:f9eeca106725 300 */
Kojto 122:f9eeca106725 301
Kojto 122:f9eeca106725 302 /**
Kojto 122:f9eeca106725 303 * @}
Kojto 122:f9eeca106725 304 */
Kojto 122:f9eeca106725 305 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
Kojto 115:87f2f5183dfb 306 /**
Kojto 115:87f2f5183dfb 307 * @}
Kojto 115:87f2f5183dfb 308 */
Kojto 115:87f2f5183dfb 309
Kojto 115:87f2f5183dfb 310 /* Exported macro ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 311 /** @defgroup TIMEx_Exported_Macros TIMEx Exported Macros
Kojto 115:87f2f5183dfb 312 * @{
Kojto 115:87f2f5183dfb 313 */
Kojto 115:87f2f5183dfb 314
Kojto 115:87f2f5183dfb 315 /**
Kojto 115:87f2f5183dfb 316 * @brief Sets the TIM Capture Compare Register value on runtime without
Kojto 115:87f2f5183dfb 317 * calling another time ConfigChannel function.
Kojto 115:87f2f5183dfb 318 * @param __HANDLE__: TIM handle.
Kojto 115:87f2f5183dfb 319 * @param __CHANNEL__ : TIM Channels to be configured.
Kojto 115:87f2f5183dfb 320 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 321 * @arg TIM_CHANNEL_1: TIM Channel 1 selected
Kojto 115:87f2f5183dfb 322 * @arg TIM_CHANNEL_2: TIM Channel 2 selected
Kojto 115:87f2f5183dfb 323 * @arg TIM_CHANNEL_3: TIM Channel 3 selected
Kojto 115:87f2f5183dfb 324 * @arg TIM_CHANNEL_4: TIM Channel 4 selected
Kojto 115:87f2f5183dfb 325 * @arg TIM_CHANNEL_5: TIM Channel 5 selected
Kojto 115:87f2f5183dfb 326 * @arg TIM_CHANNEL_6: TIM Channel 6 selected
Kojto 115:87f2f5183dfb 327 * @param __COMPARE__: specifies the Capture Compare register new value.
Kojto 115:87f2f5183dfb 328 * @retval None
Kojto 115:87f2f5183dfb 329 */
Kojto 115:87f2f5183dfb 330 #define __HAL_TIM_SET_COMPARE(__HANDLE__, __CHANNEL__, __COMPARE__) \
Kojto 115:87f2f5183dfb 331 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 332 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 333 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 334 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4 = (__COMPARE__)) :\
Kojto 115:87f2f5183dfb 335 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5 = (__COMPARE__)) :\
Kojto 116:c0f6e94411f5 336 ((__HANDLE__)->Instance->CCR6 = (__COMPARE__)))
Kojto 115:87f2f5183dfb 337
Kojto 115:87f2f5183dfb 338 /**
Kojto 115:87f2f5183dfb 339 * @brief Gets the TIM Capture Compare Register value on runtime
Kojto 115:87f2f5183dfb 340 * @param __HANDLE__: TIM handle.
Kojto 115:87f2f5183dfb 341 * @param __CHANNEL__ : TIM Channel associated with the capture compare register
Kojto 115:87f2f5183dfb 342 * This parameter can be one of the following values:
Kojto 115:87f2f5183dfb 343 * @arg TIM_CHANNEL_1: get capture/compare 1 register value
Kojto 115:87f2f5183dfb 344 * @arg TIM_CHANNEL_2: get capture/compare 2 register value
Kojto 115:87f2f5183dfb 345 * @arg TIM_CHANNEL_3: get capture/compare 3 register value
Kojto 115:87f2f5183dfb 346 * @arg TIM_CHANNEL_4: get capture/compare 4 register value
Kojto 115:87f2f5183dfb 347 * @arg TIM_CHANNEL_5: get capture/compare 5 register value
Kojto 115:87f2f5183dfb 348 * @arg TIM_CHANNEL_6: get capture/compare 6 register value
Kojto 115:87f2f5183dfb 349 * @retval None
Kojto 115:87f2f5183dfb 350 */
Kojto 115:87f2f5183dfb 351 #define __HAL_TIM_GET_COMPARE(__HANDLE__, __CHANNEL__) \
Kojto 115:87f2f5183dfb 352 (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\
Kojto 115:87f2f5183dfb 353 ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\
Kojto 115:87f2f5183dfb 354 ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\
Kojto 115:87f2f5183dfb 355 ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4) :\
Kojto 115:87f2f5183dfb 356 ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5) :\
Kojto 115:87f2f5183dfb 357 ((__HANDLE__)->Instance->CCR6))
Kojto 115:87f2f5183dfb 358
Kojto 115:87f2f5183dfb 359 /**
Kojto 115:87f2f5183dfb 360 * @}
Kojto 115:87f2f5183dfb 361 */
Kojto 115:87f2f5183dfb 362
Kojto 115:87f2f5183dfb 363 /* Exported functions --------------------------------------------------------*/
Kojto 115:87f2f5183dfb 364 /** @addtogroup TIMEx_Exported_Functions
Kojto 115:87f2f5183dfb 365 * @{
Kojto 115:87f2f5183dfb 366 */
Kojto 115:87f2f5183dfb 367
Kojto 115:87f2f5183dfb 368 /** @addtogroup TIMEx_Exported_Functions_Group1
Kojto 115:87f2f5183dfb 369 * @{
Kojto 115:87f2f5183dfb 370 */
Kojto 115:87f2f5183dfb 371 /* Timer Hall Sensor functions **********************************************/
Kojto 115:87f2f5183dfb 372 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig);
Kojto 115:87f2f5183dfb 373 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 374
Kojto 115:87f2f5183dfb 375 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 376 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 377
Kojto 115:87f2f5183dfb 378 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 379 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 380 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 381 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 382 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 383 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 384 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 385 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 386 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 387 /**
Kojto 115:87f2f5183dfb 388 * @}
Kojto 115:87f2f5183dfb 389 */
Kojto 115:87f2f5183dfb 390
Kojto 115:87f2f5183dfb 391 /** @addtogroup TIMEx_Exported_Functions_Group2
Kojto 115:87f2f5183dfb 392 * @{
Kojto 115:87f2f5183dfb 393 */
Kojto 115:87f2f5183dfb 394 /* Timer Complementary Output Compare functions *****************************/
Kojto 115:87f2f5183dfb 395 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 396 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 397 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 398
Kojto 115:87f2f5183dfb 399 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 400 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 401 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 402
Kojto 115:87f2f5183dfb 403 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 404 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 405 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 406 /**
Kojto 115:87f2f5183dfb 407 * @}
Kojto 115:87f2f5183dfb 408 */
Kojto 115:87f2f5183dfb 409
Kojto 115:87f2f5183dfb 410 /** @addtogroup TIMEx_Exported_Functions_Group3
Kojto 115:87f2f5183dfb 411 * @{
Kojto 115:87f2f5183dfb 412 */
Kojto 115:87f2f5183dfb 413 /* Timer Complementary PWM functions ****************************************/
Kojto 115:87f2f5183dfb 414 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 415 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 416 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 417
Kojto 115:87f2f5183dfb 418 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 419 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 420 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 421 /* Non-Blocking mode: DMA */
Kojto 115:87f2f5183dfb 422 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
Kojto 115:87f2f5183dfb 423 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
Kojto 115:87f2f5183dfb 424 /**
Kojto 115:87f2f5183dfb 425 * @}
Kojto 115:87f2f5183dfb 426 */
Kojto 115:87f2f5183dfb 427
Kojto 115:87f2f5183dfb 428 /** @addtogroup TIMEx_Exported_Functions_Group4
Kojto 115:87f2f5183dfb 429 * @{
Kojto 115:87f2f5183dfb 430 */
Kojto 115:87f2f5183dfb 431 /* Timer Complementary One Pulse functions **********************************/
Kojto 115:87f2f5183dfb 432 /* Blocking mode: Polling */
Kojto 115:87f2f5183dfb 433 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 434 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 435
Kojto 115:87f2f5183dfb 436 /* Non-Blocking mode: Interrupt */
Kojto 115:87f2f5183dfb 437 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 438 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
Kojto 115:87f2f5183dfb 439 /**
Kojto 115:87f2f5183dfb 440 * @}
Kojto 115:87f2f5183dfb 441 */
Kojto 115:87f2f5183dfb 442
Kojto 115:87f2f5183dfb 443 /** @addtogroup TIMEx_Exported_Functions_Group5
Kojto 115:87f2f5183dfb 444 * @{
Kojto 115:87f2f5183dfb 445 */
Kojto 115:87f2f5183dfb 446 /* Extension Control functions ************************************************/
Kojto 115:87f2f5183dfb 447 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 448 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 449 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
Kojto 115:87f2f5183dfb 450 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig);
Kojto 115:87f2f5183dfb 451 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
Kojto 122:f9eeca106725 452 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
Kojto 122:f9eeca106725 453 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput, TIMEx_BreakInputConfigTypeDef *sBreakInputConfig);
Kojto 122:f9eeca106725 454 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
Kojto 115:87f2f5183dfb 455 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap);
Kojto 115:87f2f5183dfb 456 HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t OCRef);
Kojto 115:87f2f5183dfb 457 /**
Kojto 115:87f2f5183dfb 458 * @}
Kojto 115:87f2f5183dfb 459 */
Kojto 115:87f2f5183dfb 460
Kojto 115:87f2f5183dfb 461 /** @addtogroup TIMEx_Exported_Functions_Group6
Kojto 115:87f2f5183dfb 462 * @{
Kojto 115:87f2f5183dfb 463 */
Kojto 115:87f2f5183dfb 464 /* Extension Callback *********************************************************/
Kojto 115:87f2f5183dfb 465 void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 466 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 467 void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
Kojto 115:87f2f5183dfb 468 /**
Kojto 115:87f2f5183dfb 469 * @}
Kojto 115:87f2f5183dfb 470 */
Kojto 115:87f2f5183dfb 471
Kojto 115:87f2f5183dfb 472 /** @addtogroup TIMEx_Exported_Functions_Group7
Kojto 115:87f2f5183dfb 473 * @{
Kojto 115:87f2f5183dfb 474 */
Kojto 115:87f2f5183dfb 475 /* Extension Peripheral State functions **************************************/
Kojto 115:87f2f5183dfb 476 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim);
Kojto 115:87f2f5183dfb 477 /**
Kojto 115:87f2f5183dfb 478 * @}
Kojto 115:87f2f5183dfb 479 */
Kojto 115:87f2f5183dfb 480
Kojto 115:87f2f5183dfb 481 /**
Kojto 115:87f2f5183dfb 482 * @}
Kojto 115:87f2f5183dfb 483 */
Kojto 115:87f2f5183dfb 484
Kojto 115:87f2f5183dfb 485 /* Private types -------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 486 /* Private variables ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 487 /* Private constants ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 488 /* Private macros ------------------------------------------------------------*/
Kojto 115:87f2f5183dfb 489 /** @defgroup TIMEx_Private_Macros TIMEx Private Macros
Kojto 115:87f2f5183dfb 490 * @{
Kojto 115:87f2f5183dfb 491 */
Kojto 115:87f2f5183dfb 492 #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 493 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 115:87f2f5183dfb 494 ((CHANNEL) == TIM_CHANNEL_3) || \
Kojto 115:87f2f5183dfb 495 ((CHANNEL) == TIM_CHANNEL_4) || \
Kojto 115:87f2f5183dfb 496 ((CHANNEL) == TIM_CHANNEL_5) || \
Kojto 115:87f2f5183dfb 497 ((CHANNEL) == TIM_CHANNEL_6) || \
Kojto 115:87f2f5183dfb 498 ((CHANNEL) == TIM_CHANNEL_ALL))
Kojto 115:87f2f5183dfb 499
Kojto 115:87f2f5183dfb 500 #define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 501 ((CHANNEL) == TIM_CHANNEL_2))
Kojto 115:87f2f5183dfb 502
Kojto 115:87f2f5183dfb 503 #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 504 ((CHANNEL) == TIM_CHANNEL_2))
Kojto 115:87f2f5183dfb 505
Kojto 115:87f2f5183dfb 506 #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \
Kojto 115:87f2f5183dfb 507 ((CHANNEL) == TIM_CHANNEL_2) || \
Kojto 115:87f2f5183dfb 508 ((CHANNEL) == TIM_CHANNEL_3))
Kojto 115:87f2f5183dfb 509 #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \
Kojto 115:87f2f5183dfb 510 ((MODE) == TIM_OCMODE_PWM2) || \
Kojto 115:87f2f5183dfb 511 ((MODE) == TIM_OCMODE_COMBINED_PWM1) || \
Kojto 115:87f2f5183dfb 512 ((MODE) == TIM_OCMODE_COMBINED_PWM2) || \
Kojto 115:87f2f5183dfb 513 ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM1) || \
Kojto 115:87f2f5183dfb 514 ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM2))
Kojto 115:87f2f5183dfb 515
Kojto 115:87f2f5183dfb 516 #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \
Kojto 115:87f2f5183dfb 517 ((MODE) == TIM_OCMODE_ACTIVE) || \
Kojto 115:87f2f5183dfb 518 ((MODE) == TIM_OCMODE_INACTIVE) || \
Kojto 115:87f2f5183dfb 519 ((MODE) == TIM_OCMODE_TOGGLE) || \
Kojto 115:87f2f5183dfb 520 ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \
Kojto 115:87f2f5183dfb 521 ((MODE) == TIM_OCMODE_FORCED_INACTIVE) || \
Kojto 115:87f2f5183dfb 522 ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM1) || \
Kojto 115:87f2f5183dfb 523 ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM2))
Kojto 115:87f2f5183dfb 524 #define IS_TIM_REMAP(__TIM_REMAP__) (((__TIM_REMAP__) == TIM_TIM2_TIM8_TRGO)||\
Kojto 115:87f2f5183dfb 525 ((__TIM_REMAP__) == TIM_TIM2_ETH_PTP)||\
Kojto 115:87f2f5183dfb 526 ((__TIM_REMAP__) == TIM_TIM2_USBFS_SOF)||\
Kojto 115:87f2f5183dfb 527 ((__TIM_REMAP__) == TIM_TIM2_USBHS_SOF)||\
Kojto 115:87f2f5183dfb 528 ((__TIM_REMAP__) == TIM_TIM5_GPIO)||\
Kojto 115:87f2f5183dfb 529 ((__TIM_REMAP__) == TIM_TIM5_LSI)||\
Kojto 115:87f2f5183dfb 530 ((__TIM_REMAP__) == TIM_TIM5_LSE)||\
Kojto 115:87f2f5183dfb 531 ((__TIM_REMAP__) == TIM_TIM5_RTC)||\
Kojto 115:87f2f5183dfb 532 ((__TIM_REMAP__) == TIM_TIM11_GPIO)||\
Kojto 115:87f2f5183dfb 533 ((__TIM_REMAP__) == TIM_TIM11_SPDIFRX)||\
Kojto 115:87f2f5183dfb 534 ((__TIM_REMAP__) == TIM_TIM11_HSE)||\
Kojto 115:87f2f5183dfb 535 ((__TIM_REMAP__) == TIM_TIM11_MCO1))
Kojto 115:87f2f5183dfb 536 #define IS_TIM_DEADTIME(__DEADTIME__) ((__DEADTIME__) <= 0xFF)
Kojto 115:87f2f5183dfb 537 #define IS_TIM_BREAK_FILTER(__FILTER__) ((__FILTER__) <= 0xF)
Kojto 115:87f2f5183dfb 538 #define IS_TIM_CLEARINPUT_SOURCE(MODE) (((MODE) == TIM_CLEARINPUTSOURCE_ETR) || \
Kojto 115:87f2f5183dfb 539 ((MODE) == TIM_CLEARINPUTSOURCE_OCREFCLR) || \
Kojto 115:87f2f5183dfb 540 ((MODE) == TIM_CLEARINPUTSOURCE_NONE))
Kojto 115:87f2f5183dfb 541 #define IS_TIM_BREAK2_STATE(STATE) (((STATE) == TIM_BREAK2_ENABLE) || \
Kojto 115:87f2f5183dfb 542 ((STATE) == TIM_BREAK2_DISABLE))
Kojto 115:87f2f5183dfb 543 #define IS_TIM_BREAK2_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAK2POLARITY_LOW) || \
Kojto 115:87f2f5183dfb 544 ((__POLARITY__) == TIM_BREAK2POLARITY_HIGH))
Kojto 115:87f2f5183dfb 545 #define IS_TIM_GROUPCH5(OCREF) ((((OCREF) & 0x1FFFFFFF) == 0x00000000))
Kojto 115:87f2f5183dfb 546 #define IS_TIM_TRGO2_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO2_RESET) || \
Kojto 115:87f2f5183dfb 547 ((SOURCE) == TIM_TRGO2_ENABLE) || \
Kojto 115:87f2f5183dfb 548 ((SOURCE) == TIM_TRGO2_UPDATE) || \
Kojto 115:87f2f5183dfb 549 ((SOURCE) == TIM_TRGO2_OC1) || \
Kojto 115:87f2f5183dfb 550 ((SOURCE) == TIM_TRGO2_OC1REF) || \
Kojto 115:87f2f5183dfb 551 ((SOURCE) == TIM_TRGO2_OC2REF) || \
Kojto 115:87f2f5183dfb 552 ((SOURCE) == TIM_TRGO2_OC3REF) || \
Kojto 115:87f2f5183dfb 553 ((SOURCE) == TIM_TRGO2_OC3REF) || \
Kojto 115:87f2f5183dfb 554 ((SOURCE) == TIM_TRGO2_OC4REF) || \
Kojto 115:87f2f5183dfb 555 ((SOURCE) == TIM_TRGO2_OC5REF) || \
Kojto 115:87f2f5183dfb 556 ((SOURCE) == TIM_TRGO2_OC6REF) || \
Kojto 115:87f2f5183dfb 557 ((SOURCE) == TIM_TRGO2_OC4REF_RISINGFALLING) || \
Kojto 115:87f2f5183dfb 558 ((SOURCE) == TIM_TRGO2_OC6REF_RISINGFALLING) || \
Kojto 115:87f2f5183dfb 559 ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_RISING) || \
Kojto 115:87f2f5183dfb 560 ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING) || \
Kojto 115:87f2f5183dfb 561 ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_RISING) || \
Kojto 115:87f2f5183dfb 562 ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING))
Kojto 115:87f2f5183dfb 563 #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \
Kojto 115:87f2f5183dfb 564 ((MODE) == TIM_SLAVEMODE_RESET) || \
Kojto 115:87f2f5183dfb 565 ((MODE) == TIM_SLAVEMODE_GATED) || \
Kojto 115:87f2f5183dfb 566 ((MODE) == TIM_SLAVEMODE_TRIGGER) || \
Kojto 115:87f2f5183dfb 567 ((MODE) == TIM_SLAVEMODE_EXTERNAL1) || \
Kojto 115:87f2f5183dfb 568 ((MODE) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER))
Kojto 115:87f2f5183dfb 569
Kojto 122:f9eeca106725 570 #if defined (STM32F765xx) || defined(STM32F767xx) || defined(STM32F769xx) || defined(STM32F777xx) || defined(STM32F779xx)
Kojto 122:f9eeca106725 571 #define IS_TIM_BREAKINPUT(__BREAKINPUT__) (((__BREAKINPUT__) == TIM_BREAKINPUT_BRK) || \
Kojto 122:f9eeca106725 572 ((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2))
Kojto 122:f9eeca106725 573
Kojto 122:f9eeca106725 574 #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN) || \
Kojto 122:f9eeca106725 575 ((__SOURCE__) == TIM_BREAKINPUTSOURCE_DFSDM))
Kojto 122:f9eeca106725 576
Kojto 122:f9eeca106725 577 #define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__) (((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE) || \
Kojto 122:f9eeca106725 578 ((__STATE__) == TIM_BREAKINPUTSOURCE_ENABLE))
Kojto 122:f9eeca106725 579
Kojto 122:f9eeca106725 580 #endif /* STM32F767xx || STM32F769xx || STM32F777xx || STM32F779xx */
Kojto 115:87f2f5183dfb 581 /**
Kojto 115:87f2f5183dfb 582 * @}
Kojto 115:87f2f5183dfb 583 */
Kojto 115:87f2f5183dfb 584
Kojto 115:87f2f5183dfb 585 /* Private functions ---------------------------------------------------------*/
Kojto 115:87f2f5183dfb 586 /** @defgroup TIMEx_Private_Functions TIMEx Private Functions
Kojto 115:87f2f5183dfb 587 * @{
Kojto 115:87f2f5183dfb 588 */
Kojto 115:87f2f5183dfb 589
Kojto 115:87f2f5183dfb 590 /**
Kojto 115:87f2f5183dfb 591 * @}
Kojto 115:87f2f5183dfb 592 */
Kojto 115:87f2f5183dfb 593
Kojto 115:87f2f5183dfb 594 /**
Kojto 115:87f2f5183dfb 595 * @}
Kojto 115:87f2f5183dfb 596 */
Kojto 115:87f2f5183dfb 597
Kojto 115:87f2f5183dfb 598 /**
Kojto 115:87f2f5183dfb 599 * @}
Kojto 115:87f2f5183dfb 600 */
Kojto 115:87f2f5183dfb 601
Kojto 115:87f2f5183dfb 602 #ifdef __cplusplus
Kojto 115:87f2f5183dfb 603 }
Kojto 115:87f2f5183dfb 604 #endif
Kojto 115:87f2f5183dfb 605
Kojto 115:87f2f5183dfb 606 #endif /* __STM32F7xx_HAL_TIM_EX_H */
Kojto 115:87f2f5183dfb 607
Kojto 115:87f2f5183dfb 608 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/