test

Dependencies:   mbed-rtos mbed ros_kinetic

Committer:
randalthor
Date:
Fri May 19 09:12:45 2017 +0000
Revision:
0:9646fc4e3fae
test

Who changed what in which revision?

UserRevisionLine numberNew contents of line
randalthor 0:9646fc4e3fae 1 /**
randalthor 0:9646fc4e3fae 2 ******************************************************************************
randalthor 0:9646fc4e3fae 3 * File Name : stm32f7xx_hal_msp.c
randalthor 0:9646fc4e3fae 4 * Description : This file provides code for the MSP Initialization
randalthor 0:9646fc4e3fae 5 * and de-Initialization codes.
randalthor 0:9646fc4e3fae 6 ******************************************************************************
randalthor 0:9646fc4e3fae 7 *
randalthor 0:9646fc4e3fae 8 * COPYRIGHT(c) 2017 STMicroelectronics
randalthor 0:9646fc4e3fae 9 *
randalthor 0:9646fc4e3fae 10 * Redistribution and use in source and binary forms, with or without modification,
randalthor 0:9646fc4e3fae 11 * are permitted provided that the following conditions are met:
randalthor 0:9646fc4e3fae 12 * 1. Redistributions of source code must retain the above copyright notice,
randalthor 0:9646fc4e3fae 13 * this list of conditions and the following disclaimer.
randalthor 0:9646fc4e3fae 14 * 2. Redistributions in binary form must reproduce the above copyright notice,
randalthor 0:9646fc4e3fae 15 * this list of conditions and the following disclaimer in the documentation
randalthor 0:9646fc4e3fae 16 * and/or other materials provided with the distribution.
randalthor 0:9646fc4e3fae 17 * 3. Neither the name of STMicroelectronics nor the names of its contributors
randalthor 0:9646fc4e3fae 18 * may be used to endorse or promote products derived from this software
randalthor 0:9646fc4e3fae 19 * without specific prior written permission.
randalthor 0:9646fc4e3fae 20 *
randalthor 0:9646fc4e3fae 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
randalthor 0:9646fc4e3fae 22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
randalthor 0:9646fc4e3fae 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
randalthor 0:9646fc4e3fae 24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
randalthor 0:9646fc4e3fae 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
randalthor 0:9646fc4e3fae 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
randalthor 0:9646fc4e3fae 27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
randalthor 0:9646fc4e3fae 28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
randalthor 0:9646fc4e3fae 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
randalthor 0:9646fc4e3fae 30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
randalthor 0:9646fc4e3fae 31 *
randalthor 0:9646fc4e3fae 32 ******************************************************************************
randalthor 0:9646fc4e3fae 33 */
randalthor 0:9646fc4e3fae 34 /* Includes ------------------------------------------------------------------*/
randalthor 0:9646fc4e3fae 35 #include "stm32f7xx_hal.h"
randalthor 0:9646fc4e3fae 36
randalthor 0:9646fc4e3fae 37 extern DMA_HandleTypeDef hdma_adc2;
randalthor 0:9646fc4e3fae 38
randalthor 0:9646fc4e3fae 39 extern void Error_Handler(void);
randalthor 0:9646fc4e3fae 40 /* USER CODE BEGIN 0 */
randalthor 0:9646fc4e3fae 41
randalthor 0:9646fc4e3fae 42 /* USER CODE END 0 */
randalthor 0:9646fc4e3fae 43 /**
randalthor 0:9646fc4e3fae 44 * Initializes the Global MSP.
randalthor 0:9646fc4e3fae 45 */
randalthor 0:9646fc4e3fae 46 void HAL_MspInit(void)
randalthor 0:9646fc4e3fae 47 {
randalthor 0:9646fc4e3fae 48 /* USER CODE BEGIN MspInit 0 */
randalthor 0:9646fc4e3fae 49
randalthor 0:9646fc4e3fae 50 /* USER CODE END MspInit 0 */
randalthor 0:9646fc4e3fae 51
randalthor 0:9646fc4e3fae 52 HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4);
randalthor 0:9646fc4e3fae 53
randalthor 0:9646fc4e3fae 54 /* System interrupt init*/
randalthor 0:9646fc4e3fae 55 /* MemoryManagement_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 56 HAL_NVIC_SetPriority(MemoryManagement_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 57 /* BusFault_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 58 HAL_NVIC_SetPriority(BusFault_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 59 /* UsageFault_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 60 HAL_NVIC_SetPriority(UsageFault_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 61 /* SVCall_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 62 HAL_NVIC_SetPriority(SVCall_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 63 /* DebugMonitor_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 64 HAL_NVIC_SetPriority(DebugMonitor_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 65 /* PendSV_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 66 HAL_NVIC_SetPriority(PendSV_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 67 /* SysTick_IRQn interrupt configuration */
randalthor 0:9646fc4e3fae 68 HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
randalthor 0:9646fc4e3fae 69
randalthor 0:9646fc4e3fae 70 /* USER CODE BEGIN MspInit 1 */
randalthor 0:9646fc4e3fae 71
randalthor 0:9646fc4e3fae 72 /* USER CODE END MspInit 1 */
randalthor 0:9646fc4e3fae 73 }
randalthor 0:9646fc4e3fae 74
randalthor 0:9646fc4e3fae 75 void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
randalthor 0:9646fc4e3fae 76 {
randalthor 0:9646fc4e3fae 77
randalthor 0:9646fc4e3fae 78 GPIO_InitTypeDef GPIO_InitStruct;
randalthor 0:9646fc4e3fae 79 if(hadc->Instance==ADC2)
randalthor 0:9646fc4e3fae 80 {
randalthor 0:9646fc4e3fae 81 /* USER CODE BEGIN ADC2_MspInit 0 */
randalthor 0:9646fc4e3fae 82
randalthor 0:9646fc4e3fae 83 /* USER CODE END ADC2_MspInit 0 */
randalthor 0:9646fc4e3fae 84 /* Peripheral clock enable */
randalthor 0:9646fc4e3fae 85 __HAL_RCC_ADC2_CLK_ENABLE();
randalthor 0:9646fc4e3fae 86
randalthor 0:9646fc4e3fae 87 /**ADC2 GPIO Configuration
randalthor 0:9646fc4e3fae 88 PA5 ------> ADC2_IN5
randalthor 0:9646fc4e3fae 89 PA6 ------> ADC2_IN6
randalthor 0:9646fc4e3fae 90 */
randalthor 0:9646fc4e3fae 91 GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6;
randalthor 0:9646fc4e3fae 92 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
randalthor 0:9646fc4e3fae 93 GPIO_InitStruct.Pull = GPIO_NOPULL;
randalthor 0:9646fc4e3fae 94 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 95
randalthor 0:9646fc4e3fae 96 /* Peripheral DMA init*/
randalthor 0:9646fc4e3fae 97
randalthor 0:9646fc4e3fae 98 hdma_adc2.Instance = DMA2_Stream2;
randalthor 0:9646fc4e3fae 99 hdma_adc2.Init.Channel = DMA_CHANNEL_1;
randalthor 0:9646fc4e3fae 100 hdma_adc2.Init.Direction = DMA_PERIPH_TO_MEMORY;
randalthor 0:9646fc4e3fae 101 hdma_adc2.Init.PeriphInc = DMA_PINC_DISABLE;
randalthor 0:9646fc4e3fae 102 hdma_adc2.Init.MemInc = DMA_MINC_ENABLE;
randalthor 0:9646fc4e3fae 103 hdma_adc2.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
randalthor 0:9646fc4e3fae 104 hdma_adc2.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
randalthor 0:9646fc4e3fae 105 hdma_adc2.Init.Mode = DMA_CIRCULAR;
randalthor 0:9646fc4e3fae 106 hdma_adc2.Init.Priority = DMA_PRIORITY_LOW;
randalthor 0:9646fc4e3fae 107 hdma_adc2.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
randalthor 0:9646fc4e3fae 108 if (HAL_DMA_Init(&hdma_adc2) != HAL_OK)
randalthor 0:9646fc4e3fae 109 {
randalthor 0:9646fc4e3fae 110 Error_Handler();
randalthor 0:9646fc4e3fae 111 }
randalthor 0:9646fc4e3fae 112
randalthor 0:9646fc4e3fae 113 __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc2);
randalthor 0:9646fc4e3fae 114
randalthor 0:9646fc4e3fae 115 /* USER CODE BEGIN ADC2_MspInit 1 */
randalthor 0:9646fc4e3fae 116
randalthor 0:9646fc4e3fae 117 /* USER CODE END ADC2_MspInit 1 */
randalthor 0:9646fc4e3fae 118 }
randalthor 0:9646fc4e3fae 119
randalthor 0:9646fc4e3fae 120 }
randalthor 0:9646fc4e3fae 121
randalthor 0:9646fc4e3fae 122 void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
randalthor 0:9646fc4e3fae 123 {
randalthor 0:9646fc4e3fae 124
randalthor 0:9646fc4e3fae 125 if(hadc->Instance==ADC2)
randalthor 0:9646fc4e3fae 126 {
randalthor 0:9646fc4e3fae 127 /* USER CODE BEGIN ADC2_MspDeInit 0 */
randalthor 0:9646fc4e3fae 128
randalthor 0:9646fc4e3fae 129 /* USER CODE END ADC2_MspDeInit 0 */
randalthor 0:9646fc4e3fae 130 /* Peripheral clock disable */
randalthor 0:9646fc4e3fae 131 __HAL_RCC_ADC2_CLK_DISABLE();
randalthor 0:9646fc4e3fae 132
randalthor 0:9646fc4e3fae 133 /**ADC2 GPIO Configuration
randalthor 0:9646fc4e3fae 134 PA5 ------> ADC2_IN5
randalthor 0:9646fc4e3fae 135 PA6 ------> ADC2_IN6
randalthor 0:9646fc4e3fae 136 */
randalthor 0:9646fc4e3fae 137 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6);
randalthor 0:9646fc4e3fae 138
randalthor 0:9646fc4e3fae 139 /* Peripheral DMA DeInit*/
randalthor 0:9646fc4e3fae 140 HAL_DMA_DeInit(hadc->DMA_Handle);
randalthor 0:9646fc4e3fae 141 }
randalthor 0:9646fc4e3fae 142 /* USER CODE BEGIN ADC2_MspDeInit 1 */
randalthor 0:9646fc4e3fae 143
randalthor 0:9646fc4e3fae 144 /* USER CODE END ADC2_MspDeInit 1 */
randalthor 0:9646fc4e3fae 145
randalthor 0:9646fc4e3fae 146 }
randalthor 0:9646fc4e3fae 147
randalthor 0:9646fc4e3fae 148 void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef* htim_encoder)
randalthor 0:9646fc4e3fae 149 {
randalthor 0:9646fc4e3fae 150
randalthor 0:9646fc4e3fae 151 GPIO_InitTypeDef GPIO_InitStruct;
randalthor 0:9646fc4e3fae 152 if(htim_encoder->Instance==TIM1)
randalthor 0:9646fc4e3fae 153 {
randalthor 0:9646fc4e3fae 154 /* USER CODE BEGIN TIM1_MspInit 0 */
randalthor 0:9646fc4e3fae 155
randalthor 0:9646fc4e3fae 156 /* USER CODE END TIM1_MspInit 0 */
randalthor 0:9646fc4e3fae 157 /* Peripheral clock enable */
randalthor 0:9646fc4e3fae 158 __HAL_RCC_TIM1_CLK_ENABLE();
randalthor 0:9646fc4e3fae 159
randalthor 0:9646fc4e3fae 160 /**TIM1 GPIO Configuration
randalthor 0:9646fc4e3fae 161 PE9 ------> TIM1_CH1
randalthor 0:9646fc4e3fae 162 PE11 ------> TIM1_CH2
randalthor 0:9646fc4e3fae 163 */
randalthor 0:9646fc4e3fae 164 GPIO_InitStruct.Pin = GPIO_PIN_9;
randalthor 0:9646fc4e3fae 165 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
randalthor 0:9646fc4e3fae 166 GPIO_InitStruct.Pull = GPIO_PULLUP;
randalthor 0:9646fc4e3fae 167 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
randalthor 0:9646fc4e3fae 168 GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
randalthor 0:9646fc4e3fae 169 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 170
randalthor 0:9646fc4e3fae 171 GPIO_InitStruct.Pin = GPIO_PIN_11;
randalthor 0:9646fc4e3fae 172 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
randalthor 0:9646fc4e3fae 173 GPIO_InitStruct.Pull = GPIO_PULLUP;
randalthor 0:9646fc4e3fae 174 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
randalthor 0:9646fc4e3fae 175 GPIO_InitStruct.Alternate = GPIO_AF1_TIM1;
randalthor 0:9646fc4e3fae 176 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 177
randalthor 0:9646fc4e3fae 178 /* USER CODE BEGIN TIM1_MspInit 1 */
randalthor 0:9646fc4e3fae 179
randalthor 0:9646fc4e3fae 180 /* USER CODE END TIM1_MspInit 1 */
randalthor 0:9646fc4e3fae 181 }
randalthor 0:9646fc4e3fae 182 else if(htim_encoder->Instance==TIM4)
randalthor 0:9646fc4e3fae 183 {
randalthor 0:9646fc4e3fae 184 /* USER CODE BEGIN TIM4_MspInit 0 */
randalthor 0:9646fc4e3fae 185
randalthor 0:9646fc4e3fae 186 /* USER CODE END TIM4_MspInit 0 */
randalthor 0:9646fc4e3fae 187 /* Peripheral clock enable */
randalthor 0:9646fc4e3fae 188 __HAL_RCC_TIM4_CLK_ENABLE();
randalthor 0:9646fc4e3fae 189
randalthor 0:9646fc4e3fae 190 /**TIM4 GPIO Configuration
randalthor 0:9646fc4e3fae 191 PD12 ------> TIM4_CH1
randalthor 0:9646fc4e3fae 192 PD13 ------> TIM4_CH2
randalthor 0:9646fc4e3fae 193 */
randalthor 0:9646fc4e3fae 194 GPIO_InitStruct.Pin = GPIO_PIN_12;
randalthor 0:9646fc4e3fae 195 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
randalthor 0:9646fc4e3fae 196 GPIO_InitStruct.Pull = GPIO_PULLUP;
randalthor 0:9646fc4e3fae 197 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
randalthor 0:9646fc4e3fae 198 GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
randalthor 0:9646fc4e3fae 199 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 200
randalthor 0:9646fc4e3fae 201 GPIO_InitStruct.Pin = GPIO_PIN_13;
randalthor 0:9646fc4e3fae 202 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
randalthor 0:9646fc4e3fae 203 GPIO_InitStruct.Pull = GPIO_PULLUP;
randalthor 0:9646fc4e3fae 204 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
randalthor 0:9646fc4e3fae 205 GPIO_InitStruct.Alternate = GPIO_AF2_TIM4;
randalthor 0:9646fc4e3fae 206 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 207
randalthor 0:9646fc4e3fae 208 /* USER CODE BEGIN TIM4_MspInit 1 */
randalthor 0:9646fc4e3fae 209
randalthor 0:9646fc4e3fae 210 /* USER CODE END TIM4_MspInit 1 */
randalthor 0:9646fc4e3fae 211 }
randalthor 0:9646fc4e3fae 212
randalthor 0:9646fc4e3fae 213 }
randalthor 0:9646fc4e3fae 214
randalthor 0:9646fc4e3fae 215 void HAL_TIM_PWM_MspInit(TIM_HandleTypeDef* htim_pwm)
randalthor 0:9646fc4e3fae 216 {
randalthor 0:9646fc4e3fae 217
randalthor 0:9646fc4e3fae 218 if(htim_pwm->Instance==TIM9)
randalthor 0:9646fc4e3fae 219 {
randalthor 0:9646fc4e3fae 220 /* USER CODE BEGIN TIM9_MspInit 0 */
randalthor 0:9646fc4e3fae 221
randalthor 0:9646fc4e3fae 222 /* USER CODE END TIM9_MspInit 0 */
randalthor 0:9646fc4e3fae 223 /* Peripheral clock enable */
randalthor 0:9646fc4e3fae 224 __HAL_RCC_TIM9_CLK_ENABLE();
randalthor 0:9646fc4e3fae 225 /* USER CODE BEGIN TIM9_MspInit 1 */
randalthor 0:9646fc4e3fae 226
randalthor 0:9646fc4e3fae 227 /* USER CODE END TIM9_MspInit 1 */
randalthor 0:9646fc4e3fae 228 }
randalthor 0:9646fc4e3fae 229
randalthor 0:9646fc4e3fae 230 }
randalthor 0:9646fc4e3fae 231
randalthor 0:9646fc4e3fae 232 void HAL_TIM_MspPostInit(TIM_HandleTypeDef* htim)
randalthor 0:9646fc4e3fae 233 {
randalthor 0:9646fc4e3fae 234
randalthor 0:9646fc4e3fae 235 GPIO_InitTypeDef GPIO_InitStruct;
randalthor 0:9646fc4e3fae 236 if(htim->Instance==TIM9)
randalthor 0:9646fc4e3fae 237 {
randalthor 0:9646fc4e3fae 238 /* USER CODE BEGIN TIM9_MspPostInit 0 */
randalthor 0:9646fc4e3fae 239
randalthor 0:9646fc4e3fae 240 /* USER CODE END TIM9_MspPostInit 0 */
randalthor 0:9646fc4e3fae 241
randalthor 0:9646fc4e3fae 242 /**TIM9 GPIO Configuration
randalthor 0:9646fc4e3fae 243 PE5 ------> TIM9_CH1
randalthor 0:9646fc4e3fae 244 PE6 ------> TIM9_CH2
randalthor 0:9646fc4e3fae 245 */
randalthor 0:9646fc4e3fae 246 GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6;
randalthor 0:9646fc4e3fae 247 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
randalthor 0:9646fc4e3fae 248 GPIO_InitStruct.Pull = GPIO_NOPULL;
randalthor 0:9646fc4e3fae 249 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
randalthor 0:9646fc4e3fae 250 GPIO_InitStruct.Alternate = GPIO_AF3_TIM9;
randalthor 0:9646fc4e3fae 251 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
randalthor 0:9646fc4e3fae 252
randalthor 0:9646fc4e3fae 253 /* USER CODE BEGIN TIM9_MspPostInit 1 */
randalthor 0:9646fc4e3fae 254
randalthor 0:9646fc4e3fae 255 /* USER CODE END TIM9_MspPostInit 1 */
randalthor 0:9646fc4e3fae 256 }
randalthor 0:9646fc4e3fae 257
randalthor 0:9646fc4e3fae 258 }
randalthor 0:9646fc4e3fae 259
randalthor 0:9646fc4e3fae 260 void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef* htim_encoder)
randalthor 0:9646fc4e3fae 261 {
randalthor 0:9646fc4e3fae 262
randalthor 0:9646fc4e3fae 263 if(htim_encoder->Instance==TIM1)
randalthor 0:9646fc4e3fae 264 {
randalthor 0:9646fc4e3fae 265 /* USER CODE BEGIN TIM1_MspDeInit 0 */
randalthor 0:9646fc4e3fae 266
randalthor 0:9646fc4e3fae 267 /* USER CODE END TIM1_MspDeInit 0 */
randalthor 0:9646fc4e3fae 268 /* Peripheral clock disable */
randalthor 0:9646fc4e3fae 269 __HAL_RCC_TIM1_CLK_DISABLE();
randalthor 0:9646fc4e3fae 270
randalthor 0:9646fc4e3fae 271 /**TIM1 GPIO Configuration
randalthor 0:9646fc4e3fae 272 PE9 ------> TIM1_CH1
randalthor 0:9646fc4e3fae 273 PE11 ------> TIM1_CH2
randalthor 0:9646fc4e3fae 274 */
randalthor 0:9646fc4e3fae 275 HAL_GPIO_DeInit(GPIOE, GPIO_PIN_9|GPIO_PIN_11);
randalthor 0:9646fc4e3fae 276
randalthor 0:9646fc4e3fae 277 /* USER CODE BEGIN TIM1_MspDeInit 1 */
randalthor 0:9646fc4e3fae 278
randalthor 0:9646fc4e3fae 279 /* USER CODE END TIM1_MspDeInit 1 */
randalthor 0:9646fc4e3fae 280 }
randalthor 0:9646fc4e3fae 281 else if(htim_encoder->Instance==TIM4)
randalthor 0:9646fc4e3fae 282 {
randalthor 0:9646fc4e3fae 283 /* USER CODE BEGIN TIM4_MspDeInit 0 */
randalthor 0:9646fc4e3fae 284
randalthor 0:9646fc4e3fae 285 /* USER CODE END TIM4_MspDeInit 0 */
randalthor 0:9646fc4e3fae 286 /* Peripheral clock disable */
randalthor 0:9646fc4e3fae 287 __HAL_RCC_TIM4_CLK_DISABLE();
randalthor 0:9646fc4e3fae 288
randalthor 0:9646fc4e3fae 289 /**TIM4 GPIO Configuration
randalthor 0:9646fc4e3fae 290 PD12 ------> TIM4_CH1
randalthor 0:9646fc4e3fae 291 PD13 ------> TIM4_CH2
randalthor 0:9646fc4e3fae 292 */
randalthor 0:9646fc4e3fae 293 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_12|GPIO_PIN_13);
randalthor 0:9646fc4e3fae 294
randalthor 0:9646fc4e3fae 295 /* USER CODE BEGIN TIM4_MspDeInit 1 */
randalthor 0:9646fc4e3fae 296
randalthor 0:9646fc4e3fae 297 /* USER CODE END TIM4_MspDeInit 1 */
randalthor 0:9646fc4e3fae 298 }
randalthor 0:9646fc4e3fae 299
randalthor 0:9646fc4e3fae 300 }
randalthor 0:9646fc4e3fae 301
randalthor 0:9646fc4e3fae 302 void HAL_TIM_PWM_MspDeInit(TIM_HandleTypeDef* htim_pwm)
randalthor 0:9646fc4e3fae 303 {
randalthor 0:9646fc4e3fae 304
randalthor 0:9646fc4e3fae 305 if(htim_pwm->Instance==TIM9)
randalthor 0:9646fc4e3fae 306 {
randalthor 0:9646fc4e3fae 307 /* USER CODE BEGIN TIM9_MspDeInit 0 */
randalthor 0:9646fc4e3fae 308
randalthor 0:9646fc4e3fae 309 /* USER CODE END TIM9_MspDeInit 0 */
randalthor 0:9646fc4e3fae 310 /* Peripheral clock disable */
randalthor 0:9646fc4e3fae 311 __HAL_RCC_TIM9_CLK_DISABLE();
randalthor 0:9646fc4e3fae 312 }
randalthor 0:9646fc4e3fae 313 /* USER CODE BEGIN TIM9_MspDeInit 1 */
randalthor 0:9646fc4e3fae 314
randalthor 0:9646fc4e3fae 315 /* USER CODE END TIM9_MspDeInit 1 */
randalthor 0:9646fc4e3fae 316
randalthor 0:9646fc4e3fae 317 }
randalthor 0:9646fc4e3fae 318
randalthor 0:9646fc4e3fae 319 /* USER CODE BEGIN 1 */
randalthor 0:9646fc4e3fae 320 void Error_Handler(void)
randalthor 0:9646fc4e3fae 321 {
randalthor 0:9646fc4e3fae 322 /* USER CODE BEGIN Error_Handler */
randalthor 0:9646fc4e3fae 323 /* User can add his own implementation to report the HAL error return state */
randalthor 0:9646fc4e3fae 324 while(1)
randalthor 0:9646fc4e3fae 325 {
randalthor 0:9646fc4e3fae 326 }
randalthor 0:9646fc4e3fae 327 /* USER CODE END Error_Handler */
randalthor 0:9646fc4e3fae 328 }
randalthor 0:9646fc4e3fae 329 /* USER CODE END 1 */
randalthor 0:9646fc4e3fae 330
randalthor 0:9646fc4e3fae 331 /**
randalthor 0:9646fc4e3fae 332 * @}
randalthor 0:9646fc4e3fae 333 */
randalthor 0:9646fc4e3fae 334
randalthor 0:9646fc4e3fae 335 /**
randalthor 0:9646fc4e3fae 336 * @}
randalthor 0:9646fc4e3fae 337 */
randalthor 0:9646fc4e3fae 338
randalthor 0:9646fc4e3fae 339 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
randalthor 0:9646fc4e3fae 340