mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_tim_ex.c@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 181:a4cbdfbbd2f4
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 181:a4cbdfbbd2f4 | 1 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 2 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 3 | * @file stm32l0xx_hal_tim_ex.c |
mbed_official | 181:a4cbdfbbd2f4 | 4 | * @author MCD Application Team |
mbed_official | 181:a4cbdfbbd2f4 | 5 | * @version V1.0.0 |
mbed_official | 181:a4cbdfbbd2f4 | 6 | * @date 22-April-2014 |
mbed_official | 181:a4cbdfbbd2f4 | 7 | * @brief TIM HAL module driver. |
mbed_official | 181:a4cbdfbbd2f4 | 8 | * @brief This file provides firmware functions to manage the following |
mbed_official | 181:a4cbdfbbd2f4 | 9 | * functionalities of the Timer (TIM) peripheral: |
mbed_official | 181:a4cbdfbbd2f4 | 10 | * + Time Hall Sensor Interface Initialization |
mbed_official | 181:a4cbdfbbd2f4 | 11 | * + Time Hall Sensor Interface Start |
mbed_official | 181:a4cbdfbbd2f4 | 12 | * + Time Master and Slave synchronization configuration |
mbed_official | 181:a4cbdfbbd2f4 | 13 | @verbatim |
mbed_official | 181:a4cbdfbbd2f4 | 14 | ================================================================================ |
mbed_official | 181:a4cbdfbbd2f4 | 15 | ##### <Product specific features/integration> ##### |
mbed_official | 181:a4cbdfbbd2f4 | 16 | ================================================================================ |
mbed_official | 181:a4cbdfbbd2f4 | 17 | |
mbed_official | 181:a4cbdfbbd2f4 | 18 | [..] The Timer features include: |
mbed_official | 181:a4cbdfbbd2f4 | 19 | (#) 16-bit up, down, up/down auto-reload counter. |
mbed_official | 181:a4cbdfbbd2f4 | 20 | (#) 16-bit programmable prescaler allowing dividing (also on the fly) the counter clock |
mbed_official | 181:a4cbdfbbd2f4 | 21 | frequency either by any factor between 1 and 65536. |
mbed_official | 181:a4cbdfbbd2f4 | 22 | (#) Up to 4 independent channels for: |
mbed_official | 181:a4cbdfbbd2f4 | 23 | Input Capture |
mbed_official | 181:a4cbdfbbd2f4 | 24 | Output Compare |
mbed_official | 181:a4cbdfbbd2f4 | 25 | PWM generation (Edge and Center-aligned Mode) |
mbed_official | 181:a4cbdfbbd2f4 | 26 | One-pulse mode output |
mbed_official | 181:a4cbdfbbd2f4 | 27 | (#) Synchronization circuit to control the timer with external signals and to interconnect |
mbed_official | 181:a4cbdfbbd2f4 | 28 | several timers together. |
mbed_official | 181:a4cbdfbbd2f4 | 29 | (#) Supports incremental (quadrature) encoder and hall-sensor circuitry for positioning |
mbed_official | 181:a4cbdfbbd2f4 | 30 | purposes |
mbed_official | 181:a4cbdfbbd2f4 | 31 | |
mbed_official | 181:a4cbdfbbd2f4 | 32 | ##### How to use this driver ##### |
mbed_official | 181:a4cbdfbbd2f4 | 33 | ================================================================================ |
mbed_official | 181:a4cbdfbbd2f4 | 34 | [..] |
mbed_official | 181:a4cbdfbbd2f4 | 35 | (#) Enable the TIM interface clock using |
mbed_official | 181:a4cbdfbbd2f4 | 36 | __TIMx_CLK_ENABLE(); |
mbed_official | 181:a4cbdfbbd2f4 | 37 | |
mbed_official | 181:a4cbdfbbd2f4 | 38 | (#) TIM pins configuration |
mbed_official | 181:a4cbdfbbd2f4 | 39 | (++) Enable the clock for the TIM GPIOs using the following function: |
mbed_official | 181:a4cbdfbbd2f4 | 40 | __GPIOx_CLK_ENABLE(); |
mbed_official | 181:a4cbdfbbd2f4 | 41 | (++) Configure these TIM pins in Alternate function mode using HAL_GPIO_Init(); |
mbed_official | 181:a4cbdfbbd2f4 | 42 | |
mbed_official | 181:a4cbdfbbd2f4 | 43 | (#) The external Clock can be configured, if needed (the default clock is the internal clock from the APBx), |
mbed_official | 181:a4cbdfbbd2f4 | 44 | using the following function: |
mbed_official | 181:a4cbdfbbd2f4 | 45 | HAL_TIM_ConfigClockSource, the clock configuration should be done before any start function. |
mbed_official | 181:a4cbdfbbd2f4 | 46 | |
mbed_official | 181:a4cbdfbbd2f4 | 47 | (#) Configure the TIM in the desired operating mode using one of the |
mbed_official | 181:a4cbdfbbd2f4 | 48 | configuration function of this driver: |
mbed_official | 181:a4cbdfbbd2f4 | 49 | (++) HAL_TIMEx_MasterConfigSynchronization() to configure the peripheral in master mode. |
mbed_official | 181:a4cbdfbbd2f4 | 50 | |
mbed_official | 181:a4cbdfbbd2f4 | 51 | (#) Remap the Timer I/O using HAL_TIMEx_RemapConfig() API. |
mbed_official | 181:a4cbdfbbd2f4 | 52 | |
mbed_official | 181:a4cbdfbbd2f4 | 53 | |
mbed_official | 181:a4cbdfbbd2f4 | 54 | @endverbatim |
mbed_official | 181:a4cbdfbbd2f4 | 55 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 56 | * @attention |
mbed_official | 181:a4cbdfbbd2f4 | 57 | * |
mbed_official | 181:a4cbdfbbd2f4 | 58 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 181:a4cbdfbbd2f4 | 59 | * |
mbed_official | 181:a4cbdfbbd2f4 | 60 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 181:a4cbdfbbd2f4 | 61 | * are permitted provided that the following conditions are met: |
mbed_official | 181:a4cbdfbbd2f4 | 62 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 181:a4cbdfbbd2f4 | 63 | * this list of conditions and the following disclaimer. |
mbed_official | 181:a4cbdfbbd2f4 | 64 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 181:a4cbdfbbd2f4 | 65 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 181:a4cbdfbbd2f4 | 66 | * and/or other materials provided with the distribution. |
mbed_official | 181:a4cbdfbbd2f4 | 67 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 181:a4cbdfbbd2f4 | 68 | * may be used to endorse or promote products derived from this software |
mbed_official | 181:a4cbdfbbd2f4 | 69 | * without specific prior written permission. |
mbed_official | 181:a4cbdfbbd2f4 | 70 | * |
mbed_official | 181:a4cbdfbbd2f4 | 71 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 181:a4cbdfbbd2f4 | 72 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 181:a4cbdfbbd2f4 | 73 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 181:a4cbdfbbd2f4 | 74 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 181:a4cbdfbbd2f4 | 75 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 181:a4cbdfbbd2f4 | 76 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 181:a4cbdfbbd2f4 | 77 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 181:a4cbdfbbd2f4 | 78 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 181:a4cbdfbbd2f4 | 79 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 181:a4cbdfbbd2f4 | 80 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 181:a4cbdfbbd2f4 | 81 | * |
mbed_official | 181:a4cbdfbbd2f4 | 82 | ****************************************************************************** |
mbed_official | 181:a4cbdfbbd2f4 | 83 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 84 | |
mbed_official | 181:a4cbdfbbd2f4 | 85 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 86 | #include "stm32l0xx_hal.h" |
mbed_official | 181:a4cbdfbbd2f4 | 87 | |
mbed_official | 181:a4cbdfbbd2f4 | 88 | /** @addtogroup STM32L0xx_HAL_Driver |
mbed_official | 181:a4cbdfbbd2f4 | 89 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 90 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 91 | |
mbed_official | 181:a4cbdfbbd2f4 | 92 | /** @defgroup TIMEx |
mbed_official | 181:a4cbdfbbd2f4 | 93 | * @brief TIM HAL module driver |
mbed_official | 181:a4cbdfbbd2f4 | 94 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 95 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 96 | |
mbed_official | 181:a4cbdfbbd2f4 | 97 | #ifdef HAL_TIM_MODULE_ENABLED |
mbed_official | 181:a4cbdfbbd2f4 | 98 | |
mbed_official | 181:a4cbdfbbd2f4 | 99 | /* Private typedef -----------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 100 | /* Private define ------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 101 | /* Private macro -------------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 102 | /* Private variables ---------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 103 | /* Private function prototypes -----------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 104 | /* Private functions ---------------------------------------------------------*/ |
mbed_official | 181:a4cbdfbbd2f4 | 105 | |
mbed_official | 181:a4cbdfbbd2f4 | 106 | /** @defgroup TIMEx_Private_Functions |
mbed_official | 181:a4cbdfbbd2f4 | 107 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 108 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 109 | |
mbed_official | 181:a4cbdfbbd2f4 | 110 | |
mbed_official | 181:a4cbdfbbd2f4 | 111 | /** @defgroup TIMEx_Group3 Peripheral Control functions |
mbed_official | 181:a4cbdfbbd2f4 | 112 | * @brief Peripheral Control functions |
mbed_official | 181:a4cbdfbbd2f4 | 113 | * |
mbed_official | 181:a4cbdfbbd2f4 | 114 | @verbatim |
mbed_official | 181:a4cbdfbbd2f4 | 115 | =============================================================================== |
mbed_official | 181:a4cbdfbbd2f4 | 116 | ##### Peripheral Control functions ##### |
mbed_official | 181:a4cbdfbbd2f4 | 117 | =============================================================================== |
mbed_official | 181:a4cbdfbbd2f4 | 118 | [..] This section provides functions allowing to: |
mbed_official | 181:a4cbdfbbd2f4 | 119 | (+) Configure Master and the Slave synchronization. |
mbed_official | 181:a4cbdfbbd2f4 | 120 | |
mbed_official | 181:a4cbdfbbd2f4 | 121 | @endverbatim |
mbed_official | 181:a4cbdfbbd2f4 | 122 | * @{ |
mbed_official | 181:a4cbdfbbd2f4 | 123 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 124 | |
mbed_official | 181:a4cbdfbbd2f4 | 125 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 126 | * @brief Configures the TIM in master mode. |
mbed_official | 181:a4cbdfbbd2f4 | 127 | * @param htim: TIM handle. |
mbed_official | 181:a4cbdfbbd2f4 | 128 | * @param sMasterConfig: pointer to a TIM_MasterConfigTypeDef structure that |
mbed_official | 181:a4cbdfbbd2f4 | 129 | * contains the selected trigger output (TRGO) and the Master/Slave |
mbed_official | 181:a4cbdfbbd2f4 | 130 | * mode. |
mbed_official | 181:a4cbdfbbd2f4 | 131 | * @retval HAL status |
mbed_official | 181:a4cbdfbbd2f4 | 132 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 133 | HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim, TIM_MasterConfigTypeDef * sMasterConfig) |
mbed_official | 181:a4cbdfbbd2f4 | 134 | { |
mbed_official | 181:a4cbdfbbd2f4 | 135 | /* Check the parameters */ |
mbed_official | 181:a4cbdfbbd2f4 | 136 | assert_param(IS_TIM_MASTER_INSTANCE(htim->Instance)); |
mbed_official | 181:a4cbdfbbd2f4 | 137 | assert_param(IS_TIM_TRGO_SOURCE(sMasterConfig->MasterOutputTrigger)); |
mbed_official | 181:a4cbdfbbd2f4 | 138 | assert_param(IS_TIM_MSM_STATE(sMasterConfig->MasterSlaveMode)); |
mbed_official | 181:a4cbdfbbd2f4 | 139 | |
mbed_official | 181:a4cbdfbbd2f4 | 140 | __HAL_LOCK(htim); |
mbed_official | 181:a4cbdfbbd2f4 | 141 | |
mbed_official | 181:a4cbdfbbd2f4 | 142 | /* Change the handler state */ |
mbed_official | 181:a4cbdfbbd2f4 | 143 | htim->State = HAL_TIM_STATE_BUSY; |
mbed_official | 181:a4cbdfbbd2f4 | 144 | |
mbed_official | 181:a4cbdfbbd2f4 | 145 | /* Reset the MMS Bits */ |
mbed_official | 181:a4cbdfbbd2f4 | 146 | htim->Instance->CR2 &= ~TIM_CR2_MMS; |
mbed_official | 181:a4cbdfbbd2f4 | 147 | /* Select the TRGO source */ |
mbed_official | 181:a4cbdfbbd2f4 | 148 | htim->Instance->CR2 |= sMasterConfig->MasterOutputTrigger; |
mbed_official | 181:a4cbdfbbd2f4 | 149 | |
mbed_official | 181:a4cbdfbbd2f4 | 150 | /* Reset the MSM Bit */ |
mbed_official | 181:a4cbdfbbd2f4 | 151 | htim->Instance->SMCR &= ~TIM_SMCR_MSM; |
mbed_official | 181:a4cbdfbbd2f4 | 152 | /* Set or Reset the MSM Bit */ |
mbed_official | 181:a4cbdfbbd2f4 | 153 | htim->Instance->SMCR |= sMasterConfig->MasterSlaveMode; |
mbed_official | 181:a4cbdfbbd2f4 | 154 | |
mbed_official | 181:a4cbdfbbd2f4 | 155 | htim->State = HAL_TIM_STATE_READY; |
mbed_official | 181:a4cbdfbbd2f4 | 156 | |
mbed_official | 181:a4cbdfbbd2f4 | 157 | __HAL_UNLOCK(htim); |
mbed_official | 181:a4cbdfbbd2f4 | 158 | |
mbed_official | 181:a4cbdfbbd2f4 | 159 | return HAL_OK; |
mbed_official | 181:a4cbdfbbd2f4 | 160 | } |
mbed_official | 181:a4cbdfbbd2f4 | 161 | |
mbed_official | 181:a4cbdfbbd2f4 | 162 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 163 | * @brief Configures the TIM2, TIM5 and TIM11 Remapping input capabilities. |
mbed_official | 181:a4cbdfbbd2f4 | 164 | * @param htim: pointer to a TIM_HandleTypeDef structure that contains |
mbed_official | 181:a4cbdfbbd2f4 | 165 | * the configuration information for TIM module. |
mbed_official | 181:a4cbdfbbd2f4 | 166 | * @param TIM_Remap: specifies the TIM input remapping source. |
mbed_official | 181:a4cbdfbbd2f4 | 167 | * This parameter can be one of the following values: |
mbed_official | 181:a4cbdfbbd2f4 | 168 | * @arg TIM2_ETR_GPIO : TIM2 ETR is connected to GPIO (default). |
mbed_official | 181:a4cbdfbbd2f4 | 169 | * @arg TIM2_ETR_HSI48 : TIM2 ETR is connected to HSI48. |
mbed_official | 181:a4cbdfbbd2f4 | 170 | * @arg TIM2_ETR_LSE : TIM2 ETR is connected to LSE. |
mbed_official | 181:a4cbdfbbd2f4 | 171 | * @arg TIM2_ETR_COMP2_OUT : TIM2 ETR is connected to COMP2 output. |
mbed_official | 181:a4cbdfbbd2f4 | 172 | * @arg TIM2_ETR_COMP1_OUT : TIM2 ETR is connected to COMP1 output. |
mbed_official | 181:a4cbdfbbd2f4 | 173 | * @arg TIM2_TI4_GPIO1 : TIM2 TI4 is connected to GPIO1(default). |
mbed_official | 181:a4cbdfbbd2f4 | 174 | * @arg TIM2_TI4_COMP1 : TIM2 TI4 is connected to COMP1. |
mbed_official | 181:a4cbdfbbd2f4 | 175 | * @arg TIM2_TI4_COMP2 : TIM2 TI4 is connected to COMP2. |
mbed_official | 181:a4cbdfbbd2f4 | 176 | * @arg TIM2_TI4_GPIO2 : TIM2 TI4 is connected to GPIO2. |
mbed_official | 181:a4cbdfbbd2f4 | 177 | * @arg TIM21_ETR_GPIO : TIM21 ETR is connected to GPIO(default). |
mbed_official | 181:a4cbdfbbd2f4 | 178 | * @arg TIM21_ETR_COMP2_OUT : TIM21 ETR is connected to COMP2 output. |
mbed_official | 181:a4cbdfbbd2f4 | 179 | * @arg TIM21_ETR_COMP1_OUT : TIM21 ETR is connected to COMP1 output. |
mbed_official | 181:a4cbdfbbd2f4 | 180 | * @arg TIM21_ETR_LSE : TIM21 ETR is connected to LSE. |
mbed_official | 181:a4cbdfbbd2f4 | 181 | * @arg TIM21_TI1_MCO : TIM21 TI1 is connected to MCO.. |
mbed_official | 181:a4cbdfbbd2f4 | 182 | * @arg TIM21_TI1_RTC_WKUT_IT : TIM21 TI1 is connected to RTC WAKEUP interrupt. |
mbed_official | 181:a4cbdfbbd2f4 | 183 | * @arg TIM21_TI1_HSE_RTC : TIM21 TI1 is connected to HSE_RTC. |
mbed_official | 181:a4cbdfbbd2f4 | 184 | * @arg TIM21_TI1_MSI : TIM21 TI1 is connected to MSI clock. |
mbed_official | 181:a4cbdfbbd2f4 | 185 | * @arg TIM21_TI1_LSE : TIM21 TI1 is connected to LSE. |
mbed_official | 181:a4cbdfbbd2f4 | 186 | * @arg TIM21_TI1_LSI : TIM21 TI1 is connected to LSI. |
mbed_official | 181:a4cbdfbbd2f4 | 187 | * @arg TIM21_TI1_COMP1_OUT : TIM21 TI1 is connected to COMP1_OUT. |
mbed_official | 181:a4cbdfbbd2f4 | 188 | * @arg TIM21_TI1_GPIO : TIM21 TI1 is connected to GPIO(default). |
mbed_official | 181:a4cbdfbbd2f4 | 189 | * @arg TIM21_TI2_GPIO : TIM21 TI2 is connected to GPIO(default). |
mbed_official | 181:a4cbdfbbd2f4 | 190 | * @arg TIM21_TI2_COMP2_OUT : TIM21 TI2 is connected to COMP2 output. |
mbed_official | 181:a4cbdfbbd2f4 | 191 | * @arg TIM22_ETR_LSE : TIM22 ETR is connected to LSE. |
mbed_official | 181:a4cbdfbbd2f4 | 192 | * @arg TIM22_ETR_COMP2_OUT : TIM22 ETR is connected to COMP2 output. |
mbed_official | 181:a4cbdfbbd2f4 | 193 | * @arg TIM22_ETR_COMP1_OUT : TIM22 ETR is connected to COMP1 output. |
mbed_official | 181:a4cbdfbbd2f4 | 194 | * @arg TIM22_ETR_GPIO : TIM22 ETR is connected to GPIO(default). |
mbed_official | 181:a4cbdfbbd2f4 | 195 | * @arg TIM22_TI1_GPIO1 : TIM22 TI1 is connected to GPIO(default). |
mbed_official | 181:a4cbdfbbd2f4 | 196 | * @arg TIM22_TI1_COMP2_OUT : TIM22 TI1 is connected to COMP2 output. |
mbed_official | 181:a4cbdfbbd2f4 | 197 | * @arg TIM22_TI1_COMP1_OUT : TIM22 TI1 is connected to COMP1 output. |
mbed_official | 181:a4cbdfbbd2f4 | 198 | * @arg TIM22_TI1_GPIO2 : TIM22 TI1 is connected to GPIO. |
mbed_official | 181:a4cbdfbbd2f4 | 199 | * @retval HAL status |
mbed_official | 181:a4cbdfbbd2f4 | 200 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 201 | HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap) |
mbed_official | 181:a4cbdfbbd2f4 | 202 | { |
mbed_official | 181:a4cbdfbbd2f4 | 203 | __HAL_LOCK(htim); |
mbed_official | 181:a4cbdfbbd2f4 | 204 | |
mbed_official | 181:a4cbdfbbd2f4 | 205 | /* Check parameters */ |
mbed_official | 181:a4cbdfbbd2f4 | 206 | assert_param(IS_TIM_REMAP_INSTANCE(htim->Instance)); |
mbed_official | 181:a4cbdfbbd2f4 | 207 | assert_param(IS_TIM_REMAP(Remap)); |
mbed_official | 181:a4cbdfbbd2f4 | 208 | |
mbed_official | 181:a4cbdfbbd2f4 | 209 | /* Change the handler state */ |
mbed_official | 181:a4cbdfbbd2f4 | 210 | htim->State = HAL_TIM_STATE_BUSY; |
mbed_official | 181:a4cbdfbbd2f4 | 211 | |
mbed_official | 181:a4cbdfbbd2f4 | 212 | /* Set the Timer remapping configuration */ |
mbed_official | 181:a4cbdfbbd2f4 | 213 | htim->Instance->OR &= (uint32_t)(Remap >> 16); |
mbed_official | 181:a4cbdfbbd2f4 | 214 | htim->Instance->OR |= Remap; |
mbed_official | 181:a4cbdfbbd2f4 | 215 | |
mbed_official | 181:a4cbdfbbd2f4 | 216 | /* Change the handler state */ |
mbed_official | 181:a4cbdfbbd2f4 | 217 | htim->State = HAL_TIM_STATE_READY; |
mbed_official | 181:a4cbdfbbd2f4 | 218 | |
mbed_official | 181:a4cbdfbbd2f4 | 219 | __HAL_UNLOCK(htim); |
mbed_official | 181:a4cbdfbbd2f4 | 220 | |
mbed_official | 181:a4cbdfbbd2f4 | 221 | return HAL_OK; |
mbed_official | 181:a4cbdfbbd2f4 | 222 | } |
mbed_official | 181:a4cbdfbbd2f4 | 223 | |
mbed_official | 181:a4cbdfbbd2f4 | 224 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 225 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 226 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 227 | |
mbed_official | 181:a4cbdfbbd2f4 | 228 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 229 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 230 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 231 | |
mbed_official | 181:a4cbdfbbd2f4 | 232 | #endif /* HAL_TIM_MODULE_ENABLED */ |
mbed_official | 181:a4cbdfbbd2f4 | 233 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 234 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 235 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 236 | |
mbed_official | 181:a4cbdfbbd2f4 | 237 | /** |
mbed_official | 181:a4cbdfbbd2f4 | 238 | * @} |
mbed_official | 181:a4cbdfbbd2f4 | 239 | */ |
mbed_official | 181:a4cbdfbbd2f4 | 240 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |