mbed library sources modified for open wear
Dependents: openwear-lifelogger-example
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F334R8/stm32f3xx_hal_tim_ex.h@310:6188e0254baa, 2014-09-16 (annotated)
- Committer:
- janekm
- Date:
- Tue Sep 16 22:42:01 2014 +0000
- Revision:
- 310:6188e0254baa
- Parent:
- 237:f3da66175598
N/A
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 237:f3da66175598 | 1 | /** |
mbed_official | 237:f3da66175598 | 2 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 3 | * @file stm32f3xx_hal_tim_ex.h |
mbed_official | 237:f3da66175598 | 4 | * @author MCD Application Team |
mbed_official | 237:f3da66175598 | 5 | * @version V1.0.1 |
mbed_official | 237:f3da66175598 | 6 | * @date 18-June-2014 |
mbed_official | 237:f3da66175598 | 7 | * @brief Header file of TIM HAL Extension module. |
mbed_official | 237:f3da66175598 | 8 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 9 | * @attention |
mbed_official | 237:f3da66175598 | 10 | * |
mbed_official | 237:f3da66175598 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 237:f3da66175598 | 12 | * |
mbed_official | 237:f3da66175598 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 237:f3da66175598 | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 237:f3da66175598 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 237:f3da66175598 | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 237:f3da66175598 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 237:f3da66175598 | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 237:f3da66175598 | 19 | * and/or other materials provided with the distribution. |
mbed_official | 237:f3da66175598 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 237:f3da66175598 | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 237:f3da66175598 | 22 | * without specific prior written permission. |
mbed_official | 237:f3da66175598 | 23 | * |
mbed_official | 237:f3da66175598 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 237:f3da66175598 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 237:f3da66175598 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 237:f3da66175598 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 237:f3da66175598 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 237:f3da66175598 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 237:f3da66175598 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 237:f3da66175598 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 237:f3da66175598 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 237:f3da66175598 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 237:f3da66175598 | 34 | * |
mbed_official | 237:f3da66175598 | 35 | ****************************************************************************** |
mbed_official | 237:f3da66175598 | 36 | */ |
mbed_official | 237:f3da66175598 | 37 | |
mbed_official | 237:f3da66175598 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 237:f3da66175598 | 39 | #ifndef __STM32F3xx_HAL_TIM_EX_H |
mbed_official | 237:f3da66175598 | 40 | #define __STM32F3xx_HAL_TIM_EX_H |
mbed_official | 237:f3da66175598 | 41 | |
mbed_official | 237:f3da66175598 | 42 | #ifdef __cplusplus |
mbed_official | 237:f3da66175598 | 43 | extern "C" { |
mbed_official | 237:f3da66175598 | 44 | #endif |
mbed_official | 237:f3da66175598 | 45 | |
mbed_official | 237:f3da66175598 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 47 | #include "stm32f3xx_hal_def.h" |
mbed_official | 237:f3da66175598 | 48 | |
mbed_official | 237:f3da66175598 | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
mbed_official | 237:f3da66175598 | 50 | * @{ |
mbed_official | 237:f3da66175598 | 51 | */ |
mbed_official | 237:f3da66175598 | 52 | |
mbed_official | 237:f3da66175598 | 53 | /** @addtogroup TIMEx |
mbed_official | 237:f3da66175598 | 54 | * @{ |
mbed_official | 237:f3da66175598 | 55 | */ |
mbed_official | 237:f3da66175598 | 56 | |
mbed_official | 237:f3da66175598 | 57 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 58 | |
mbed_official | 237:f3da66175598 | 59 | /** |
mbed_official | 237:f3da66175598 | 60 | * @brief TIM Hall sensor Configuration Structure definition |
mbed_official | 237:f3da66175598 | 61 | */ |
mbed_official | 237:f3da66175598 | 62 | |
mbed_official | 237:f3da66175598 | 63 | typedef struct |
mbed_official | 237:f3da66175598 | 64 | { |
mbed_official | 237:f3da66175598 | 65 | |
mbed_official | 237:f3da66175598 | 66 | uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal. |
mbed_official | 237:f3da66175598 | 67 | This parameter can be a value of @ref TIM_Input_Capture_Polarity */ |
mbed_official | 237:f3da66175598 | 68 | |
mbed_official | 237:f3da66175598 | 69 | uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler. |
mbed_official | 237:f3da66175598 | 70 | This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ |
mbed_official | 237:f3da66175598 | 71 | |
mbed_official | 237:f3da66175598 | 72 | uint32_t IC1Filter; /*!< Specifies the input capture filter. |
mbed_official | 237:f3da66175598 | 73 | This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ |
mbed_official | 237:f3da66175598 | 74 | uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. |
mbed_official | 237:f3da66175598 | 75 | This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */ |
mbed_official | 237:f3da66175598 | 76 | } TIM_HallSensor_InitTypeDef; |
mbed_official | 237:f3da66175598 | 77 | |
mbed_official | 237:f3da66175598 | 78 | #if defined(STM32F373xC) || defined(STM32F378xx) |
mbed_official | 237:f3da66175598 | 79 | /** |
mbed_official | 237:f3da66175598 | 80 | * @brief TIM Master configuration Structure definition |
mbed_official | 237:f3da66175598 | 81 | * @note STM32F373xC and STM32F378xx: timer instances provide a single TRGO |
mbed_official | 237:f3da66175598 | 82 | * output |
mbed_official | 237:f3da66175598 | 83 | */ |
mbed_official | 237:f3da66175598 | 84 | typedef struct { |
mbed_official | 237:f3da66175598 | 85 | uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection |
mbed_official | 237:f3da66175598 | 86 | This parameter can be a value of @ref TIM_Master_Mode_Selection */ |
mbed_official | 237:f3da66175598 | 87 | uint32_t MasterSlaveMode; /*!< Master/slave mode selection |
mbed_official | 237:f3da66175598 | 88 | This parameter can be a value of @ref TIM_Master_Slave_Mode */ |
mbed_official | 237:f3da66175598 | 89 | }TIM_MasterConfigTypeDef; |
mbed_official | 237:f3da66175598 | 90 | |
mbed_official | 237:f3da66175598 | 91 | /** |
mbed_official | 237:f3da66175598 | 92 | * @brief TIM Break and Dead time configuration Structure definition |
mbed_official | 237:f3da66175598 | 93 | * @note STM32F373xC and STM32F378xx: single break input with configurable polarity. |
mbed_official | 237:f3da66175598 | 94 | */ |
mbed_official | 237:f3da66175598 | 95 | typedef struct |
mbed_official | 237:f3da66175598 | 96 | { |
mbed_official | 237:f3da66175598 | 97 | uint32_t OffStateRunMode; /*!< TIM off state in run mode |
mbed_official | 237:f3da66175598 | 98 | This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */ |
mbed_official | 237:f3da66175598 | 99 | uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode |
mbed_official | 237:f3da66175598 | 100 | This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */ |
mbed_official | 237:f3da66175598 | 101 | uint32_t LockLevel; /*!< TIM Lock level |
mbed_official | 237:f3da66175598 | 102 | This parameter can be a value of @ref TIM_Lock_level */ |
mbed_official | 237:f3da66175598 | 103 | uint32_t DeadTime; /*!< TIM dead Time |
mbed_official | 237:f3da66175598 | 104 | This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */ |
mbed_official | 237:f3da66175598 | 105 | uint32_t BreakState; /*!< TIM Break State |
mbed_official | 237:f3da66175598 | 106 | This parameter can be a value of @ref TIM_Break_Input_enable_disable */ |
mbed_official | 237:f3da66175598 | 107 | uint32_t BreakPolarity; /*!< TIM Break input polarity |
mbed_official | 237:f3da66175598 | 108 | This parameter can be a value of @ref TIM_Break_Polarity */ |
mbed_official | 237:f3da66175598 | 109 | uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state |
mbed_official | 237:f3da66175598 | 110 | This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ |
mbed_official | 237:f3da66175598 | 111 | } TIM_BreakDeadTimeConfigTypeDef; |
mbed_official | 237:f3da66175598 | 112 | |
mbed_official | 237:f3da66175598 | 113 | #endif /* STM32F373xC || STM32F378xx */ |
mbed_official | 237:f3da66175598 | 114 | |
mbed_official | 237:f3da66175598 | 115 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 116 | defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) || \ |
mbed_official | 237:f3da66175598 | 117 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 118 | /** |
mbed_official | 237:f3da66175598 | 119 | * @brief TIM Break input(s) and Dead time configuration Structure definition |
mbed_official | 237:f3da66175598 | 120 | * @note 2 break inputs can be configured (BKIN and BKIN2) with configurable |
mbed_official | 237:f3da66175598 | 121 | * filter and polarity. |
mbed_official | 237:f3da66175598 | 122 | */ |
mbed_official | 237:f3da66175598 | 123 | typedef struct |
mbed_official | 237:f3da66175598 | 124 | { |
mbed_official | 237:f3da66175598 | 125 | uint32_t OffStateRunMode; /*!< TIM off state in run mode |
mbed_official | 237:f3da66175598 | 126 | This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */ |
mbed_official | 237:f3da66175598 | 127 | uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode |
mbed_official | 237:f3da66175598 | 128 | This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */ |
mbed_official | 237:f3da66175598 | 129 | uint32_t LockLevel; /*!< TIM Lock level |
mbed_official | 237:f3da66175598 | 130 | This parameter can be a value of @ref TIM_Lock_level */ |
mbed_official | 237:f3da66175598 | 131 | uint32_t DeadTime; /*!< TIM dead Time |
mbed_official | 237:f3da66175598 | 132 | This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */ |
mbed_official | 237:f3da66175598 | 133 | uint32_t BreakState; /*!< TIM Break State |
mbed_official | 237:f3da66175598 | 134 | This parameter can be a value of @ref TIM_Break_Input_enable_disable */ |
mbed_official | 237:f3da66175598 | 135 | uint32_t BreakPolarity; /*!< TIM Break input polarity |
mbed_official | 237:f3da66175598 | 136 | This parameter can be a value of @ref TIM_Break_Polarity */ |
mbed_official | 237:f3da66175598 | 137 | uint32_t BreakFilter; /*!< Specifies the brek input filter. |
mbed_official | 237:f3da66175598 | 138 | This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ |
mbed_official | 237:f3da66175598 | 139 | uint32_t Break2State; /*!< TIM Break2 State |
mbed_official | 237:f3da66175598 | 140 | This parameter can be a value of @ref TIMEx_Break2_Input_enable_disable */ |
mbed_official | 237:f3da66175598 | 141 | uint32_t Break2Polarity; /*!< TIM Break2 input polarity |
mbed_official | 237:f3da66175598 | 142 | This parameter can be a value of @ref TIMEx_Break2_Polarity */ |
mbed_official | 237:f3da66175598 | 143 | uint32_t Break2Filter; /*!< TIM break2 input filter. |
mbed_official | 237:f3da66175598 | 144 | This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ |
mbed_official | 237:f3da66175598 | 145 | uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state |
mbed_official | 237:f3da66175598 | 146 | This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ |
mbed_official | 237:f3da66175598 | 147 | } TIM_BreakDeadTimeConfigTypeDef; |
mbed_official | 237:f3da66175598 | 148 | |
mbed_official | 237:f3da66175598 | 149 | /** |
mbed_official | 237:f3da66175598 | 150 | * @brief TIM Master configuration Structure definition |
mbed_official | 237:f3da66175598 | 151 | * @note Advanced timers provide TRGO2 internal line which is redirected |
mbed_official | 237:f3da66175598 | 152 | * to the ADC |
mbed_official | 237:f3da66175598 | 153 | */ |
mbed_official | 237:f3da66175598 | 154 | typedef struct { |
mbed_official | 237:f3da66175598 | 155 | uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection |
mbed_official | 237:f3da66175598 | 156 | This parameter can be a value of @ref TIM_Master_Mode_Selection */ |
mbed_official | 237:f3da66175598 | 157 | uint32_t MasterOutputTrigger2; /*!< Trigger output2 (TRGO2) selection |
mbed_official | 237:f3da66175598 | 158 | This parameter can be a value of @ref TIMEx_Master_Mode_Selection_2 */ |
mbed_official | 237:f3da66175598 | 159 | uint32_t MasterSlaveMode; /*!< Master/slave mode selection |
mbed_official | 237:f3da66175598 | 160 | This parameter can be a value of @ref TIM_Master_Slave_Mode */ |
mbed_official | 237:f3da66175598 | 161 | }TIM_MasterConfigTypeDef; |
mbed_official | 237:f3da66175598 | 162 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 163 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
mbed_official | 237:f3da66175598 | 164 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 165 | |
mbed_official | 237:f3da66175598 | 166 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 167 | /** @defgroup TIMEx_Exported_Constants |
mbed_official | 237:f3da66175598 | 168 | * @{ |
mbed_official | 237:f3da66175598 | 169 | */ |
mbed_official | 237:f3da66175598 | 170 | |
mbed_official | 237:f3da66175598 | 171 | #if defined(STM32F373xC) || defined(STM32F378xx) |
mbed_official | 237:f3da66175598 | 172 | /** @defgroup TIMEx_Channel |
mbed_official | 237:f3da66175598 | 173 | * @{ |
mbed_official | 237:f3da66175598 | 174 | */ |
mbed_official | 237:f3da66175598 | 175 | #define TIM_CHANNEL_1 ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 176 | #define TIM_CHANNEL_2 ((uint32_t)0x0004) |
mbed_official | 237:f3da66175598 | 177 | #define TIM_CHANNEL_3 ((uint32_t)0x0008) |
mbed_official | 237:f3da66175598 | 178 | #define TIM_CHANNEL_4 ((uint32_t)0x000C) |
mbed_official | 237:f3da66175598 | 179 | #define TIM_CHANNEL_ALL ((uint32_t)0x0018) |
mbed_official | 237:f3da66175598 | 180 | |
mbed_official | 237:f3da66175598 | 181 | #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 182 | ((CHANNEL) == TIM_CHANNEL_2) || \ |
mbed_official | 237:f3da66175598 | 183 | ((CHANNEL) == TIM_CHANNEL_3) || \ |
mbed_official | 237:f3da66175598 | 184 | ((CHANNEL) == TIM_CHANNEL_4) || \ |
mbed_official | 237:f3da66175598 | 185 | ((CHANNEL) == TIM_CHANNEL_ALL)) |
mbed_official | 237:f3da66175598 | 186 | |
mbed_official | 237:f3da66175598 | 187 | #define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 188 | ((CHANNEL) == TIM_CHANNEL_2)) |
mbed_official | 237:f3da66175598 | 189 | |
mbed_official | 237:f3da66175598 | 190 | #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 191 | ((CHANNEL) == TIM_CHANNEL_2)) |
mbed_official | 237:f3da66175598 | 192 | |
mbed_official | 237:f3da66175598 | 193 | #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 194 | ((CHANNEL) == TIM_CHANNEL_2) || \ |
mbed_official | 237:f3da66175598 | 195 | ((CHANNEL) == TIM_CHANNEL_3)) |
mbed_official | 237:f3da66175598 | 196 | /** |
mbed_official | 237:f3da66175598 | 197 | * @} |
mbed_official | 237:f3da66175598 | 198 | */ |
mbed_official | 237:f3da66175598 | 199 | |
mbed_official | 237:f3da66175598 | 200 | /** @defgroup TIMEx_Output_Compare_and_PWM_modes |
mbed_official | 237:f3da66175598 | 201 | * @{ |
mbed_official | 237:f3da66175598 | 202 | */ |
mbed_official | 237:f3da66175598 | 203 | |
mbed_official | 237:f3da66175598 | 204 | #define TIM_OCMODE_TIMING ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 205 | #define TIM_OCMODE_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 206 | #define TIM_OCMODE_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_1) |
mbed_official | 237:f3da66175598 | 207 | #define TIM_OCMODE_TOGGLE ((uint32_t)TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_1) |
mbed_official | 237:f3da66175598 | 208 | #define TIM_OCMODE_PWM1 ((uint32_t)TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 209 | #define TIM_OCMODE_PWM2 ((uint32_t)TIM_CCMR1_OC1M) |
mbed_official | 237:f3da66175598 | 210 | #define TIM_OCMODE_FORCED_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 211 | #define TIM_OCMODE_FORCED_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 212 | |
mbed_official | 237:f3da66175598 | 213 | #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \ |
mbed_official | 237:f3da66175598 | 214 | ((MODE) == TIM_OCMODE_PWM2)) |
mbed_official | 237:f3da66175598 | 215 | |
mbed_official | 237:f3da66175598 | 216 | #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \ |
mbed_official | 237:f3da66175598 | 217 | ((MODE) == TIM_OCMODE_ACTIVE) || \ |
mbed_official | 237:f3da66175598 | 218 | ((MODE) == TIM_OCMODE_INACTIVE) || \ |
mbed_official | 237:f3da66175598 | 219 | ((MODE) == TIM_OCMODE_TOGGLE) || \ |
mbed_official | 237:f3da66175598 | 220 | ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \ |
mbed_official | 237:f3da66175598 | 221 | ((MODE) == TIM_OCMODE_FORCED_INACTIVE)) |
mbed_official | 237:f3da66175598 | 222 | /** |
mbed_official | 237:f3da66175598 | 223 | * @} |
mbed_official | 237:f3da66175598 | 224 | */ |
mbed_official | 237:f3da66175598 | 225 | |
mbed_official | 237:f3da66175598 | 226 | /** @defgroup TIMEx_ClearInput_Source |
mbed_official | 237:f3da66175598 | 227 | * @{ |
mbed_official | 237:f3da66175598 | 228 | */ |
mbed_official | 237:f3da66175598 | 229 | #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001) |
mbed_official | 237:f3da66175598 | 230 | #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 231 | |
mbed_official | 237:f3da66175598 | 232 | #define IS_TIM_CLEARINPUT_SOURCE(SOURCE) (((SOURCE) == TIM_CLEARINPUTSOURCE_NONE) || \ |
mbed_official | 237:f3da66175598 | 233 | ((SOURCE) == TIM_CLEARINPUTSOURCE_ETR)) |
mbed_official | 237:f3da66175598 | 234 | /** |
mbed_official | 237:f3da66175598 | 235 | * @} |
mbed_official | 237:f3da66175598 | 236 | */ |
mbed_official | 237:f3da66175598 | 237 | |
mbed_official | 237:f3da66175598 | 238 | /** @defgroup TIMEx_Slave_Mode |
mbed_official | 237:f3da66175598 | 239 | * @{ |
mbed_official | 237:f3da66175598 | 240 | */ |
mbed_official | 237:f3da66175598 | 241 | |
mbed_official | 237:f3da66175598 | 242 | #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 243 | #define TIM_SLAVEMODE_RESET ((uint16_t)0x0004) |
mbed_official | 237:f3da66175598 | 244 | #define TIM_SLAVEMODE_GATED ((uint16_t)0x0005) |
mbed_official | 237:f3da66175598 | 245 | #define TIM_SLAVEMODE_TRIGGER ((uint16_t)0x0006) |
mbed_official | 237:f3da66175598 | 246 | #define TIM_SLAVEMODE_EXTERNAL1 ((uint16_t)0x0007) |
mbed_official | 237:f3da66175598 | 247 | |
mbed_official | 237:f3da66175598 | 248 | #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \ |
mbed_official | 237:f3da66175598 | 249 | ((MODE) == TIM_SLAVEMODE_RESET) || \ |
mbed_official | 237:f3da66175598 | 250 | ((MODE) == TIM_SLAVEMODE_GATED) || \ |
mbed_official | 237:f3da66175598 | 251 | ((MODE) == TIM_SLAVEMODE_TRIGGER) || \ |
mbed_official | 237:f3da66175598 | 252 | ((MODE) == TIM_SLAVEMODE_EXTERNAL1)) |
mbed_official | 237:f3da66175598 | 253 | /** |
mbed_official | 237:f3da66175598 | 254 | * @} |
mbed_official | 237:f3da66175598 | 255 | */ |
mbed_official | 237:f3da66175598 | 256 | |
mbed_official | 237:f3da66175598 | 257 | /** @defgroup TIMEx_Event_Source |
mbed_official | 237:f3da66175598 | 258 | * @{ |
mbed_official | 237:f3da66175598 | 259 | */ |
mbed_official | 237:f3da66175598 | 260 | |
mbed_official | 237:f3da66175598 | 261 | #define TIM_EventSource_Update TIM_EGR_UG /*!< Reinitialize the counter and generates an update of the registers */ |
mbed_official | 237:f3da66175598 | 262 | #define TIM_EventSource_CC1 TIM_EGR_CC1G /*!< A capture/compare event is generated on channel 1 */ |
mbed_official | 237:f3da66175598 | 263 | #define TIM_EventSource_CC2 TIM_EGR_CC2G /*!< A capture/compare event is generated on channel 2 */ |
mbed_official | 237:f3da66175598 | 264 | #define TIM_EventSource_CC3 TIM_EGR_CC3G /*!< A capture/compare event is generated on channel 3 */ |
mbed_official | 237:f3da66175598 | 265 | #define TIM_EventSource_CC4 TIM_EGR_CC4G /*!< A capture/compare event is generated on channel 4 */ |
mbed_official | 237:f3da66175598 | 266 | #define TIM_EventSource_COM TIM_EGR_COMG /*!< A commutation event is generated */ |
mbed_official | 237:f3da66175598 | 267 | #define TIM_EventSource_Trigger TIM_EGR_TG /*!< A trigger event is generated */ |
mbed_official | 237:f3da66175598 | 268 | #define TIM_EventSource_Break TIM_EGR_BG /*!< A break event is generated */ |
mbed_official | 237:f3da66175598 | 269 | #define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFF00) == 0x00000000) && ((SOURCE) != 0x00000000)) |
mbed_official | 237:f3da66175598 | 270 | |
mbed_official | 237:f3da66175598 | 271 | /** |
mbed_official | 237:f3da66175598 | 272 | * @} |
mbed_official | 237:f3da66175598 | 273 | */ |
mbed_official | 237:f3da66175598 | 274 | |
mbed_official | 237:f3da66175598 | 275 | /** @defgroup TIMEx_DMA_Base_address |
mbed_official | 237:f3da66175598 | 276 | * @{ |
mbed_official | 237:f3da66175598 | 277 | */ |
mbed_official | 237:f3da66175598 | 278 | |
mbed_official | 237:f3da66175598 | 279 | #define TIM_DMABase_CR1 (0x00000000) |
mbed_official | 237:f3da66175598 | 280 | #define TIM_DMABase_CR2 (0x00000001) |
mbed_official | 237:f3da66175598 | 281 | #define TIM_DMABase_SMCR (0x00000002) |
mbed_official | 237:f3da66175598 | 282 | #define TIM_DMABase_DIER (0x00000003) |
mbed_official | 237:f3da66175598 | 283 | #define TIM_DMABase_SR (0x00000004) |
mbed_official | 237:f3da66175598 | 284 | #define TIM_DMABase_EGR (0x00000005) |
mbed_official | 237:f3da66175598 | 285 | #define TIM_DMABase_CCMR1 (0x00000006) |
mbed_official | 237:f3da66175598 | 286 | #define TIM_DMABase_CCMR2 (0x00000007) |
mbed_official | 237:f3da66175598 | 287 | #define TIM_DMABase_CCER (0x00000008) |
mbed_official | 237:f3da66175598 | 288 | #define TIM_DMABase_CNT (0x00000009) |
mbed_official | 237:f3da66175598 | 289 | #define TIM_DMABase_PSC (0x0000000A) |
mbed_official | 237:f3da66175598 | 290 | #define TIM_DMABase_ARR (0x0000000B) |
mbed_official | 237:f3da66175598 | 291 | #define TIM_DMABase_RCR (0x0000000C) |
mbed_official | 237:f3da66175598 | 292 | #define TIM_DMABase_CCR1 (0x0000000D) |
mbed_official | 237:f3da66175598 | 293 | #define TIM_DMABase_CCR2 (0x0000000E) |
mbed_official | 237:f3da66175598 | 294 | #define TIM_DMABase_CCR3 (0x0000000F) |
mbed_official | 237:f3da66175598 | 295 | #define TIM_DMABase_CCR4 (0x00000010) |
mbed_official | 237:f3da66175598 | 296 | #define TIM_DMABase_BDTR (0x00000011) |
mbed_official | 237:f3da66175598 | 297 | #define TIM_DMABase_DCR (0x00000012) |
mbed_official | 237:f3da66175598 | 298 | #define TIM_DMABase_OR (0x00000013) |
mbed_official | 237:f3da66175598 | 299 | #define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABase_CR1) || \ |
mbed_official | 237:f3da66175598 | 300 | ((BASE) == TIM_DMABase_CR2) || \ |
mbed_official | 237:f3da66175598 | 301 | ((BASE) == TIM_DMABase_SMCR) || \ |
mbed_official | 237:f3da66175598 | 302 | ((BASE) == TIM_DMABase_DIER) || \ |
mbed_official | 237:f3da66175598 | 303 | ((BASE) == TIM_DMABase_SR) || \ |
mbed_official | 237:f3da66175598 | 304 | ((BASE) == TIM_DMABase_EGR) || \ |
mbed_official | 237:f3da66175598 | 305 | ((BASE) == TIM_DMABase_CCMR1) || \ |
mbed_official | 237:f3da66175598 | 306 | ((BASE) == TIM_DMABase_CCMR2) || \ |
mbed_official | 237:f3da66175598 | 307 | ((BASE) == TIM_DMABase_CCER) || \ |
mbed_official | 237:f3da66175598 | 308 | ((BASE) == TIM_DMABase_CNT) || \ |
mbed_official | 237:f3da66175598 | 309 | ((BASE) == TIM_DMABase_PSC) || \ |
mbed_official | 237:f3da66175598 | 310 | ((BASE) == TIM_DMABase_ARR) || \ |
mbed_official | 237:f3da66175598 | 311 | ((BASE) == TIM_DMABase_RCR) || \ |
mbed_official | 237:f3da66175598 | 312 | ((BASE) == TIM_DMABase_CCR1) || \ |
mbed_official | 237:f3da66175598 | 313 | ((BASE) == TIM_DMABase_CCR2) || \ |
mbed_official | 237:f3da66175598 | 314 | ((BASE) == TIM_DMABase_CCR3) || \ |
mbed_official | 237:f3da66175598 | 315 | ((BASE) == TIM_DMABase_CCR4) || \ |
mbed_official | 237:f3da66175598 | 316 | ((BASE) == TIM_DMABase_BDTR) || \ |
mbed_official | 237:f3da66175598 | 317 | ((BASE) == TIM_DMABase_DCR) || \ |
mbed_official | 237:f3da66175598 | 318 | ((BASE) == TIM_DMABase_OR)) |
mbed_official | 237:f3da66175598 | 319 | /** |
mbed_official | 237:f3da66175598 | 320 | * @} |
mbed_official | 237:f3da66175598 | 321 | */ |
mbed_official | 237:f3da66175598 | 322 | #endif /* STM32F373xC || STM32F378xx */ |
mbed_official | 237:f3da66175598 | 323 | |
mbed_official | 237:f3da66175598 | 324 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 325 | defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) || \ |
mbed_official | 237:f3da66175598 | 326 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 327 | /** @defgroup TIMEx_Channel |
mbed_official | 237:f3da66175598 | 328 | * @{ |
mbed_official | 237:f3da66175598 | 329 | */ |
mbed_official | 237:f3da66175598 | 330 | |
mbed_official | 237:f3da66175598 | 331 | #define TIM_CHANNEL_1 ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 332 | #define TIM_CHANNEL_2 ((uint32_t)0x0004) |
mbed_official | 237:f3da66175598 | 333 | #define TIM_CHANNEL_3 ((uint32_t)0x0008) |
mbed_official | 237:f3da66175598 | 334 | #define TIM_CHANNEL_4 ((uint32_t)0x000C) |
mbed_official | 237:f3da66175598 | 335 | #define TIM_CHANNEL_5 ((uint32_t)0x0010) |
mbed_official | 237:f3da66175598 | 336 | #define TIM_CHANNEL_6 ((uint32_t)0x0014) |
mbed_official | 237:f3da66175598 | 337 | #define TIM_CHANNEL_ALL ((uint32_t)0x003C) |
mbed_official | 237:f3da66175598 | 338 | |
mbed_official | 237:f3da66175598 | 339 | #define IS_TIM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 340 | ((CHANNEL) == TIM_CHANNEL_2) || \ |
mbed_official | 237:f3da66175598 | 341 | ((CHANNEL) == TIM_CHANNEL_3) || \ |
mbed_official | 237:f3da66175598 | 342 | ((CHANNEL) == TIM_CHANNEL_4) || \ |
mbed_official | 237:f3da66175598 | 343 | ((CHANNEL) == TIM_CHANNEL_5) || \ |
mbed_official | 237:f3da66175598 | 344 | ((CHANNEL) == TIM_CHANNEL_6) || \ |
mbed_official | 237:f3da66175598 | 345 | ((CHANNEL) == TIM_CHANNEL_ALL)) |
mbed_official | 237:f3da66175598 | 346 | |
mbed_official | 237:f3da66175598 | 347 | #define IS_TIM_PWMI_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 348 | ((CHANNEL) == TIM_CHANNEL_2)) |
mbed_official | 237:f3da66175598 | 349 | |
mbed_official | 237:f3da66175598 | 350 | #define IS_TIM_OPM_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 351 | ((CHANNEL) == TIM_CHANNEL_2)) |
mbed_official | 237:f3da66175598 | 352 | |
mbed_official | 237:f3da66175598 | 353 | #define IS_TIM_COMPLEMENTARY_CHANNELS(CHANNEL) (((CHANNEL) == TIM_CHANNEL_1) || \ |
mbed_official | 237:f3da66175598 | 354 | ((CHANNEL) == TIM_CHANNEL_2) || \ |
mbed_official | 237:f3da66175598 | 355 | ((CHANNEL) == TIM_CHANNEL_3)) |
mbed_official | 237:f3da66175598 | 356 | /** |
mbed_official | 237:f3da66175598 | 357 | * @} |
mbed_official | 237:f3da66175598 | 358 | */ |
mbed_official | 237:f3da66175598 | 359 | |
mbed_official | 237:f3da66175598 | 360 | /** @defgroup TIMEx_Output_Compare_and_PWM_modes |
mbed_official | 237:f3da66175598 | 361 | * @{ |
mbed_official | 237:f3da66175598 | 362 | */ |
mbed_official | 237:f3da66175598 | 363 | #define TIM_OCMODE_TIMING ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 364 | #define TIM_OCMODE_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 365 | #define TIM_OCMODE_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_1) |
mbed_official | 237:f3da66175598 | 366 | #define TIM_OCMODE_TOGGLE ((uint32_t)TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 367 | #define TIM_OCMODE_PWM1 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1) |
mbed_official | 237:f3da66175598 | 368 | #define TIM_OCMODE_PWM2 ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 369 | #define TIM_OCMODE_FORCED_ACTIVE ((uint32_t)TIM_CCMR1_OC1M_2 | TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 370 | #define TIM_OCMODE_FORCED_INACTIVE ((uint32_t)TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 371 | |
mbed_official | 237:f3da66175598 | 372 | #define TIM_OCMODE_RETRIGERRABLE_OPM1 ((uint32_t)TIM_CCMR1_OC1M_3) |
mbed_official | 237:f3da66175598 | 373 | #define TIM_OCMODE_RETRIGERRABLE_OPM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0) |
mbed_official | 237:f3da66175598 | 374 | #define TIM_OCMODE_COMBINED_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 375 | #define TIM_OCMODE_COMBINED_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_0 | TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 376 | #define TIM_OCMODE_ASSYMETRIC_PWM1 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2) |
mbed_official | 237:f3da66175598 | 377 | #define TIM_OCMODE_ASSYMETRIC_PWM2 ((uint32_t)TIM_CCMR1_OC1M_3 | TIM_CCMR1_OC1M) |
mbed_official | 237:f3da66175598 | 378 | |
mbed_official | 237:f3da66175598 | 379 | #define IS_TIM_PWM_MODE(MODE) (((MODE) == TIM_OCMODE_PWM1) || \ |
mbed_official | 237:f3da66175598 | 380 | ((MODE) == TIM_OCMODE_PWM2) || \ |
mbed_official | 237:f3da66175598 | 381 | ((MODE) == TIM_OCMODE_COMBINED_PWM1) || \ |
mbed_official | 237:f3da66175598 | 382 | ((MODE) == TIM_OCMODE_COMBINED_PWM2) || \ |
mbed_official | 237:f3da66175598 | 383 | ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM1) || \ |
mbed_official | 237:f3da66175598 | 384 | ((MODE) == TIM_OCMODE_ASSYMETRIC_PWM2)) |
mbed_official | 237:f3da66175598 | 385 | |
mbed_official | 237:f3da66175598 | 386 | #define IS_TIM_OC_MODE(MODE) (((MODE) == TIM_OCMODE_TIMING) || \ |
mbed_official | 237:f3da66175598 | 387 | ((MODE) == TIM_OCMODE_ACTIVE) || \ |
mbed_official | 237:f3da66175598 | 388 | ((MODE) == TIM_OCMODE_INACTIVE) || \ |
mbed_official | 237:f3da66175598 | 389 | ((MODE) == TIM_OCMODE_TOGGLE) || \ |
mbed_official | 237:f3da66175598 | 390 | ((MODE) == TIM_OCMODE_FORCED_ACTIVE) || \ |
mbed_official | 237:f3da66175598 | 391 | ((MODE) == TIM_OCMODE_FORCED_INACTIVE) || \ |
mbed_official | 237:f3da66175598 | 392 | ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM1) || \ |
mbed_official | 237:f3da66175598 | 393 | ((MODE) == TIM_OCMODE_RETRIGERRABLE_OPM2)) |
mbed_official | 237:f3da66175598 | 394 | /** |
mbed_official | 237:f3da66175598 | 395 | * @} |
mbed_official | 237:f3da66175598 | 396 | */ |
mbed_official | 237:f3da66175598 | 397 | |
mbed_official | 237:f3da66175598 | 398 | /** @defgroup TIMEx_ClearInput_Source |
mbed_official | 237:f3da66175598 | 399 | * @{ |
mbed_official | 237:f3da66175598 | 400 | */ |
mbed_official | 237:f3da66175598 | 401 | #define TIM_CLEARINPUTSOURCE_ETR ((uint32_t)0x0001) |
mbed_official | 237:f3da66175598 | 402 | #define TIM_CLEARINPUTSOURCE_OCREFCLR ((uint32_t)0x0002) |
mbed_official | 237:f3da66175598 | 403 | #define TIM_CLEARINPUTSOURCE_NONE ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 404 | |
mbed_official | 237:f3da66175598 | 405 | #define IS_TIM_CLEARINPUT_SOURCE(MODE) (((MODE) == TIM_CLEARINPUTSOURCE_ETR) || \ |
mbed_official | 237:f3da66175598 | 406 | ((MODE) == TIM_CLEARINPUTSOURCE_OCREFCLR) || \ |
mbed_official | 237:f3da66175598 | 407 | ((MODE) == TIM_CLEARINPUTSOURCE_NONE)) |
mbed_official | 237:f3da66175598 | 408 | /** |
mbed_official | 237:f3da66175598 | 409 | * @} |
mbed_official | 237:f3da66175598 | 410 | */ |
mbed_official | 237:f3da66175598 | 411 | |
mbed_official | 237:f3da66175598 | 412 | /** @defgroup TIMEx_BreakInput_Filter |
mbed_official | 237:f3da66175598 | 413 | * @{ |
mbed_official | 237:f3da66175598 | 414 | */ |
mbed_official | 237:f3da66175598 | 415 | |
mbed_official | 237:f3da66175598 | 416 | #define IS_TIM_BREAK_FILTER(BRKFILTER) ((BRKFILTER) <= 0xF) |
mbed_official | 237:f3da66175598 | 417 | /** |
mbed_official | 237:f3da66175598 | 418 | * @} |
mbed_official | 237:f3da66175598 | 419 | */ |
mbed_official | 237:f3da66175598 | 420 | |
mbed_official | 237:f3da66175598 | 421 | /** @defgroup TIMEx_Break2_Input_enable_disable |
mbed_official | 237:f3da66175598 | 422 | * @{ |
mbed_official | 237:f3da66175598 | 423 | */ |
mbed_official | 237:f3da66175598 | 424 | #define TIM_BREAK2_DISABLE ((uint32_t)0x00000000) |
mbed_official | 237:f3da66175598 | 425 | #define TIM_BREAK2_ENABLE ((uint32_t)TIM_BDTR_BK2E) |
mbed_official | 237:f3da66175598 | 426 | |
mbed_official | 237:f3da66175598 | 427 | #define IS_TIM_BREAK2_STATE(STATE) (((STATE) == TIM_BREAK2_ENABLE) || \ |
mbed_official | 237:f3da66175598 | 428 | ((STATE) == TIM_BREAK2_DISABLE)) |
mbed_official | 237:f3da66175598 | 429 | /** |
mbed_official | 237:f3da66175598 | 430 | * @} |
mbed_official | 237:f3da66175598 | 431 | */ |
mbed_official | 237:f3da66175598 | 432 | /** @defgroup TIMEx_Break2_Polarity |
mbed_official | 237:f3da66175598 | 433 | * @{ |
mbed_official | 237:f3da66175598 | 434 | */ |
mbed_official | 237:f3da66175598 | 435 | #define TIM_BREAK2POLARITY_LOW ((uint32_t)0x00000000) |
mbed_official | 237:f3da66175598 | 436 | #define TIM_BREAK2POLARITY_HIGH ((uint32_t)TIM_BDTR_BK2P) |
mbed_official | 237:f3da66175598 | 437 | |
mbed_official | 237:f3da66175598 | 438 | #define IS_TIM_BREAK2_POLARITY(POLARITY) (((POLARITY) == TIM_BREAK2POLARITY_LOW) || \ |
mbed_official | 237:f3da66175598 | 439 | ((POLARITY) == TIM_BREAK2POLARITY_HIGH)) |
mbed_official | 237:f3da66175598 | 440 | /** |
mbed_official | 237:f3da66175598 | 441 | * @} |
mbed_official | 237:f3da66175598 | 442 | */ |
mbed_official | 237:f3da66175598 | 443 | |
mbed_official | 237:f3da66175598 | 444 | /** @defgroup TIMEx_Master_Mode_Selection_2 |
mbed_official | 237:f3da66175598 | 445 | * @{ |
mbed_official | 237:f3da66175598 | 446 | */ |
mbed_official | 237:f3da66175598 | 447 | #define TIM_TRGO2_RESET ((uint32_t)0x00000000) |
mbed_official | 237:f3da66175598 | 448 | #define TIM_TRGO2_ENABLE ((uint32_t)(TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 449 | #define TIM_TRGO2_UPDATE ((uint32_t)(TIM_CR2_MMS2_1)) |
mbed_official | 237:f3da66175598 | 450 | #define TIM_TRGO2_OC1 ((uint32_t)(TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 451 | #define TIM_TRGO2_OC1REF ((uint32_t)(TIM_CR2_MMS2_2)) |
mbed_official | 237:f3da66175598 | 452 | #define TIM_TRGO2_OC2REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 453 | #define TIM_TRGO2_OC3REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1)) |
mbed_official | 237:f3da66175598 | 454 | #define TIM_TRGO2_OC4REF ((uint32_t)(TIM_CR2_MMS2_2 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 455 | #define TIM_TRGO2_OC5REF ((uint32_t)(TIM_CR2_MMS2_3)) |
mbed_official | 237:f3da66175598 | 456 | #define TIM_TRGO2_OC6REF ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 457 | #define TIM_TRGO2_OC4REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1)) |
mbed_official | 237:f3da66175598 | 458 | #define TIM_TRGO2_OC6REF_RISINGFALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_1 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 459 | #define TIM_TRGO2_OC4REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2)) |
mbed_official | 237:f3da66175598 | 460 | #define TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 | TIM_CR2_MMS2_0)) |
mbed_official | 237:f3da66175598 | 461 | #define TIM_TRGO2_OC5REF_RISING_OC6REF_RISING ((uint32_t)(TIM_CR2_MMS2_3 | TIM_CR2_MMS2_2 |TIM_CR2_MMS2_1)) |
mbed_official | 237:f3da66175598 | 462 | #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)) |
mbed_official | 237:f3da66175598 | 463 | |
mbed_official | 237:f3da66175598 | 464 | #define IS_TIM_TRGO2_SOURCE(SOURCE) (((SOURCE) == TIM_TRGO2_RESET) || \ |
mbed_official | 237:f3da66175598 | 465 | ((SOURCE) == TIM_TRGO2_ENABLE) || \ |
mbed_official | 237:f3da66175598 | 466 | ((SOURCE) == TIM_TRGO2_UPDATE) || \ |
mbed_official | 237:f3da66175598 | 467 | ((SOURCE) == TIM_TRGO2_OC1) || \ |
mbed_official | 237:f3da66175598 | 468 | ((SOURCE) == TIM_TRGO2_OC1REF) || \ |
mbed_official | 237:f3da66175598 | 469 | ((SOURCE) == TIM_TRGO2_OC2REF) || \ |
mbed_official | 237:f3da66175598 | 470 | ((SOURCE) == TIM_TRGO2_OC3REF) || \ |
mbed_official | 237:f3da66175598 | 471 | ((SOURCE) == TIM_TRGO2_OC3REF) || \ |
mbed_official | 237:f3da66175598 | 472 | ((SOURCE) == TIM_TRGO2_OC4REF) || \ |
mbed_official | 237:f3da66175598 | 473 | ((SOURCE) == TIM_TRGO2_OC5REF) || \ |
mbed_official | 237:f3da66175598 | 474 | ((SOURCE) == TIM_TRGO2_OC6REF) || \ |
mbed_official | 237:f3da66175598 | 475 | ((SOURCE) == TIM_TRGO2_OC4REF_RISINGFALLING) || \ |
mbed_official | 237:f3da66175598 | 476 | ((SOURCE) == TIM_TRGO2_OC6REF_RISINGFALLING) || \ |
mbed_official | 237:f3da66175598 | 477 | ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_RISING) || \ |
mbed_official | 237:f3da66175598 | 478 | ((SOURCE) == TIM_TRGO2_OC4REF_RISING_OC6REF_FALLING) || \ |
mbed_official | 237:f3da66175598 | 479 | ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_RISING) || \ |
mbed_official | 237:f3da66175598 | 480 | ((SOURCE) == TIM_TRGO2_OC5REF_RISING_OC6REF_FALLING)) |
mbed_official | 237:f3da66175598 | 481 | /** |
mbed_official | 237:f3da66175598 | 482 | * @} |
mbed_official | 237:f3da66175598 | 483 | */ |
mbed_official | 237:f3da66175598 | 484 | |
mbed_official | 237:f3da66175598 | 485 | /** @defgroup TIMEx_Slave_Mode |
mbed_official | 237:f3da66175598 | 486 | * @{ |
mbed_official | 237:f3da66175598 | 487 | */ |
mbed_official | 237:f3da66175598 | 488 | #define TIM_SLAVEMODE_DISABLE ((uint32_t)0x0000) |
mbed_official | 237:f3da66175598 | 489 | #define TIM_SLAVEMODE_RESET ((uint32_t)(TIM_SMCR_SMS_2)) |
mbed_official | 237:f3da66175598 | 490 | #define TIM_SLAVEMODE_GATED ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_0)) |
mbed_official | 237:f3da66175598 | 491 | #define TIM_SLAVEMODE_TRIGGER ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1)) |
mbed_official | 237:f3da66175598 | 492 | #define TIM_SLAVEMODE_EXTERNAL1 ((uint32_t)(TIM_SMCR_SMS_2 | TIM_SMCR_SMS_1 | TIM_SMCR_SMS_0)) |
mbed_official | 237:f3da66175598 | 493 | #define TIM_SLAVEMODE_COMBINED_RESETTRIGGER ((uint32_t)(TIM_SMCR_SMS_3)) |
mbed_official | 237:f3da66175598 | 494 | |
mbed_official | 237:f3da66175598 | 495 | #define IS_TIM_SLAVE_MODE(MODE) (((MODE) == TIM_SLAVEMODE_DISABLE) || \ |
mbed_official | 237:f3da66175598 | 496 | ((MODE) == TIM_SLAVEMODE_RESET) || \ |
mbed_official | 237:f3da66175598 | 497 | ((MODE) == TIM_SLAVEMODE_GATED) || \ |
mbed_official | 237:f3da66175598 | 498 | ((MODE) == TIM_SLAVEMODE_TRIGGER) || \ |
mbed_official | 237:f3da66175598 | 499 | ((MODE) == TIM_SLAVEMODE_EXTERNAL1) || \ |
mbed_official | 237:f3da66175598 | 500 | ((MODE) == TIM_SLAVEMODE_COMBINED_RESETTRIGGER)) |
mbed_official | 237:f3da66175598 | 501 | /** |
mbed_official | 237:f3da66175598 | 502 | * @} |
mbed_official | 237:f3da66175598 | 503 | */ |
mbed_official | 237:f3da66175598 | 504 | |
mbed_official | 237:f3da66175598 | 505 | /** @defgroup TIM_Event_Source |
mbed_official | 237:f3da66175598 | 506 | * @{ |
mbed_official | 237:f3da66175598 | 507 | */ |
mbed_official | 237:f3da66175598 | 508 | |
mbed_official | 237:f3da66175598 | 509 | #define TIM_EventSource_Update TIM_EGR_UG /*!< Reinitialize the counter and generates an update of the registers */ |
mbed_official | 237:f3da66175598 | 510 | #define TIM_EventSource_CC1 TIM_EGR_CC1G /*!< A capture/compare event is generated on channel 1 */ |
mbed_official | 237:f3da66175598 | 511 | #define TIM_EventSource_CC2 TIM_EGR_CC2G /*!< A capture/compare event is generated on channel 2 */ |
mbed_official | 237:f3da66175598 | 512 | #define TIM_EventSource_CC3 TIM_EGR_CC3G /*!< A capture/compare event is generated on channel 3 */ |
mbed_official | 237:f3da66175598 | 513 | #define TIM_EventSource_CC4 TIM_EGR_CC4G /*!< A capture/compare event is generated on channel 4 */ |
mbed_official | 237:f3da66175598 | 514 | #define TIM_EventSource_COM TIM_EGR_COMG /*!< A commutation event is generated */ |
mbed_official | 237:f3da66175598 | 515 | #define TIM_EventSource_Trigger TIM_EGR_TG /*!< A trigger event is generated */ |
mbed_official | 237:f3da66175598 | 516 | #define TIM_EventSource_Break TIM_EGR_BG /*!< A break event is generated */ |
mbed_official | 237:f3da66175598 | 517 | #define TIM_EventSource_Break2 TIM_EGR_B2G /*!< A break 2 event is generated */ |
mbed_official | 237:f3da66175598 | 518 | #define IS_TIM_EVENT_SOURCE(SOURCE) ((((SOURCE) & 0xFFFFFE00) == 0x00000000) && ((SOURCE) != 0x00000000)) |
mbed_official | 237:f3da66175598 | 519 | |
mbed_official | 237:f3da66175598 | 520 | /** |
mbed_official | 237:f3da66175598 | 521 | * @} |
mbed_official | 237:f3da66175598 | 522 | */ |
mbed_official | 237:f3da66175598 | 523 | |
mbed_official | 237:f3da66175598 | 524 | /** @defgroup TIM_DMA_Base_address |
mbed_official | 237:f3da66175598 | 525 | * @{ |
mbed_official | 237:f3da66175598 | 526 | */ |
mbed_official | 237:f3da66175598 | 527 | |
mbed_official | 237:f3da66175598 | 528 | #define TIM_DMABase_CR1 (0x00000000) |
mbed_official | 237:f3da66175598 | 529 | #define TIM_DMABase_CR2 (0x00000001) |
mbed_official | 237:f3da66175598 | 530 | #define TIM_DMABase_SMCR (0x00000002) |
mbed_official | 237:f3da66175598 | 531 | #define TIM_DMABase_DIER (0x00000003) |
mbed_official | 237:f3da66175598 | 532 | #define TIM_DMABase_SR (0x00000004) |
mbed_official | 237:f3da66175598 | 533 | #define TIM_DMABase_EGR (0x00000005) |
mbed_official | 237:f3da66175598 | 534 | #define TIM_DMABase_CCMR1 (0x00000006) |
mbed_official | 237:f3da66175598 | 535 | #define TIM_DMABase_CCMR2 (0x00000007) |
mbed_official | 237:f3da66175598 | 536 | #define TIM_DMABase_CCER (0x00000008) |
mbed_official | 237:f3da66175598 | 537 | #define TIM_DMABase_CNT (0x00000009) |
mbed_official | 237:f3da66175598 | 538 | #define TIM_DMABase_PSC (0x0000000A) |
mbed_official | 237:f3da66175598 | 539 | #define TIM_DMABase_ARR (0x0000000B) |
mbed_official | 237:f3da66175598 | 540 | #define TIM_DMABase_RCR (0x0000000C) |
mbed_official | 237:f3da66175598 | 541 | #define TIM_DMABase_CCR1 (0x0000000D) |
mbed_official | 237:f3da66175598 | 542 | #define TIM_DMABase_CCR2 (0x0000000E) |
mbed_official | 237:f3da66175598 | 543 | #define TIM_DMABase_CCR3 (0x0000000F) |
mbed_official | 237:f3da66175598 | 544 | #define TIM_DMABase_CCR4 (0x00000010) |
mbed_official | 237:f3da66175598 | 545 | #define TIM_DMABase_BDTR (0x00000011) |
mbed_official | 237:f3da66175598 | 546 | #define TIM_DMABase_DCR (0x00000012) |
mbed_official | 237:f3da66175598 | 547 | #define TIM_DMABase_CCMR3 (0x00000015) |
mbed_official | 237:f3da66175598 | 548 | #define TIM_DMABase_CCR5 (0x00000016) |
mbed_official | 237:f3da66175598 | 549 | #define TIM_DMABase_CCR6 (0x00000017) |
mbed_official | 237:f3da66175598 | 550 | #define TIM_DMABase_OR (0x00000018) |
mbed_official | 237:f3da66175598 | 551 | #define IS_TIM_DMA_BASE(BASE) (((BASE) == TIM_DMABase_CR1) || \ |
mbed_official | 237:f3da66175598 | 552 | ((BASE) == TIM_DMABase_CR2) || \ |
mbed_official | 237:f3da66175598 | 553 | ((BASE) == TIM_DMABase_SMCR) || \ |
mbed_official | 237:f3da66175598 | 554 | ((BASE) == TIM_DMABase_DIER) || \ |
mbed_official | 237:f3da66175598 | 555 | ((BASE) == TIM_DMABase_SR) || \ |
mbed_official | 237:f3da66175598 | 556 | ((BASE) == TIM_DMABase_EGR) || \ |
mbed_official | 237:f3da66175598 | 557 | ((BASE) == TIM_DMABase_CCMR1) || \ |
mbed_official | 237:f3da66175598 | 558 | ((BASE) == TIM_DMABase_CCMR2) || \ |
mbed_official | 237:f3da66175598 | 559 | ((BASE) == TIM_DMABase_CCER) || \ |
mbed_official | 237:f3da66175598 | 560 | ((BASE) == TIM_DMABase_CNT) || \ |
mbed_official | 237:f3da66175598 | 561 | ((BASE) == TIM_DMABase_PSC) || \ |
mbed_official | 237:f3da66175598 | 562 | ((BASE) == TIM_DMABase_ARR) || \ |
mbed_official | 237:f3da66175598 | 563 | ((BASE) == TIM_DMABase_RCR) || \ |
mbed_official | 237:f3da66175598 | 564 | ((BASE) == TIM_DMABase_CCR1) || \ |
mbed_official | 237:f3da66175598 | 565 | ((BASE) == TIM_DMABase_CCR2) || \ |
mbed_official | 237:f3da66175598 | 566 | ((BASE) == TIM_DMABase_CCR3) || \ |
mbed_official | 237:f3da66175598 | 567 | ((BASE) == TIM_DMABase_CCR4) || \ |
mbed_official | 237:f3da66175598 | 568 | ((BASE) == TIM_DMABase_BDTR) || \ |
mbed_official | 237:f3da66175598 | 569 | ((BASE) == TIM_DMABase_CCMR3) || \ |
mbed_official | 237:f3da66175598 | 570 | ((BASE) == TIM_DMABase_CCR5) || \ |
mbed_official | 237:f3da66175598 | 571 | ((BASE) == TIM_DMABase_CCR6) || \ |
mbed_official | 237:f3da66175598 | 572 | ((BASE) == TIM_DMABase_OR)) |
mbed_official | 237:f3da66175598 | 573 | /** |
mbed_official | 237:f3da66175598 | 574 | * @} |
mbed_official | 237:f3da66175598 | 575 | */ |
mbed_official | 237:f3da66175598 | 576 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 577 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
mbed_official | 237:f3da66175598 | 578 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 579 | |
mbed_official | 237:f3da66175598 | 580 | #if defined(STM32F302xC) |
mbed_official | 237:f3da66175598 | 581 | /** @defgroup TIMEx_Remap |
mbed_official | 237:f3da66175598 | 582 | * @{ |
mbed_official | 237:f3da66175598 | 583 | */ |
mbed_official | 237:f3da66175598 | 584 | #define TIM_TIM1_ADC1_NONE (0x00000000) /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/ |
mbed_official | 237:f3da66175598 | 585 | #define TIM_TIM1_ADC1_AWD1 (0x00000001) /* !< TIM1_ETR is connected to ADC1 AWD1 */ |
mbed_official | 237:f3da66175598 | 586 | #define TIM_TIM1_ADC1_AWD2 (0x00000002) /* !< TIM1_ETR is connected to ADC1 AWD2 */ |
mbed_official | 237:f3da66175598 | 587 | #define TIM_TIM1_ADC1_AWD3 (0x00000003) /* !< TIM1_ETR is connected to ADC1 AWD3 */ |
mbed_official | 237:f3da66175598 | 588 | #define TIM_TIM16_GPIO (0x00000000) /* !< TIM16 TI1 is connected to GPIO */ |
mbed_official | 237:f3da66175598 | 589 | #define TIM_TIM16_RTC (0x00000001) /* !< TIM16 TI1 is connected to RTC_clock */ |
mbed_official | 237:f3da66175598 | 590 | #define TIM_TIM16_HSE (0x00000002) /* !< TIM16 TI1 is connected to HSE/32 */ |
mbed_official | 237:f3da66175598 | 591 | #define TIM_TIM16_MCO (0x00000003) /* !< TIM16 TI1 is connected to MCO */ |
mbed_official | 237:f3da66175598 | 592 | |
mbed_official | 237:f3da66175598 | 593 | #define IS_TIM_REMAP(REMAP) (((REMAP) == TIM_TIM1_ADC1_NONE) ||\ |
mbed_official | 237:f3da66175598 | 594 | ((REMAP) == TIM_TIM1_ADC1_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 595 | ((REMAP) == TIM_TIM1_ADC1_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 596 | ((REMAP) == TIM_TIM1_ADC1_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 597 | ((REMAP) == TIM_TIM16_GPIO) ||\ |
mbed_official | 237:f3da66175598 | 598 | ((REMAP) == TIM_TIM16_RTC) ||\ |
mbed_official | 237:f3da66175598 | 599 | ((REMAP) == TIM_TIM16_HSE) ||\ |
mbed_official | 237:f3da66175598 | 600 | ((REMAP) == TIM_TIM16_MCO)) |
mbed_official | 237:f3da66175598 | 601 | /** |
mbed_official | 237:f3da66175598 | 602 | * @} |
mbed_official | 237:f3da66175598 | 603 | */ |
mbed_official | 237:f3da66175598 | 604 | #endif /* STM32F302xC */ |
mbed_official | 237:f3da66175598 | 605 | |
mbed_official | 237:f3da66175598 | 606 | #if defined(STM32F303xC) || defined(STM32F358xx) |
mbed_official | 237:f3da66175598 | 607 | /** @defgroup TIMEx_Remap |
mbed_official | 237:f3da66175598 | 608 | * @{ |
mbed_official | 237:f3da66175598 | 609 | */ |
mbed_official | 237:f3da66175598 | 610 | #define TIM_TIM1_ADC1_NONE (0x00000000) /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/ |
mbed_official | 237:f3da66175598 | 611 | #define TIM_TIM1_ADC1_AWD1 (0x00000001) /* !< TIM1_ETR is connected to ADC1 AWD1 */ |
mbed_official | 237:f3da66175598 | 612 | #define TIM_TIM1_ADC1_AWD2 (0x00000002) /* !< TIM1_ETR is connected to ADC1 AWD2 */ |
mbed_official | 237:f3da66175598 | 613 | #define TIM_TIM1_ADC1_AWD3 (0x00000003) /* !< TIM1_ETR is connected to ADC1 AWD3 */ |
mbed_official | 237:f3da66175598 | 614 | #define TIM_TIM8_ADC2_NONE (0x00000000) /* !< TIM8_ETR is not connected to any AWD (analog watchdog) */ |
mbed_official | 237:f3da66175598 | 615 | #define TIM_TIM8_ADC2_AWD1 (0x00000001) /* !< TIM8_ETR is connected to ADC2 AWD1 */ |
mbed_official | 237:f3da66175598 | 616 | #define TIM_TIM8_ADC2_AWD2 (0x00000002) /* !< TIM8_ETR is connected to ADC2 AWD2 */ |
mbed_official | 237:f3da66175598 | 617 | #define TIM_TIM8_ADC2_AWD3 (0x00000003) /* !< TIM8_ETR is connected to ADC2 AWD3 */ |
mbed_official | 237:f3da66175598 | 618 | #define TIM_TIM16_GPIO (0x00000000) /* !< TIM16 TI1 is connected to GPIO */ |
mbed_official | 237:f3da66175598 | 619 | #define TIM_TIM16_RTC (0x00000001) /* !< TIM16 TI1 is connected to RTC_clock */ |
mbed_official | 237:f3da66175598 | 620 | #define TIM_TIM16_HSE (0x00000002) /* !< TIM16 TI1 is connected to HSE/32 */ |
mbed_official | 237:f3da66175598 | 621 | #define TIM_TIM16_MCO (0x00000003) /* !< TIM16 TI1 is connected to MCO */ |
mbed_official | 237:f3da66175598 | 622 | |
mbed_official | 237:f3da66175598 | 623 | #define IS_TIM_REMAP(REMAP1) (((REMAP1) == TIM_TIM1_ADC1_NONE) ||\ |
mbed_official | 237:f3da66175598 | 624 | ((REMAP1) == TIM_TIM1_ADC1_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 625 | ((REMAP1) == TIM_TIM1_ADC1_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 626 | ((REMAP1) == TIM_TIM1_ADC1_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 627 | ((REMAP1) == TIM_TIM8_ADC2_NONE) ||\ |
mbed_official | 237:f3da66175598 | 628 | ((REMAP1) == TIM_TIM8_ADC2_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 629 | ((REMAP1) == TIM_TIM8_ADC2_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 630 | ((REMAP1) == TIM_TIM8_ADC2_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 631 | ((REMAP1) == TIM_TIM16_GPIO) ||\ |
mbed_official | 237:f3da66175598 | 632 | ((REMAP1) == TIM_TIM16_RTC) ||\ |
mbed_official | 237:f3da66175598 | 633 | ((REMAP1) == TIM_TIM16_HSE) ||\ |
mbed_official | 237:f3da66175598 | 634 | ((REMAP1) == TIM_TIM16_MCO)) |
mbed_official | 237:f3da66175598 | 635 | /** |
mbed_official | 237:f3da66175598 | 636 | * @} |
mbed_official | 237:f3da66175598 | 637 | */ |
mbed_official | 237:f3da66175598 | 638 | |
mbed_official | 237:f3da66175598 | 639 | /** @defgroup TIMEx_Remap2 |
mbed_official | 237:f3da66175598 | 640 | * @{ |
mbed_official | 237:f3da66175598 | 641 | */ |
mbed_official | 237:f3da66175598 | 642 | #define TIM_TIM1_ADC4_NONE (0x00000000) /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/ |
mbed_official | 237:f3da66175598 | 643 | #define TIM_TIM1_ADC4_AWD1 (0x00000004) /* !< TIM1_ETR is connected to ADC4 AWD1 */ |
mbed_official | 237:f3da66175598 | 644 | #define TIM_TIM1_ADC4_AWD2 (0x00000008) /* !< TIM1_ETR is connected to ADC4 AWD2 */ |
mbed_official | 237:f3da66175598 | 645 | #define TIM_TIM1_ADC4_AWD3 (0x0000000C) /* !< TIM1_ETR is connected to ADC4 AWD3 */ |
mbed_official | 237:f3da66175598 | 646 | #define TIM_TIM8_ADC3_NONE (0x00000000) /* !< TIM8_ETR is not connected to any AWD (analog watchdog) */ |
mbed_official | 237:f3da66175598 | 647 | #define TIM_TIM8_ADC3_AWD1 (0x00000004) /* !< TIM8_ETR is connected to ADC3 AWD1 */ |
mbed_official | 237:f3da66175598 | 648 | #define TIM_TIM8_ADC3_AWD2 (0x00000008) /* !< TIM8_ETR is connected to ADC3 AWD2 */ |
mbed_official | 237:f3da66175598 | 649 | #define TIM_TIM8_ADC3_AWD3 (0x0000000C) /* !< TIM8_ETR is connected to ADC3 AWD3 */ |
mbed_official | 237:f3da66175598 | 650 | #define TIM_TIM16_NONE (0x00000000) /* !< Non significant value for TIM16 */ |
mbed_official | 237:f3da66175598 | 651 | |
mbed_official | 237:f3da66175598 | 652 | #define IS_TIM_REMAP2(REMAP2) (((REMAP2) == TIM_TIM1_ADC4_NONE) ||\ |
mbed_official | 237:f3da66175598 | 653 | ((REMAP2) == TIM_TIM1_ADC4_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 654 | ((REMAP2) == TIM_TIM1_ADC4_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 655 | ((REMAP2) == TIM_TIM1_ADC4_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 656 | ((REMAP2) == TIM_TIM8_ADC3_NONE) ||\ |
mbed_official | 237:f3da66175598 | 657 | ((REMAP2) == TIM_TIM8_ADC3_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 658 | ((REMAP2) == TIM_TIM8_ADC3_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 659 | ((REMAP2) == TIM_TIM8_ADC3_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 660 | ((REMAP2) == TIM_TIM16_NONE)) |
mbed_official | 237:f3da66175598 | 661 | /** |
mbed_official | 237:f3da66175598 | 662 | * @} |
mbed_official | 237:f3da66175598 | 663 | */ |
mbed_official | 237:f3da66175598 | 664 | #endif /* STM32F303xC || STM32F358xx */ |
mbed_official | 237:f3da66175598 | 665 | |
mbed_official | 237:f3da66175598 | 666 | #if defined(STM32F373xC) || defined(STM32F378xx) |
mbed_official | 237:f3da66175598 | 667 | /** @defgroup TIMEx_Remap |
mbed_official | 237:f3da66175598 | 668 | * @{ |
mbed_official | 237:f3da66175598 | 669 | */ |
mbed_official | 237:f3da66175598 | 670 | |
mbed_official | 237:f3da66175598 | 671 | #define TIM_TIM2_TIM8_TRGO (0x00000000) /*!< TIM8 TRGOUT is connected to TIM2_ITR1 */ |
mbed_official | 237:f3da66175598 | 672 | #define TIM_TIM2_ETH_PTP (0x00000400) /*!< PTP trigger output is connected to TIM2_ITR1 */ |
mbed_official | 237:f3da66175598 | 673 | #define TIM_TIM2_USBFS_SOF (0x00000800) /*!< OTG FS SOF is connected to the TIM2_ITR1 input */ |
mbed_official | 237:f3da66175598 | 674 | #define TIM_TIM2_USBHS_SOF (0x00000C00) /*!< OTG HS SOF is connected to the TIM2_ITR1 input */ |
mbed_official | 237:f3da66175598 | 675 | #define TIM_TIM14_GPIO (0x00000000) /* !< TIM14 TI1 is connected to GPIO */ |
mbed_official | 237:f3da66175598 | 676 | #define TIM_TIM14_RTC (0x00000001) /* !< TIM14 TI1 is connected to RTC_clock */ |
mbed_official | 237:f3da66175598 | 677 | #define TIM_TIM14_HSE (0x00000002) /* !< TIM14 TI1 is connected to HSE/32 */ |
mbed_official | 237:f3da66175598 | 678 | #define TIM_TIM14_MCO (0x00000003) /* !< TIM14 TI1 is connected to MCO */ |
mbed_official | 237:f3da66175598 | 679 | |
mbed_official | 237:f3da66175598 | 680 | #define IS_TIM_REMAP(REMAP) (((REMAP) == TIM_TIM2_TIM8_TRGO) ||\ |
mbed_official | 237:f3da66175598 | 681 | ((REMAP) == TIM_TIM2_ETH_PTP) ||\ |
mbed_official | 237:f3da66175598 | 682 | ((REMAP) == TIM_TIM2_USBFS_SOF) ||\ |
mbed_official | 237:f3da66175598 | 683 | ((REMAP) == TIM_TIM2_USBHS_SOF) ||\ |
mbed_official | 237:f3da66175598 | 684 | ((REMAP) == TIM_TIM14_GPIO) ||\ |
mbed_official | 237:f3da66175598 | 685 | ((REMAP) == TIM_TIM14_RTC) ||\ |
mbed_official | 237:f3da66175598 | 686 | ((REMAP) == TIM_TIM14_HSE) ||\ |
mbed_official | 237:f3da66175598 | 687 | ((REMAP) == TIM_TIM14_MCO)) |
mbed_official | 237:f3da66175598 | 688 | |
mbed_official | 237:f3da66175598 | 689 | /** |
mbed_official | 237:f3da66175598 | 690 | * @} |
mbed_official | 237:f3da66175598 | 691 | */ |
mbed_official | 237:f3da66175598 | 692 | #endif /* STM32F373xC || STM32F378xx */ |
mbed_official | 237:f3da66175598 | 693 | |
mbed_official | 237:f3da66175598 | 694 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) |
mbed_official | 237:f3da66175598 | 695 | /** @defgroup TIMEx_Remap |
mbed_official | 237:f3da66175598 | 696 | * @{ |
mbed_official | 237:f3da66175598 | 697 | */ |
mbed_official | 237:f3da66175598 | 698 | #define TIM_TIM1_ADC1_NONE (0x00000000) /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/ |
mbed_official | 237:f3da66175598 | 699 | #define TIM_TIM1_ADC1_AWD1 (0x00000001) /* !< TIM1_ETR is connected to ADC1 AWD1 */ |
mbed_official | 237:f3da66175598 | 700 | #define TIM_TIM1_ADC1_AWD2 (0x00000002) /* !< TIM1_ETR is connected to ADC1 AWD2 */ |
mbed_official | 237:f3da66175598 | 701 | #define TIM_TIM1_ADC1_AWD3 (0x00000003) /* !< TIM1_ETR is connected to ADC1 AWD3 */ |
mbed_official | 237:f3da66175598 | 702 | #define TIM_TIM16_GPIO (0x00000000) /* !< TIM16 TI1 is connected to GPIO */ |
mbed_official | 237:f3da66175598 | 703 | #define TIM_TIM16_RTC (0x00000001) /* !< TIM16 TI1 is connected to RTC_clock */ |
mbed_official | 237:f3da66175598 | 704 | #define TIM_TIM16_HSE (0x00000002) /* !< TIM16 TI1 is connected to HSE/32 */ |
mbed_official | 237:f3da66175598 | 705 | #define TIM_TIM16_MCO (0x00000003) /* !< TIM16 TI1 is connected to MCO */ |
mbed_official | 237:f3da66175598 | 706 | |
mbed_official | 237:f3da66175598 | 707 | #define IS_TIM_REMAP(REMAP) (((REMAP) == TIM_TIM1_ADC1_NONE) ||\ |
mbed_official | 237:f3da66175598 | 708 | ((REMAP) == TIM_TIM1_ADC1_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 709 | ((REMAP) == TIM_TIM1_ADC1_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 710 | ((REMAP) == TIM_TIM1_ADC1_AWD3) ||\ |
mbed_official | 237:f3da66175598 | 711 | ((REMAP) == TIM_TIM16_GPIO) ||\ |
mbed_official | 237:f3da66175598 | 712 | ((REMAP) == TIM_TIM16_RTC) ||\ |
mbed_official | 237:f3da66175598 | 713 | ((REMAP) == TIM_TIM16_HSE) ||\ |
mbed_official | 237:f3da66175598 | 714 | ((REMAP) == TIM_TIM16_MCO)) |
mbed_official | 237:f3da66175598 | 715 | /** |
mbed_official | 237:f3da66175598 | 716 | * @} |
mbed_official | 237:f3da66175598 | 717 | */ |
mbed_official | 237:f3da66175598 | 718 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */ |
mbed_official | 237:f3da66175598 | 719 | |
mbed_official | 237:f3da66175598 | 720 | #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 721 | /** @defgroup TIMEx_Remap |
mbed_official | 237:f3da66175598 | 722 | * @{ |
mbed_official | 237:f3da66175598 | 723 | */ |
mbed_official | 237:f3da66175598 | 724 | #define TIM_TIM1_ADC1_NONE (0x00000000) /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/ |
mbed_official | 237:f3da66175598 | 725 | #define TIM_TIM1_ADC1_AWD1 (0x00000001) /* !< TIM1_ETR is connected to ADC1 AWD1 */ |
mbed_official | 237:f3da66175598 | 726 | #define TIM_TIM1_ADC1_AWD2 (0x00000002) /* !< TIM1_ETR is connected to ADC1 AWD2 */ |
mbed_official | 237:f3da66175598 | 727 | #define TIM_TIM1_ADC1_AWD3 (0x00000003) /* !< TIM1_ETR is connected to ADC1 AWD3 */ |
mbed_official | 237:f3da66175598 | 728 | |
mbed_official | 237:f3da66175598 | 729 | #define IS_TIM_REMAP(REMAP) (((REMAP) == TIM_TIM1_ADC1_NONE) ||\ |
mbed_official | 237:f3da66175598 | 730 | ((REMAP) == TIM_TIM1_ADC1_AWD1) ||\ |
mbed_official | 237:f3da66175598 | 731 | ((REMAP) == TIM_TIM1_ADC1_AWD2) ||\ |
mbed_official | 237:f3da66175598 | 732 | ((REMAP) == TIM_TIM1_ADC1_AWD3)) |
mbed_official | 237:f3da66175598 | 733 | /** |
mbed_official | 237:f3da66175598 | 734 | * @} |
mbed_official | 237:f3da66175598 | 735 | */ |
mbed_official | 237:f3da66175598 | 736 | #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 737 | |
mbed_official | 237:f3da66175598 | 738 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 739 | defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) || \ |
mbed_official | 237:f3da66175598 | 740 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 741 | /** @defgroup TIMEx_Group_Channel5 |
mbed_official | 237:f3da66175598 | 742 | * @{ |
mbed_official | 237:f3da66175598 | 743 | */ |
mbed_official | 237:f3da66175598 | 744 | #define TIM_GROUPCH5_NONE (uint32_t)0x00000000 /* !< No effect of OC5REF on OC1REFC, OC2REFC and OC3REFC */ |
mbed_official | 237:f3da66175598 | 745 | #define TIM_GROUPCH5_OC1REFC (TIM_CCR5_GC5C1) /* !< OC1REFC is the logical AND of OC1REFC and OC5REF */ |
mbed_official | 237:f3da66175598 | 746 | #define TIM_GROUPCH5_OC2REFC (TIM_CCR5_GC5C2) /* !< OC2REFC is the logical AND of OC2REFC and OC5REF */ |
mbed_official | 237:f3da66175598 | 747 | #define TIM_GROUPCH5_OC3REFC (TIM_CCR5_GC5C3) /* !< OC3REFC is the logical AND of OC3REFC and OC5REF */ |
mbed_official | 237:f3da66175598 | 748 | |
mbed_official | 237:f3da66175598 | 749 | #define IS_TIM_GROUPCH5(OCREF) ((((OCREF) & 0x1FFFFFFF) == 0x00000000)) |
mbed_official | 237:f3da66175598 | 750 | /** |
mbed_official | 237:f3da66175598 | 751 | * @} |
mbed_official | 237:f3da66175598 | 752 | */ |
mbed_official | 237:f3da66175598 | 753 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 754 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
mbed_official | 237:f3da66175598 | 755 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 756 | /** |
mbed_official | 237:f3da66175598 | 757 | * @} |
mbed_official | 237:f3da66175598 | 758 | */ |
mbed_official | 237:f3da66175598 | 759 | |
mbed_official | 237:f3da66175598 | 760 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 761 | #if defined(STM32F373xC) || defined(STM32F378xx) |
mbed_official | 237:f3da66175598 | 762 | /** |
mbed_official | 237:f3da66175598 | 763 | * @brief Sets the TIM Capture Compare Register value on runtime without |
mbed_official | 237:f3da66175598 | 764 | * calling another time ConfigChannel function. |
mbed_official | 237:f3da66175598 | 765 | * @param __HANDLE__: TIM handle. |
mbed_official | 237:f3da66175598 | 766 | * @param __CHANNEL__ : TIM Channels to be configured. |
mbed_official | 237:f3da66175598 | 767 | * This parameter can be one of the following values: |
mbed_official | 237:f3da66175598 | 768 | * @arg TIM_CHANNEL_1: TIM Channel 1 selected |
mbed_official | 237:f3da66175598 | 769 | * @arg TIM_CHANNEL_2: TIM Channel 2 selected |
mbed_official | 237:f3da66175598 | 770 | * @arg TIM_CHANNEL_3: TIM Channel 3 selected |
mbed_official | 237:f3da66175598 | 771 | * @arg TIM_CHANNEL_4: TIM Channel 4 selected |
mbed_official | 237:f3da66175598 | 772 | * @param __COMPARE__: specifies the Capture Compare register new value. |
mbed_official | 237:f3da66175598 | 773 | * @retval None |
mbed_official | 237:f3da66175598 | 774 | */ |
mbed_official | 237:f3da66175598 | 775 | #define __HAL_TIM_SetCompare(__HANDLE__, __CHANNEL__, __COMPARE__) \ |
mbed_official | 237:f3da66175598 | 776 | (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2)) = (__COMPARE__)) |
mbed_official | 237:f3da66175598 | 777 | |
mbed_official | 237:f3da66175598 | 778 | /** |
mbed_official | 237:f3da66175598 | 779 | * @brief Gets the TIM Capture Compare Register value on runtime |
mbed_official | 237:f3da66175598 | 780 | * @param __HANDLE__: TIM handle. |
mbed_official | 237:f3da66175598 | 781 | * @param __CHANNEL__ : TIM Channel associated with the capture compare register |
mbed_official | 237:f3da66175598 | 782 | * This parameter can be one of the following values: |
mbed_official | 237:f3da66175598 | 783 | * @arg TIM_CHANNEL_1: get capture/compare 1 register value |
mbed_official | 237:f3da66175598 | 784 | * @arg TIM_CHANNEL_2: get capture/compare 2 register value |
mbed_official | 237:f3da66175598 | 785 | * @arg TIM_CHANNEL_3: get capture/compare 3 register value |
mbed_official | 237:f3da66175598 | 786 | * @arg TIM_CHANNEL_4: get capture/compare 4 register value |
mbed_official | 237:f3da66175598 | 787 | * @retval None |
mbed_official | 237:f3da66175598 | 788 | */ |
mbed_official | 237:f3da66175598 | 789 | #define __HAL_TIM_GetCompare(__HANDLE__, __CHANNEL__) \ |
mbed_official | 237:f3da66175598 | 790 | (*(__IO uint32_t *)(&((__HANDLE__)->Instance->CCR1) + ((__CHANNEL__) >> 2))) |
mbed_official | 237:f3da66175598 | 791 | #endif /* STM32F373xC || STM32F378xx */ |
mbed_official | 237:f3da66175598 | 792 | |
mbed_official | 237:f3da66175598 | 793 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 794 | defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) || \ |
mbed_official | 237:f3da66175598 | 795 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 796 | /** |
mbed_official | 237:f3da66175598 | 797 | * @brief Sets the TIM Capture Compare Register value on runtime without |
mbed_official | 237:f3da66175598 | 798 | * calling another time ConfigChannel function. |
mbed_official | 237:f3da66175598 | 799 | * @param __HANDLE__: TIM handle. |
mbed_official | 237:f3da66175598 | 800 | * @param __CHANNEL__ : TIM Channels to be configured. |
mbed_official | 237:f3da66175598 | 801 | * This parameter can be one of the following values: |
mbed_official | 237:f3da66175598 | 802 | * @arg TIM_CHANNEL_1: TIM Channel 1 selected |
mbed_official | 237:f3da66175598 | 803 | * @arg TIM_CHANNEL_2: TIM Channel 2 selected |
mbed_official | 237:f3da66175598 | 804 | * @arg TIM_CHANNEL_3: TIM Channel 3 selected |
mbed_official | 237:f3da66175598 | 805 | * @arg TIM_CHANNEL_4: TIM Channel 4 selected |
mbed_official | 237:f3da66175598 | 806 | * @arg TIM_CHANNEL_5: TIM Channel 5 selected |
mbed_official | 237:f3da66175598 | 807 | * @arg TIM_CHANNEL_6: TIM Channel 6 selected |
mbed_official | 237:f3da66175598 | 808 | * @param __COMPARE__: specifies the Capture Compare register new value. |
mbed_official | 237:f3da66175598 | 809 | * @retval None |
mbed_official | 237:f3da66175598 | 810 | */ |
mbed_official | 237:f3da66175598 | 811 | #define __HAL_TIM_SetCompare(__HANDLE__, __CHANNEL__, __COMPARE__) \ |
mbed_official | 237:f3da66175598 | 812 | (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1 = (__COMPARE__)) :\ |
mbed_official | 237:f3da66175598 | 813 | ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2 = (__COMPARE__)) :\ |
mbed_official | 237:f3da66175598 | 814 | ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3 = (__COMPARE__)) :\ |
mbed_official | 237:f3da66175598 | 815 | ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4 = (__COMPARE__)) :\ |
mbed_official | 237:f3da66175598 | 816 | ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5 = (__COMPARE__)) :\ |
mbed_official | 237:f3da66175598 | 817 | ((__HANDLE__)->Instance->CCR6 |= (__COMPARE__))) |
mbed_official | 237:f3da66175598 | 818 | |
mbed_official | 237:f3da66175598 | 819 | /** |
mbed_official | 237:f3da66175598 | 820 | * @brief Gets the TIM Capture Compare Register value on runtime |
mbed_official | 237:f3da66175598 | 821 | * @param __HANDLE__: TIM handle. |
mbed_official | 237:f3da66175598 | 822 | * @param __CHANNEL__ : TIM Channel associated with the capture compare register |
mbed_official | 237:f3da66175598 | 823 | * This parameter can be one of the following values: |
mbed_official | 237:f3da66175598 | 824 | * @arg TIM_CHANNEL_1: get capture/compare 1 register value |
mbed_official | 237:f3da66175598 | 825 | * @arg TIM_CHANNEL_2: get capture/compare 2 register value |
mbed_official | 237:f3da66175598 | 826 | * @arg TIM_CHANNEL_3: get capture/compare 3 register value |
mbed_official | 237:f3da66175598 | 827 | * @arg TIM_CHANNEL_4: get capture/compare 4 register value |
mbed_official | 237:f3da66175598 | 828 | * @arg TIM_CHANNEL_5: get capture/compare 5 register value |
mbed_official | 237:f3da66175598 | 829 | * @arg TIM_CHANNEL_6: get capture/compare 6 register value |
mbed_official | 237:f3da66175598 | 830 | * @retval None |
mbed_official | 237:f3da66175598 | 831 | */ |
mbed_official | 237:f3da66175598 | 832 | #define __HAL_TIM_GetCompare(__HANDLE__, __CHANNEL__) \ |
mbed_official | 237:f3da66175598 | 833 | (((__CHANNEL__) == TIM_CHANNEL_1) ? ((__HANDLE__)->Instance->CCR1) :\ |
mbed_official | 237:f3da66175598 | 834 | ((__CHANNEL__) == TIM_CHANNEL_2) ? ((__HANDLE__)->Instance->CCR2) :\ |
mbed_official | 237:f3da66175598 | 835 | ((__CHANNEL__) == TIM_CHANNEL_3) ? ((__HANDLE__)->Instance->CCR3) :\ |
mbed_official | 237:f3da66175598 | 836 | ((__CHANNEL__) == TIM_CHANNEL_4) ? ((__HANDLE__)->Instance->CCR4) :\ |
mbed_official | 237:f3da66175598 | 837 | ((__CHANNEL__) == TIM_CHANNEL_5) ? ((__HANDLE__)->Instance->CCR5) :\ |
mbed_official | 237:f3da66175598 | 838 | ((__HANDLE__)->Instance->CCR6)) |
mbed_official | 237:f3da66175598 | 839 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 840 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
mbed_official | 237:f3da66175598 | 841 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 842 | |
mbed_official | 237:f3da66175598 | 843 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 237:f3da66175598 | 844 | |
mbed_official | 237:f3da66175598 | 845 | /* Timer Hall Sensor functions **********************************************/ |
mbed_official | 237:f3da66175598 | 846 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef* sConfig); |
mbed_official | 237:f3da66175598 | 847 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 848 | |
mbed_official | 237:f3da66175598 | 849 | void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 850 | void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 851 | |
mbed_official | 237:f3da66175598 | 852 | /* Blocking mode: Polling */ |
mbed_official | 237:f3da66175598 | 853 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 854 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 855 | /* Non-Blocking mode: Interrupt */ |
mbed_official | 237:f3da66175598 | 856 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 857 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 858 | /* Non-Blocking mode: DMA */ |
mbed_official | 237:f3da66175598 | 859 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length); |
mbed_official | 237:f3da66175598 | 860 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 861 | |
mbed_official | 237:f3da66175598 | 862 | /* Timer Complementary Output Compare functions *****************************/ |
mbed_official | 237:f3da66175598 | 863 | /* Blocking mode: Polling */ |
mbed_official | 237:f3da66175598 | 864 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 865 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 866 | |
mbed_official | 237:f3da66175598 | 867 | /* Non-Blocking mode: Interrupt */ |
mbed_official | 237:f3da66175598 | 868 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 869 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 870 | |
mbed_official | 237:f3da66175598 | 871 | /* Non-Blocking mode: DMA */ |
mbed_official | 237:f3da66175598 | 872 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
mbed_official | 237:f3da66175598 | 873 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 874 | |
mbed_official | 237:f3da66175598 | 875 | /* Timer Complementary PWM functions ****************************************/ |
mbed_official | 237:f3da66175598 | 876 | /* Blocking mode: Polling */ |
mbed_official | 237:f3da66175598 | 877 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 878 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 879 | |
mbed_official | 237:f3da66175598 | 880 | /* Non-Blocking mode: Interrupt */ |
mbed_official | 237:f3da66175598 | 881 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 882 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 883 | /* Non-Blocking mode: DMA */ |
mbed_official | 237:f3da66175598 | 884 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
mbed_official | 237:f3da66175598 | 885 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel); |
mbed_official | 237:f3da66175598 | 886 | |
mbed_official | 237:f3da66175598 | 887 | /* Timer Complementary One Pulse functions **********************************/ |
mbed_official | 237:f3da66175598 | 888 | /* Blocking mode: Polling */ |
mbed_official | 237:f3da66175598 | 889 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
mbed_official | 237:f3da66175598 | 890 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
mbed_official | 237:f3da66175598 | 891 | |
mbed_official | 237:f3da66175598 | 892 | /* Non-Blocking mode: Interrupt */ |
mbed_official | 237:f3da66175598 | 893 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
mbed_official | 237:f3da66175598 | 894 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel); |
mbed_official | 237:f3da66175598 | 895 | |
mbed_official | 237:f3da66175598 | 896 | /* Extnsion Control functions ************************************************/ |
mbed_official | 237:f3da66175598 | 897 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
mbed_official | 237:f3da66175598 | 898 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
mbed_official | 237:f3da66175598 | 899 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger, uint32_t CommutationSource); |
mbed_official | 237:f3da66175598 | 900 | HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef * sMasterConfig); |
mbed_official | 237:f3da66175598 | 901 | HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig); |
mbed_official | 237:f3da66175598 | 902 | |
mbed_official | 237:f3da66175598 | 903 | #if defined(STM32F303xC) || defined(STM32F358xx) |
mbed_official | 237:f3da66175598 | 904 | HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap1, uint32_t Remap2); |
mbed_official | 237:f3da66175598 | 905 | #endif /* STM32F303xC || STM32F358xx */ |
mbed_official | 237:f3da66175598 | 906 | |
mbed_official | 237:f3da66175598 | 907 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 908 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) || \ |
mbed_official | 237:f3da66175598 | 909 | defined(STM32F373xC) || defined(STM32F378xx) |
mbed_official | 237:f3da66175598 | 910 | HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap); |
mbed_official | 237:f3da66175598 | 911 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 912 | /* STM32F303x8 || STM32F334x8 || STM32F328xx || */ |
mbed_official | 237:f3da66175598 | 913 | /* STM32F373xC || STM32F378xx */ |
mbed_official | 237:f3da66175598 | 914 | |
mbed_official | 237:f3da66175598 | 915 | #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \ |
mbed_official | 237:f3da66175598 | 916 | defined(STM32F302xC) || defined(STM32F303xC) ||defined(STM32F358xx) || \ |
mbed_official | 237:f3da66175598 | 917 | defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx) |
mbed_official | 237:f3da66175598 | 918 | HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels); |
mbed_official | 237:f3da66175598 | 919 | #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */ |
mbed_official | 237:f3da66175598 | 920 | /* STM32F302xC || STM32F303xC || STM32F358xx || */ |
mbed_official | 237:f3da66175598 | 921 | /* STM32F303x8 || STM32F334x8 || STM32F328xx */ |
mbed_official | 237:f3da66175598 | 922 | |
mbed_official | 237:f3da66175598 | 923 | |
mbed_official | 237:f3da66175598 | 924 | /* Extension Callback *********************************************************/ |
mbed_official | 237:f3da66175598 | 925 | void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 926 | void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 927 | void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); |
mbed_official | 237:f3da66175598 | 928 | |
mbed_official | 237:f3da66175598 | 929 | /* Extension Peripheral State functions **************************************/ |
mbed_official | 237:f3da66175598 | 930 | HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim); |
mbed_official | 237:f3da66175598 | 931 | |
mbed_official | 237:f3da66175598 | 932 | /** |
mbed_official | 237:f3da66175598 | 933 | * @} |
mbed_official | 237:f3da66175598 | 934 | */ |
mbed_official | 237:f3da66175598 | 935 | |
mbed_official | 237:f3da66175598 | 936 | /** |
mbed_official | 237:f3da66175598 | 937 | * @} |
mbed_official | 237:f3da66175598 | 938 | */ |
mbed_official | 237:f3da66175598 | 939 | |
mbed_official | 237:f3da66175598 | 940 | #ifdef __cplusplus |
mbed_official | 237:f3da66175598 | 941 | } |
mbed_official | 237:f3da66175598 | 942 | #endif |
mbed_official | 237:f3da66175598 | 943 | |
mbed_official | 237:f3da66175598 | 944 | |
mbed_official | 237:f3da66175598 | 945 | #endif /* __STM32F3xx_HAL_TIM_EX_H */ |
mbed_official | 237:f3da66175598 | 946 | |
mbed_official | 237:f3da66175598 | 947 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |