Subversion Repositories DashDisplay

Rev

Rev 61 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
50 mjames 1
/* USER CODE BEGIN Header */
30 mjames 2
/**
3
  ******************************************************************************
4
  * File Name          : stm32l1xx_hal_msp.c
50 mjames 5
  * Description        : This file provides code for the MSP Initialization
30 mjames 6
  *                      and de-Initialization codes.
7
  ******************************************************************************
50 mjames 8
  * @attention
30 mjames 9
  *
50 mjames 10
  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
11
  * All rights reserved.</center></h2>
30 mjames 12
  *
50 mjames 13
  * This software component is licensed by ST under BSD 3-Clause license,
14
  * the "License"; You may not use this file except in compliance with the
15
  * License. You may obtain a copy of the License at:
16
  *                        opensource.org/licenses/BSD-3-Clause
30 mjames 17
  *
18
  ******************************************************************************
19
  */
50 mjames 20
/* USER CODE END Header */
21
 
30 mjames 22
/* Includes ------------------------------------------------------------------*/
50 mjames 23
#include "main.h"
24
/* USER CODE BEGIN Includes */
30 mjames 25
 
50 mjames 26
/* USER CODE END Includes */
27
 
28
/* Private typedef -----------------------------------------------------------*/
29
/* USER CODE BEGIN TD */
30
 
31
/* USER CODE END TD */
32
 
33
/* Private define ------------------------------------------------------------*/
34
/* USER CODE BEGIN Define */
35
 
36
/* USER CODE END Define */
37
 
38
/* Private macro -------------------------------------------------------------*/
39
/* USER CODE BEGIN Macro */
40
 
41
/* USER CODE END Macro */
42
 
43
/* Private variables ---------------------------------------------------------*/
44
/* USER CODE BEGIN PV */
45
 
46
/* USER CODE END PV */
47
 
48
/* Private function prototypes -----------------------------------------------*/
49
/* USER CODE BEGIN PFP */
50
 
51
/* USER CODE END PFP */
52
 
53
/* External functions --------------------------------------------------------*/
54
/* USER CODE BEGIN ExternalFunctions */
55
 
56
/* USER CODE END ExternalFunctions */
57
 
30 mjames 58
/* USER CODE BEGIN 0 */
59
 
60
/* USER CODE END 0 */
61
/**
62
  * Initializes the Global MSP.
63
  */
64
void HAL_MspInit(void)
65
{
66
  /* USER CODE BEGIN MspInit 0 */
67
 
68
  /* USER CODE END MspInit 0 */
69
 
70
  __HAL_RCC_COMP_CLK_ENABLE();
71
  __HAL_RCC_SYSCFG_CLK_ENABLE();
50 mjames 72
  __HAL_RCC_PWR_CLK_ENABLE();
30 mjames 73
 
74
  /* System interrupt init*/
75
 
76
  /* USER CODE BEGIN MspInit 1 */
77
 
78
  /* USER CODE END MspInit 1 */
79
}
80
 
50 mjames 81
/**
64 mjames 82
* @brief I2C MSP Initialization
83
* This function configures the hardware resources used in this example
84
* @param hi2c: I2C handle pointer
85
* @retval None
86
*/
87
void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
88
{
89
  GPIO_InitTypeDef GPIO_InitStruct = {0};
90
  if(hi2c->Instance==I2C1)
91
  {
92
  /* USER CODE BEGIN I2C1_MspInit 0 */
93
 
94
  /* USER CODE END I2C1_MspInit 0 */
95
 
96
    __HAL_RCC_GPIOB_CLK_ENABLE();
97
    /**I2C1 GPIO Configuration
98
    PB6     ------> I2C1_SCL
99
    PB7     ------> I2C1_SDA
100
    */
101
    GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
102
    GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
103
    GPIO_InitStruct.Pull = GPIO_PULLUP;
104
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
105
    GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
106
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
107
 
108
    /* Peripheral clock enable */
109
    __HAL_RCC_I2C1_CLK_ENABLE();
110
  /* USER CODE BEGIN I2C1_MspInit 1 */
111
 
112
  /* USER CODE END I2C1_MspInit 1 */
113
  }
114
 
115
}
116
 
117
/**
118
* @brief I2C MSP De-Initialization
119
* This function freeze the hardware resources used in this example
120
* @param hi2c: I2C handle pointer
121
* @retval None
122
*/
123
void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
124
{
125
  if(hi2c->Instance==I2C1)
126
  {
127
  /* USER CODE BEGIN I2C1_MspDeInit 0 */
128
 
129
  /* USER CODE END I2C1_MspDeInit 0 */
130
    /* Peripheral clock disable */
131
    __HAL_RCC_I2C1_CLK_DISABLE();
132
 
133
    /**I2C1 GPIO Configuration
134
    PB6     ------> I2C1_SCL
135
    PB7     ------> I2C1_SDA
136
    */
137
    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6);
138
 
139
    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_7);
140
 
141
  /* USER CODE BEGIN I2C1_MspDeInit 1 */
142
 
143
  /* USER CODE END I2C1_MspDeInit 1 */
144
  }
145
 
146
}
147
 
148
/**
50 mjames 149
* @brief SPI MSP Initialization
150
* This function configures the hardware resources used in this example
151
* @param hspi: SPI handle pointer
152
* @retval None
153
*/
30 mjames 154
void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
155
{
50 mjames 156
  GPIO_InitTypeDef GPIO_InitStruct = {0};
30 mjames 157
  if(hspi->Instance==SPI1)
158
  {
159
  /* USER CODE BEGIN SPI1_MspInit 0 */
160
 
161
  /* USER CODE END SPI1_MspInit 0 */
162
    /* Peripheral clock enable */
163
    __HAL_RCC_SPI1_CLK_ENABLE();
50 mjames 164
 
165
    __HAL_RCC_GPIOA_CLK_ENABLE();
166
    /**SPI1 GPIO Configuration
30 mjames 167
    PA5     ------> SPI1_SCK
50 mjames 168
    PA7     ------> SPI1_MOSI
30 mjames 169
    */
50 mjames 170
    GPIO_InitStruct.Pin = SPI_SCK_Pin|SPI_MOSI_Pin;
30 mjames 171
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
172
    GPIO_InitStruct.Pull = GPIO_NOPULL;
173
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
174
    GPIO_InitStruct.Alternate = GPIO_AF5_SPI1;
175
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
176
 
177
  /* USER CODE BEGIN SPI1_MspInit 1 */
178
 
179
  /* USER CODE END SPI1_MspInit 1 */
180
  }
181
 
182
}
183
 
50 mjames 184
/**
185
* @brief SPI MSP De-Initialization
186
* This function freeze the hardware resources used in this example
187
* @param hspi: SPI handle pointer
188
* @retval None
189
*/
30 mjames 190
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
191
{
192
  if(hspi->Instance==SPI1)
193
  {
194
  /* USER CODE BEGIN SPI1_MspDeInit 0 */
195
 
196
  /* USER CODE END SPI1_MspDeInit 0 */
197
    /* Peripheral clock disable */
198
    __HAL_RCC_SPI1_CLK_DISABLE();
50 mjames 199
 
200
    /**SPI1 GPIO Configuration
30 mjames 201
    PA5     ------> SPI1_SCK
50 mjames 202
    PA7     ------> SPI1_MOSI
30 mjames 203
    */
50 mjames 204
    HAL_GPIO_DeInit(GPIOA, SPI_SCK_Pin|SPI_MOSI_Pin);
30 mjames 205
 
206
  /* USER CODE BEGIN SPI1_MspDeInit 1 */
207
 
208
  /* USER CODE END SPI1_MspDeInit 1 */
50 mjames 209
  }
30 mjames 210
 
211
}
212
 
50 mjames 213
/**
214
* @brief TIM_Base MSP Initialization
215
* This function configures the hardware resources used in this example
216
* @param htim_base: TIM_Base handle pointer
217
* @retval None
218
*/
219
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* htim_base)
220
{
221
  if(htim_base->Instance==TIM2)
222
  {
223
  /* USER CODE BEGIN TIM2_MspInit 0 */
224
 
225
  /* USER CODE END TIM2_MspInit 0 */
226
    /* Peripheral clock enable */
227
    __HAL_RCC_TIM2_CLK_ENABLE();
228
  /* USER CODE BEGIN TIM2_MspInit 1 */
229
 
230
  /* USER CODE END TIM2_MspInit 1 */
231
  }
232
 
233
}
234
 
