Subversion Repositories DashDisplay

Rev

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

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