235
/**
236
* @brief TIM_Encoder MSP Initialization
237
* This function configures the hardware resources used in this example
238
* @param htim_encoder: TIM_Encoder handle pointer
239
* @retval None
240
*/
44 mjames 241
void HAL_TIM_Encoder_MspInit(TIM_HandleTypeDef* htim_encoder)
242
{
50 mjames 243
  GPIO_InitTypeDef GPIO_InitStruct = {0};
44 mjames 244
  if(htim_encoder->Instance==TIM3)
245
  {
246
  /* USER CODE BEGIN TIM3_MspInit 0 */
247
 
248
  /* USER CODE END TIM3_MspInit 0 */
249
    /* Peripheral clock enable */
250
    __HAL_RCC_TIM3_CLK_ENABLE();
50 mjames 251
 
252
    __HAL_RCC_GPIOC_CLK_ENABLE();
253
    /**TIM3 GPIO Configuration
44 mjames 254
    PC6     ------> TIM3_CH1
50 mjames 255
    PC7     ------> TIM3_CH2
44 mjames 256
    */
257
    GPIO_InitStruct.Pin = SW2_I_Pin|SW2_Q_Pin;
258
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
259
    GPIO_InitStruct.Pull = GPIO_PULLUP;
260
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
261
    GPIO_InitStruct.Alternate = GPIO_AF2_TIM3;
262
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
263
 
264
  /* USER CODE BEGIN TIM3_MspInit 1 */
265
 
266
  /* USER CODE END TIM3_MspInit 1 */
267
  }
268
  else if(htim_encoder->Instance==TIM9)
269
  {
270
  /* USER CODE BEGIN TIM9_MspInit 0 */
271
 
272
  /* USER CODE END TIM9_MspInit 0 */
273
    /* Peripheral clock enable */
274
    __HAL_RCC_TIM9_CLK_ENABLE();
50 mjames 275
 
276
    __HAL_RCC_GPIOB_CLK_ENABLE();
277
    /**TIM9 GPIO Configuration
44 mjames 278
    PB13     ------> TIM9_CH1
50 mjames 279
    PB14     ------> TIM9_CH2
44 mjames 280
    */
281
    GPIO_InitStruct.Pin = SW1_I_Pin|SW1_Q_Pin;
282
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
283
    GPIO_InitStruct.Pull = GPIO_PULLUP;
284
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
285
    GPIO_InitStruct.Alternate = GPIO_AF3_TIM9;
286
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
287
 
288
  /* USER CODE BEGIN TIM9_MspInit 1 */
289
 
290
  /* USER CODE END TIM9_MspInit 1 */
291
  }
292
 
293
}
294
 
50 mjames 295
/**
296
* @brief TIM_Base MSP De-Initialization
297
* This function freeze the hardware resources used in this example
298
* @param htim_base: TIM_Base handle pointer
299
* @retval None
300
*/
301
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* htim_base)
302
{
303
  if(htim_base->Instance==TIM2)
304
  {
305
  /* USER CODE BEGIN TIM2_MspDeInit 0 */
306
 
307
  /* USER CODE END TIM2_MspDeInit 0 */
308
    /* Peripheral clock disable */
309
    __HAL_RCC_TIM2_CLK_DISABLE();
310
  /* USER CODE BEGIN TIM2_MspDeInit 1 */
311
 
312
  /* USER CODE END TIM2_MspDeInit 1 */
313
  }
314
 
315
}
316
 
317
/**
318
* @brief TIM_Encoder MSP De-Initialization
319
* This function freeze the hardware resources used in this example
320
* @param htim_encoder: TIM_Encoder handle pointer
321
* @retval None
322
*/
44 mjames 323
void HAL_TIM_Encoder_MspDeInit(TIM_HandleTypeDef* htim_encoder)
324
{
325
  if(htim_encoder->Instance==TIM3)
326
  {
327
  /* USER CODE BEGIN TIM3_MspDeInit 0 */
328
 
329
  /* USER CODE END TIM3_MspDeInit 0 */
330
    /* Peripheral clock disable */
331
    __HAL_RCC_TIM3_CLK_DISABLE();
50 mjames 332
 
333
    /**TIM3 GPIO Configuration
44 mjames 334
    PC6     ------> TIM3_CH1
50 mjames 335
    PC7     ------> TIM3_CH2
44 mjames 336
    */
337
    HAL_GPIO_DeInit(GPIOC, SW2_I_Pin|SW2_Q_Pin);
338
 
339
  /* USER CODE BEGIN TIM3_MspDeInit 1 */
340
 
341
  /* USER CODE END TIM3_MspDeInit 1 */
342
  }
343
  else if(htim_encoder->Instance==TIM9)
344
  {
345
  /* USER CODE BEGIN TIM9_MspDeInit 0 */
346
 
347
  /* USER CODE END TIM9_MspDeInit 0 */
348
    /* Peripheral clock disable */
349
    __HAL_RCC_TIM9_CLK_DISABLE();
50 mjames 350
 
351
    /**TIM9 GPIO Configuration
44 mjames 352
    PB13     ------> TIM9_CH1
50 mjames 353
    PB14     ------> TIM9_CH2
44 mjames 354
    */
355
    HAL_GPIO_DeInit(GPIOB, SW1_I_Pin|SW1_Q_Pin);
356
 
357
  /* USER CODE BEGIN TIM9_MspDeInit 1 */
358
 
359
  /* USER CODE END TIM9_MspDeInit 1 */
360
  }
361
 
362
}
363
 
50 mjames 364
/**
365
* @brief UART MSP Initialization
366
* This function configures the hardware resources used in this example
367
* @param huart: UART handle pointer
368
* @retval None
369
*/
30 mjames 370
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
371
{
50 mjames 372
  GPIO_InitTypeDef GPIO_InitStruct = {0};
60 mjames 373
  if(huart->Instance==UART4)
30 mjames 374
  {
60 mjames 375
  /* USER CODE BEGIN UART4_MspInit 0 */
376
 
377
  /* USER CODE END UART4_MspInit 0 */
378
    /* Peripheral clock enable */
379
    __HAL_RCC_UART4_CLK_ENABLE();
380
 
381
    __HAL_RCC_GPIOC_CLK_ENABLE();
382
    /**UART4 GPIO Configuration
383
    PC10     ------> UART4_TX
384
    PC11     ------> UART4_RX
385
    */
61 mjames 386
    GPIO_InitStruct.Pin = GPIO_PIN_10;
60 mjames 387
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
388
    GPIO_InitStruct.Pull = GPIO_PULLUP;
389
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
390
    GPIO_InitStruct.Alternate = GPIO_AF8_UART4;
391
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
392
 
61 mjames 393
    GPIO_InitStruct.Pin = GPIO_PIN_11;
394
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
395
    GPIO_InitStruct.Pull = GPIO_PULLUP;
396
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
397
    GPIO_InitStruct.Alternate = GPIO_AF8_UART4;
398
    HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
399
 
60 mjames 400
  /* USER CODE BEGIN UART4_MspInit 1 */
401
 
402
  /* USER CODE END UART4_MspInit 1 */
403
  }
404
  else if(huart->Instance==USART1)
405
  {
30 mjames 406
  /* USER CODE BEGIN USART1_MspInit 0 */
407
 
408
  /* USER CODE END USART1_MspInit 0 */
409
    /* Peripheral clock enable */
410
    __HAL_RCC_USART1_CLK_ENABLE();
50 mjames 411
 
412
    __HAL_RCC_GPIOA_CLK_ENABLE();
413
    /**USART1 GPIO Configuration
30 mjames 414
    PA9     ------> USART1_TX
50 mjames 415
    PA10     ------> USART1_RX
30 mjames 416
    */
417
    GPIO_InitStruct.Pin = PLX_TX_Pin|PLX_RX_Pin;
418
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
50 mjames 419
    GPIO_InitStruct.Pull = GPIO_NOPULL;
30 mjames 420
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
421
    GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
422
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
423
 
424
  /* USER CODE BEGIN USART1_MspInit 1 */
425
 
426
  /* USER CODE END USART1_MspInit 1 */
427
  }
428
  else if(huart->Instance==USART2)
429
  {
430
  /* USER CODE BEGIN USART2_MspInit 0 */
431
 
432
  /* USER CODE END USART2_MspInit 0 */
433
    /* Peripheral clock enable */
434
    __HAL_RCC_USART2_CLK_ENABLE();
50 mjames 435
 
436
    __HAL_RCC_GPIOA_CLK_ENABLE();
437
    /**USART2 GPIO Configuration
30 mjames 438
    PA2     ------> USART2_TX
50 mjames 439
    PA3     ------> USART2_RX
30 mjames 440
    */
50 mjames 441
    GPIO_InitStruct.Pin = GPIO_PIN_2;
30 mjames 442
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
50 mjames 443
    GPIO_InitStruct.Pull = GPIO_NOPULL;
444
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
445
    GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
446
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
447
 
448
    GPIO_InitStruct.Pin = GPIO_PIN_3;
449
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
30 mjames 450
    GPIO_InitStruct.Pull = GPIO_PULLUP;
451
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
452
    GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
453
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
454
 
455
  /* USER CODE BEGIN USART2_MspInit 1 */
456
 
457
  /* USER CODE END USART2_MspInit 1 */
458
  }
459
  else if(huart->Instance==USART3)
460
  {
461
  /* USER CODE BEGIN USART3_MspInit 0 */
462
 
463
  /* USER CODE END USART3_MspInit 0 */
464
    /* Peripheral clock enable */
465
    __HAL_RCC_USART3_CLK_ENABLE();
50 mjames 466
 
467
    __HAL_RCC_GPIOB_CLK_ENABLE();
468
    /**USART3 GPIO Configuration
30 mjames 469
    PB10     ------> USART3_TX
50 mjames 470
    PB11     ------> USART3_RX
30 mjames 471
    */
50 mjames 472
    GPIO_InitStruct.Pin = GPIO_PIN_10;
30 mjames 473
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
50 mjames 474
    GPIO_InitStruct.Pull = GPIO_NOPULL;
475
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
476
    GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
477
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
478
 
479
    GPIO_InitStruct.Pin = GPIO_PIN_11;
480
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
30 mjames 481
    GPIO_InitStruct.Pull = GPIO_PULLUP;
482
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
483
    GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
484
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
485
 
486
  /* USER CODE BEGIN USART3_MspInit 1 */
487
 
488
  /* USER CODE END USART3_MspInit 1 */
489
  }
490
 
491
}
492
 
50 mjames 493
/**
494
* @brief UART MSP De-Initialization
495
* This function freeze the hardware resources used in this example
496
* @param huart: UART handle pointer
497
* @retval None
498
*/
30 mjames 499
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
500
{
60 mjames 501
  if(huart->Instance==UART4)
30 mjames 502
  {
60 mjames 503
  /* USER CODE BEGIN UART4_MspDeInit 0 */
504
 
505
  /* USER CODE END UART4_MspDeInit 0 */
506
    /* Peripheral clock disable */
507
    __HAL_RCC_UART4_CLK_DISABLE();
508
 
509
    /**UART4 GPIO Configuration
510
    PC10     ------> UART4_TX
511
    PC11     ------> UART4_RX
512
    */
513
    HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11);
514
 
515
  /* USER CODE BEGIN UART4_MspDeInit 1 */
516
 
517
  /* USER CODE END UART4_MspDeInit 1 */
518
  }
519
  else if(huart->Instance==USART1)
520
  {
30 mjames 521
  /* USER CODE BEGIN USART1_MspDeInit 0 */
522
 
523
  /* USER CODE END USART1_MspDeInit 0 */
524
    /* Peripheral clock disable */
525
    __HAL_RCC_USART1_CLK_DISABLE();
50 mjames 526
 
527
    /**USART1 GPIO Configuration
30 mjames 528
    PA9     ------> USART1_TX
50 mjames 529
    PA10     ------> USART1_RX
30 mjames 530
    */
531
    HAL_GPIO_DeInit(GPIOA, PLX_TX_Pin|PLX_RX_Pin);
532
 
533
  /* USER CODE BEGIN USART1_MspDeInit 1 */
534
 
535
  /* USER CODE END USART1_MspDeInit 1 */
536
  }
537
  else if(huart->Instance==USART2)
538
  {
539
  /* USER CODE BEGIN USART2_MspDeInit 0 */
540
 
541
  /* USER CODE END USART2_MspDeInit 0 */
542
    /* Peripheral clock disable */
543
    __HAL_RCC_USART2_CLK_DISABLE();
50 mjames 544
 
545
    /**USART2 GPIO Configuration
30 mjames 546
    PA2     ------> USART2_TX
50 mjames 547
    PA3     ------> USART2_RX
30 mjames 548
    */
549
    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
550
 
551
  /* USER CODE BEGIN USART2_MspDeInit 1 */
552
 
553
  /* USER CODE END USART2_MspDeInit 1 */
554
  }
555
  else if(huart->Instance==USART3)
556
  {
557
  /* USER CODE BEGIN USART3_MspDeInit 0 */
558
 
559
  /* USER CODE END USART3_MspDeInit 0 */
560
    /* Peripheral clock disable */
561
    __HAL_RCC_USART3_CLK_DISABLE();
50 mjames 562
 
563
    /**USART3 GPIO Configuration
30 mjames 564
    PB10     ------> USART3_TX
50 mjames 565
    PB11     ------> USART3_RX
30 mjames 566
    */
567
    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11);
568
 
569
  /* USER CODE BEGIN USART3_MspDeInit 1 */
570
 
571
  /* USER CODE END USART3_MspDeInit 1 */
572
  }
573
 
574
}
575
 
576
/* USER CODE BEGIN 1 */
577
 
578
/* USER CODE END 1 */