Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Functions | Variables
stm32f7xx_hal_msp.c File Reference

This file provides code for the MSP Initialization and de-Initialization codes. More...

#include "main.h"
Include dependency graph for stm32f7xx_hal_msp.c:

Go to the source code of this file.

Functions

void HAL_MspInit (void)
 
void HAL_ADC_MspInit (ADC_HandleTypeDef *hadc)
 ADC MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_ADC_MspDeInit (ADC_HandleTypeDef *hadc)
 ADC MSP De-Initialization This function freeze the hardware resources used in this example. More...
 
void HAL_CAN_MspInit (CAN_HandleTypeDef *hcan)
 CAN MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_CAN_MspDeInit (CAN_HandleTypeDef *hcan)
 CAN MSP De-Initialization This function freeze the hardware resources used in this example. More...
 
void HAL_I2C_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_I2C_MspDeInit (I2C_HandleTypeDef *hi2c)
 I2C MSP De-Initialization This function freeze the hardware resources used in this example. More...
 
void HAL_SPI_MspInit (SPI_HandleTypeDef *hspi)
 SPI MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_SPI_MspDeInit (SPI_HandleTypeDef *hspi)
 SPI MSP De-Initialization This function freeze the hardware resources used in this example. More...
 
void HAL_TIM_Base_MspInit (TIM_HandleTypeDef *htim_base)
 TIM_Base MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_TIM_Base_MspDeInit (TIM_HandleTypeDef *htim_base)
 TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example. More...
 
void HAL_UART_MspInit (UART_HandleTypeDef *huart)
 UART MSP Initialization This function configures the hardware resources used in this example. More...
 
void HAL_UART_MspDeInit (UART_HandleTypeDef *huart)
 UART MSP De-Initialization This function freeze the hardware resources used in this example. More...
 

Variables

DMA_HandleTypeDef hdma_adc1
 
DMA_HandleTypeDef hdma_adc2
 
DMA_HandleTypeDef hdma_adc3
 
static uint32_t HAL_RCC_CAN1_CLK_ENABLED =0
 

Detailed Description

This file provides code for the MSP Initialization and de-Initialization codes.

Attention

Copyright (c) 2024 STMicroelectronics. All rights reserved.

This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.

Definition in file stm32f7xx_hal_msp.c.

Function Documentation

◆ HAL_ADC_MspDeInit()

void HAL_ADC_MspDeInit ( ADC_HandleTypeDef *  hadc)

ADC MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
hadcADC handle pointer
Return values
None

ADC1 GPIO Configuration PA0/WKUP ---—> ADC1_IN0 PA1 ---—> ADC1_IN1 PA2 ---—> ADC1_IN2 PA3 ---—> ADC1_IN3 PA4 ---—> ADC1_IN4 PA5 ---—> ADC1_IN5

ADC2 GPIO Configuration PA6 ---—> ADC2_IN6 PA7 ---—> ADC2_IN7 PC4 ---—> ADC2_IN14 PC5 ---—> ADC2_IN15 PB0 ---—> ADC2_IN8 PB1 ---—> ADC2_IN9

ADC3 GPIO Configuration PC0 ---—> ADC3_IN10 PC1 ---—> ADC3_IN11 PC2 ---—> ADC3_IN12 PC3 ---—> ADC3_IN13

Definition at line 249 of file stm32f7xx_hal_msp.c.

250{
251 if(hadc->Instance==ADC1)
252 {
253 /* USER CODE BEGIN ADC1_MspDeInit 0 */
254
255 /* USER CODE END ADC1_MspDeInit 0 */
256 /* Peripheral clock disable */
257 __HAL_RCC_ADC1_CLK_DISABLE();
258
267 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
268 |GPIO_PIN_4|GPIO_PIN_5);
269
270 /* ADC1 DMA DeInit */
271 HAL_DMA_DeInit(hadc->DMA_Handle);
272 /* USER CODE BEGIN ADC1_MspDeInit 1 */
273
274 /* USER CODE END ADC1_MspDeInit 1 */
275 }
276 else if(hadc->Instance==ADC2)
277 {
278 /* USER CODE BEGIN ADC2_MspDeInit 0 */
279
280 /* USER CODE END ADC2_MspDeInit 0 */
281 /* Peripheral clock disable */
282 __HAL_RCC_ADC2_CLK_DISABLE();
283
292 HAL_GPIO_DeInit(GPIOA, GPIO_PIN_6|GPIO_PIN_7);
293
294 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_4|GPIO_PIN_5);
295
296 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1);
297
298 /* ADC2 DMA DeInit */
299 HAL_DMA_DeInit(hadc->DMA_Handle);
300 /* USER CODE BEGIN ADC2_MspDeInit 1 */
301
302 /* USER CODE END ADC2_MspDeInit 1 */
303 }
304 else if(hadc->Instance==ADC3)
305 {
306 /* USER CODE BEGIN ADC3_MspDeInit 0 */
307
308 /* USER CODE END ADC3_MspDeInit 0 */
309 /* Peripheral clock disable */
310 __HAL_RCC_ADC3_CLK_DISABLE();
311
318 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
319
320 /* ADC3 DMA DeInit */
321 HAL_DMA_DeInit(hadc->DMA_Handle);
322 /* USER CODE BEGIN ADC3_MspDeInit 1 */
323
324 /* USER CODE END ADC3_MspDeInit 1 */
325 }
326
327}

◆ HAL_ADC_MspInit()

void HAL_ADC_MspInit ( ADC_HandleTypeDef *  hadc)

ADC MSP Initialization This function configures the hardware resources used in this example.

Parameters
hadcADC handle pointer
Return values
None

ADC1 GPIO Configuration PA0/WKUP ---—> ADC1_IN0 PA1 ---—> ADC1_IN1 PA2 ---—> ADC1_IN2 PA3 ---—> ADC1_IN3 PA4 ---—> ADC1_IN4 PA5 ---—> ADC1_IN5

ADC2 GPIO Configuration PA6 ---—> ADC2_IN6 PA7 ---—> ADC2_IN7 PC4 ---—> ADC2_IN14 PC5 ---—> ADC2_IN15 PB0 ---—> ADC2_IN8 PB1 ---—> ADC2_IN9

ADC3 GPIO Configuration PC0 ---—> ADC3_IN10 PC1 ---—> ADC3_IN11 PC2 ---—> ADC3_IN12 PC3 ---—> ADC3_IN13

Definition at line 91 of file stm32f7xx_hal_msp.c.

92{
93 GPIO_InitTypeDef GPIO_InitStruct = {0};
94 if(hadc->Instance==ADC1)
95 {
96 /* USER CODE BEGIN ADC1_MspInit 0 */
97
98 /* USER CODE END ADC1_MspInit 0 */
99 /* Peripheral clock enable */
100 __HAL_RCC_ADC1_CLK_ENABLE();
101
102 __HAL_RCC_GPIOA_CLK_ENABLE();
111 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
112 |GPIO_PIN_4|GPIO_PIN_5;
113 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
114 GPIO_InitStruct.Pull = GPIO_NOPULL;
115 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
116
117 /* ADC1 DMA Init */
118 /* ADC1 Init */
119 hdma_adc1.Instance = DMA2_Stream0;
120 hdma_adc1.Init.Channel = DMA_CHANNEL_0;
121 hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY;
122 hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE;
123 hdma_adc1.Init.MemInc = DMA_MINC_ENABLE;
124 hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
125 hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
126 hdma_adc1.Init.Mode = DMA_CIRCULAR;
127 hdma_adc1.Init.Priority = DMA_PRIORITY_LOW;
128 hdma_adc1.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
129 if (HAL_DMA_Init(&hdma_adc1) != HAL_OK)
130 {
132 }
133
134 __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc1);
135
136 /* USER CODE BEGIN ADC1_MspInit 1 */
137
138 /* USER CODE END ADC1_MspInit 1 */
139 }
140 else if(hadc->Instance==ADC2)
141 {
142 /* USER CODE BEGIN ADC2_MspInit 0 */
143
144 /* USER CODE END ADC2_MspInit 0 */
145 /* Peripheral clock enable */
146 __HAL_RCC_ADC2_CLK_ENABLE();
147
148 __HAL_RCC_GPIOA_CLK_ENABLE();
149 __HAL_RCC_GPIOC_CLK_ENABLE();
150 __HAL_RCC_GPIOB_CLK_ENABLE();
159 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
160 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
161 GPIO_InitStruct.Pull = GPIO_NOPULL;
162 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
163
164 GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5;
165 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
166 GPIO_InitStruct.Pull = GPIO_NOPULL;
167 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
168
169 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
170 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
171 GPIO_InitStruct.Pull = GPIO_NOPULL;
172 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
173
174 /* ADC2 DMA Init */
175 /* ADC2 Init */
176 hdma_adc2.Instance = DMA2_Stream2;
177 hdma_adc2.Init.Channel = DMA_CHANNEL_1;
178 hdma_adc2.Init.Direction = DMA_PERIPH_TO_MEMORY;
179 hdma_adc2.Init.PeriphInc = DMA_PINC_DISABLE;
180 hdma_adc2.Init.MemInc = DMA_MINC_ENABLE;
181 hdma_adc2.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
182 hdma_adc2.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
183 hdma_adc2.Init.Mode = DMA_CIRCULAR;
184 hdma_adc2.Init.Priority = DMA_PRIORITY_LOW;
185 hdma_adc2.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
186 if (HAL_DMA_Init(&hdma_adc2) != HAL_OK)
187 {
189 }
190
191 __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc2);
192
193 /* USER CODE BEGIN ADC2_MspInit 1 */
194
195 /* USER CODE END ADC2_MspInit 1 */
196 }
197 else if(hadc->Instance==ADC3)
198 {
199 /* USER CODE BEGIN ADC3_MspInit 0 */
200
201 /* USER CODE END ADC3_MspInit 0 */
202 /* Peripheral clock enable */
203 __HAL_RCC_ADC3_CLK_ENABLE();
204
205 __HAL_RCC_GPIOC_CLK_ENABLE();
212 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3;
213 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
214 GPIO_InitStruct.Pull = GPIO_NOPULL;
215 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
216
217 /* ADC3 DMA Init */
218 /* ADC3 Init */
219 hdma_adc3.Instance = DMA2_Stream1;
220 hdma_adc3.Init.Channel = DMA_CHANNEL_2;
221 hdma_adc3.Init.Direction = DMA_PERIPH_TO_MEMORY;
222 hdma_adc3.Init.PeriphInc = DMA_PINC_DISABLE;
223 hdma_adc3.Init.MemInc = DMA_MINC_ENABLE;
224 hdma_adc3.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
225 hdma_adc3.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
226 hdma_adc3.Init.Mode = DMA_CIRCULAR;
227 hdma_adc3.Init.Priority = DMA_PRIORITY_LOW;
228 hdma_adc3.Init.FIFOMode = DMA_FIFOMODE_DISABLE;
229 if (HAL_DMA_Init(&hdma_adc3) != HAL_OK)
230 {
232 }
233
234 __HAL_LINKDMA(hadc,DMA_Handle,hdma_adc3);
235
236 /* USER CODE BEGIN ADC3_MspInit 1 */
237
238 /* USER CODE END ADC3_MspInit 1 */
239 }
240
241}
void Error_Handler(void)
This function is executed in case of error occurrence.
Definition: main.c:1178
DMA_HandleTypeDef hdma_adc1
Definition: main.c:47
DMA_HandleTypeDef hdma_adc3
Definition: AnalogSensor.h:46
DMA_HandleTypeDef hdma_adc2
Definition: AnalogSensor.h:46
Here is the call graph for this function:

◆ HAL_CAN_MspDeInit()

void HAL_CAN_MspDeInit ( CAN_HandleTypeDef *  hcan)

CAN MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
hcanCAN handle pointer
Return values
None

CAN1 GPIO Configuration PD0 ---—> CAN1_RX PD1 ---—> CAN1_TX

CAN2 GPIO Configuration PB13 ---—> CAN2_TX PB5 ---—> CAN2_RX

Definition at line 410 of file stm32f7xx_hal_msp.c.

411{
412 if(hcan->Instance==CAN1)
413 {
414 /* USER CODE BEGIN CAN1_MspDeInit 0 */
415
416 /* USER CODE END CAN1_MspDeInit 0 */
417 /* Peripheral clock disable */
420 __HAL_RCC_CAN1_CLK_DISABLE();
421 }
422
427 HAL_GPIO_DeInit(GPIOD, GPIO_PIN_0|GPIO_PIN_1);
428
429 /* CAN1 interrupt DeInit */
430 HAL_NVIC_DisableIRQ(CAN1_RX0_IRQn);
431 /* USER CODE BEGIN CAN1_MspDeInit 1 */
432
433 /* USER CODE END CAN1_MspDeInit 1 */
434 }
435 else if(hcan->Instance==CAN2)
436 {
437 /* USER CODE BEGIN CAN2_MspDeInit 0 */
438
439 /* USER CODE END CAN2_MspDeInit 0 */
440 /* Peripheral clock disable */
441 __HAL_RCC_CAN2_CLK_DISABLE();
444 __HAL_RCC_CAN1_CLK_DISABLE();
445 }
446
451 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_5);
452
453 /* CAN2 interrupt DeInit */
454 HAL_NVIC_DisableIRQ(CAN2_RX0_IRQn);
455 /* USER CODE BEGIN CAN2_MspDeInit 1 */
456
457 /* USER CODE END CAN2_MspDeInit 1 */
458 }
459
460}
static uint32_t HAL_RCC_CAN1_CLK_ENABLED

◆ HAL_CAN_MspInit()

void HAL_CAN_MspInit ( CAN_HandleTypeDef *  hcan)

CAN MSP Initialization This function configures the hardware resources used in this example.

Parameters
hcanCAN handle pointer
Return values
None

CAN1 GPIO Configuration PD0 ---—> CAN1_RX PD1 ---—> CAN1_TX

CAN2 GPIO Configuration PB13 ---—> CAN2_TX PB5 ---—> CAN2_RX

Definition at line 337 of file stm32f7xx_hal_msp.c.

338{
339 GPIO_InitTypeDef GPIO_InitStruct = {0};
340 if(hcan->Instance==CAN1)
341 {
342 /* USER CODE BEGIN CAN1_MspInit 0 */
343
344 /* USER CODE END CAN1_MspInit 0 */
345 /* Peripheral clock enable */
348 __HAL_RCC_CAN1_CLK_ENABLE();
349 }
350
351 __HAL_RCC_GPIOD_CLK_ENABLE();
356 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
357 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
358 GPIO_InitStruct.Pull = GPIO_NOPULL;
359 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
360 GPIO_InitStruct.Alternate = GPIO_AF9_CAN1;
361 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
362
363 /* CAN1 interrupt Init */
364 HAL_NVIC_SetPriority(CAN1_RX0_IRQn, 0, 0);
365 HAL_NVIC_EnableIRQ(CAN1_RX0_IRQn);
366 /* USER CODE BEGIN CAN1_MspInit 1 */
367
368 /* USER CODE END CAN1_MspInit 1 */
369 }
370 else if(hcan->Instance==CAN2)
371 {
372 /* USER CODE BEGIN CAN2_MspInit 0 */
373
374 /* USER CODE END CAN2_MspInit 0 */
375 /* Peripheral clock enable */
376 __HAL_RCC_CAN2_CLK_ENABLE();
379 __HAL_RCC_CAN1_CLK_ENABLE();
380 }
381
382 __HAL_RCC_GPIOB_CLK_ENABLE();
387 GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_5;
388 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
389 GPIO_InitStruct.Pull = GPIO_NOPULL;
390 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
391 GPIO_InitStruct.Alternate = GPIO_AF9_CAN2;
392 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
393
394 /* CAN2 interrupt Init */
395 HAL_NVIC_SetPriority(CAN2_RX0_IRQn, 0, 0);
396 HAL_NVIC_EnableIRQ(CAN2_RX0_IRQn);
397 /* USER CODE BEGIN CAN2_MspInit 1 */
398
399 /* USER CODE END CAN2_MspInit 1 */
400 }
401
402}

◆ HAL_I2C_MspDeInit()

void HAL_I2C_MspDeInit ( I2C_HandleTypeDef *  hi2c)

I2C MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
hi2cI2C handle pointer
Return values
None

I2C1 GPIO Configuration PB8 ---—> I2C1_SCL PB9 ---—> I2C1_SDA

I2C2 GPIO Configuration PF0 ---—> I2C2_SDA PF1 ---—> I2C2_SCL

I2C4 GPIO Configuration PF14 ---—> I2C4_SCL PF15 ---—> I2C4_SDA

Definition at line 580 of file stm32f7xx_hal_msp.c.

581{
582 if(hi2c->Instance==I2C1)
583 {
584 /* USER CODE BEGIN I2C1_MspDeInit 0 */
585
586 /* USER CODE END I2C1_MspDeInit 0 */
587 /* Peripheral clock disable */
588 __HAL_RCC_I2C1_CLK_DISABLE();
589
594 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_8);
595
596 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_9);
597
598 /* USER CODE BEGIN I2C1_MspDeInit 1 */
599
600 /* USER CODE END I2C1_MspDeInit 1 */
601 }
602 else if(hi2c->Instance==I2C2)
603 {
604 /* USER CODE BEGIN I2C2_MspDeInit 0 */
605
606 /* USER CODE END I2C2_MspDeInit 0 */
607 /* Peripheral clock disable */
608 __HAL_RCC_I2C2_CLK_DISABLE();
609
614 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_0);
615
616 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_1);
617
618 /* USER CODE BEGIN I2C2_MspDeInit 1 */
619
620 /* USER CODE END I2C2_MspDeInit 1 */
621 }
622 else if(hi2c->Instance==I2C4)
623 {
624 /* USER CODE BEGIN I2C4_MspDeInit 0 */
625
626 /* USER CODE END I2C4_MspDeInit 0 */
627 /* Peripheral clock disable */
628 __HAL_RCC_I2C4_CLK_DISABLE();
629
634 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_14);
635
636 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_15);
637
638 /* USER CODE BEGIN I2C4_MspDeInit 1 */
639
640 /* USER CODE END I2C4_MspDeInit 1 */
641 }
642
643}

◆ HAL_I2C_MspInit()

void HAL_I2C_MspInit ( I2C_HandleTypeDef *  hi2c)

I2C MSP Initialization This function configures the hardware resources used in this example.

Parameters
hi2cI2C handle pointer
Return values
None

Initializes the peripherals clock

I2C1 GPIO Configuration PB8 ---—> I2C1_SCL PB9 ---—> I2C1_SDA

Initializes the peripherals clock

I2C2 GPIO Configuration PF0 ---—> I2C2_SDA PF1 ---—> I2C2_SCL

Initializes the peripherals clock

I2C4 GPIO Configuration PF14 ---—> I2C4_SCL PF15 ---—> I2C4_SDA

Definition at line 468 of file stm32f7xx_hal_msp.c.

469{
470 GPIO_InitTypeDef GPIO_InitStruct = {0};
471 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
472 if(hi2c->Instance==I2C1)
473 {
474 /* USER CODE BEGIN I2C1_MspInit 0 */
475
476 /* USER CODE END I2C1_MspInit 0 */
477
480 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C1;
481 PeriphClkInitStruct.I2c1ClockSelection = RCC_I2C1CLKSOURCE_PCLK1;
482 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
483 {
485 }
486
487 __HAL_RCC_GPIOB_CLK_ENABLE();
492 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
493 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
494 GPIO_InitStruct.Pull = GPIO_NOPULL;
495 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
496 GPIO_InitStruct.Alternate = GPIO_AF4_I2C1;
497 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
498
499 /* Peripheral clock enable */
500 __HAL_RCC_I2C1_CLK_ENABLE();
501 /* USER CODE BEGIN I2C1_MspInit 1 */
502
503 /* USER CODE END I2C1_MspInit 1 */
504 }
505 else if(hi2c->Instance==I2C2)
506 {
507 /* USER CODE BEGIN I2C2_MspInit 0 */
508
509 /* USER CODE END I2C2_MspInit 0 */
510
513 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C2;
514 PeriphClkInitStruct.I2c2ClockSelection = RCC_I2C2CLKSOURCE_PCLK1;
515 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
516 {
518 }
519
520 __HAL_RCC_GPIOF_CLK_ENABLE();
525 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
526 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
527 GPIO_InitStruct.Pull = GPIO_NOPULL;
528 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
529 GPIO_InitStruct.Alternate = GPIO_AF4_I2C2;
530 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
531
532 /* Peripheral clock enable */
533 __HAL_RCC_I2C2_CLK_ENABLE();
534 /* USER CODE BEGIN I2C2_MspInit 1 */
535
536 /* USER CODE END I2C2_MspInit 1 */
537 }
538 else if(hi2c->Instance==I2C4)
539 {
540 /* USER CODE BEGIN I2C4_MspInit 0 */
541
542 /* USER CODE END I2C4_MspInit 0 */
543
546 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2C4;
547 PeriphClkInitStruct.I2c4ClockSelection = RCC_I2C4CLKSOURCE_PCLK1;
548 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
549 {
551 }
552
553 __HAL_RCC_GPIOF_CLK_ENABLE();
558 GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15;
559 GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
560 GPIO_InitStruct.Pull = GPIO_NOPULL;
561 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
562 GPIO_InitStruct.Alternate = GPIO_AF4_I2C4;
563 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
564
565 /* Peripheral clock enable */
566 __HAL_RCC_I2C4_CLK_ENABLE();
567 /* USER CODE BEGIN I2C4_MspInit 1 */
568
569 /* USER CODE END I2C4_MspInit 1 */
570 }
571
572}
Here is the call graph for this function:

◆ HAL_MspInit()

void HAL_MspInit ( void  )

Initializes the Global MSP.

Definition at line 68 of file stm32f7xx_hal_msp.c.

69{
70
71 /* USER CODE BEGIN MspInit 0 */
72
73 /* USER CODE END MspInit 0 */
74
75 __HAL_RCC_PWR_CLK_ENABLE();
76 __HAL_RCC_SYSCFG_CLK_ENABLE();
77
78 /* System interrupt init*/
79
80 /* USER CODE BEGIN MspInit 1 */
81
82 /* USER CODE END MspInit 1 */
83}

◆ HAL_SPI_MspDeInit()

void HAL_SPI_MspDeInit ( SPI_HandleTypeDef *  hspi)

SPI MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
hspiSPI handle pointer
Return values
None

SPI3 GPIO Configuration PB2 ---—> SPI3_MOSI PC10 ---—> SPI3_SCK PC11 ---—> SPI3_MISO

SPI4 GPIO Configuration PE2 ---—> SPI4_SCK PE5 ---—> SPI4_MISO PE6 ---—> SPI4_MOSI

SPI5 GPIO Configuration PF7 ---—> SPI5_SCK PF8 ---—> SPI5_MISO PF9 ---—> SPI5_MOSI

Definition at line 746 of file stm32f7xx_hal_msp.c.

747{
748 if(hspi->Instance==SPI3)
749 {
750 /* USER CODE BEGIN SPI3_MspDeInit 0 */
751
752 /* USER CODE END SPI3_MspDeInit 0 */
753 /* Peripheral clock disable */
754 __HAL_RCC_SPI3_CLK_DISABLE();
755
761 HAL_GPIO_DeInit(GPIOB, GPIO_PIN_2);
762
763 HAL_GPIO_DeInit(GPIOC, GPIO_PIN_10|GPIO_PIN_11);
764
765 /* USER CODE BEGIN SPI3_MspDeInit 1 */
766
767 /* USER CODE END SPI3_MspDeInit 1 */
768 }
769 else if(hspi->Instance==SPI4)
770 {
771 /* USER CODE BEGIN SPI4_MspDeInit 0 */
772
773 /* USER CODE END SPI4_MspDeInit 0 */
774 /* Peripheral clock disable */
775 __HAL_RCC_SPI4_CLK_DISABLE();
776
782 HAL_GPIO_DeInit(GPIOE, GPIO_PIN_2|GPIO_PIN_5|GPIO_PIN_6);
783
784 /* USER CODE BEGIN SPI4_MspDeInit 1 */
785
786 /* USER CODE END SPI4_MspDeInit 1 */
787 }
788 else if(hspi->Instance==SPI5)
789 {
790 /* USER CODE BEGIN SPI5_MspDeInit 0 */
791
792 /* USER CODE END SPI5_MspDeInit 0 */
793 /* Peripheral clock disable */
794 __HAL_RCC_SPI5_CLK_DISABLE();
795
801 HAL_GPIO_DeInit(GPIOF, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9);
802
803 /* USER CODE BEGIN SPI5_MspDeInit 1 */
804
805 /* USER CODE END SPI5_MspDeInit 1 */
806 }
807
808}

◆ HAL_SPI_MspInit()

void HAL_SPI_MspInit ( SPI_HandleTypeDef *  hspi)

SPI MSP Initialization This function configures the hardware resources used in this example.

Parameters
hspiSPI handle pointer
Return values
None

SPI3 GPIO Configuration PB2 ---—> SPI3_MOSI PC10 ---—> SPI3_SCK PC11 ---—> SPI3_MISO

SPI4 GPIO Configuration PE2 ---—> SPI4_SCK PE5 ---—> SPI4_MISO PE6 ---—> SPI4_MOSI

SPI5 GPIO Configuration PF7 ---—> SPI5_SCK PF8 ---—> SPI5_MISO PF9 ---—> SPI5_MOSI

Definition at line 651 of file stm32f7xx_hal_msp.c.

652{
653 GPIO_InitTypeDef GPIO_InitStruct = {0};
654 if(hspi->Instance==SPI3)
655 {
656 /* USER CODE BEGIN SPI3_MspInit 0 */
657
658 /* USER CODE END SPI3_MspInit 0 */
659 /* Peripheral clock enable */
660 __HAL_RCC_SPI3_CLK_ENABLE();
661
662 __HAL_RCC_GPIOB_CLK_ENABLE();
663 __HAL_RCC_GPIOC_CLK_ENABLE();
669 GPIO_InitStruct.Pin = GPIO_PIN_2;
670 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
671 GPIO_InitStruct.Pull = GPIO_NOPULL;
672 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
673 GPIO_InitStruct.Alternate = GPIO_AF7_SPI3;
674 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
675
676 GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11;
677 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
678 GPIO_InitStruct.Pull = GPIO_NOPULL;
679 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
680 GPIO_InitStruct.Alternate = GPIO_AF6_SPI3;
681 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
682
683 /* USER CODE BEGIN SPI3_MspInit 1 */
684
685 /* USER CODE END SPI3_MspInit 1 */
686 }
687 else if(hspi->Instance==SPI4)
688 {
689 /* USER CODE BEGIN SPI4_MspInit 0 */
690
691 /* USER CODE END SPI4_MspInit 0 */
692 /* Peripheral clock enable */
693 __HAL_RCC_SPI4_CLK_ENABLE();
694
695 __HAL_RCC_GPIOE_CLK_ENABLE();
701 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_5|GPIO_PIN_6;
702 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
703 GPIO_InitStruct.Pull = GPIO_NOPULL;
704 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
705 GPIO_InitStruct.Alternate = GPIO_AF5_SPI4;
706 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
707
708 /* USER CODE BEGIN SPI4_MspInit 1 */
709
710 /* USER CODE END SPI4_MspInit 1 */
711 }
712 else if(hspi->Instance==SPI5)
713 {
714 /* USER CODE BEGIN SPI5_MspInit 0 */
715
716 /* USER CODE END SPI5_MspInit 0 */
717 /* Peripheral clock enable */
718 __HAL_RCC_SPI5_CLK_ENABLE();
719
720 __HAL_RCC_GPIOF_CLK_ENABLE();
726 GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9;
727 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
728 GPIO_InitStruct.Pull = GPIO_NOPULL;
729 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
730 GPIO_InitStruct.Alternate = GPIO_AF5_SPI5;
731 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
732
733 /* USER CODE BEGIN SPI5_MspInit 1 */
734
735 /* USER CODE END SPI5_MspInit 1 */
736 }
737
738}

◆ HAL_TIM_Base_MspDeInit()

void HAL_TIM_Base_MspDeInit ( TIM_HandleTypeDef *  htim_base)

TIM_Base MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
htim_baseTIM_Base handle pointer
Return values
None

Definition at line 838 of file stm32f7xx_hal_msp.c.

839{
840 if(htim_base->Instance==TIM1)
841 {
842 /* USER CODE BEGIN TIM1_MspDeInit 0 */
843
844 /* USER CODE END TIM1_MspDeInit 0 */
845 /* Peripheral clock disable */
846 __HAL_RCC_TIM1_CLK_DISABLE();
847 /* USER CODE BEGIN TIM1_MspDeInit 1 */
848
849 /* USER CODE END TIM1_MspDeInit 1 */
850 }
851
852}

◆ HAL_TIM_Base_MspInit()

void HAL_TIM_Base_MspInit ( TIM_HandleTypeDef *  htim_base)

TIM_Base MSP Initialization This function configures the hardware resources used in this example.

Parameters
htim_baseTIM_Base handle pointer
Return values
None

Definition at line 816 of file stm32f7xx_hal_msp.c.

817{
818 if(htim_base->Instance==TIM1)
819 {
820 /* USER CODE BEGIN TIM1_MspInit 0 */
821
822 /* USER CODE END TIM1_MspInit 0 */
823 /* Peripheral clock enable */
824 __HAL_RCC_TIM1_CLK_ENABLE();
825 /* USER CODE BEGIN TIM1_MspInit 1 */
826
827 /* USER CODE END TIM1_MspInit 1 */
828 }
829
830}

◆ HAL_UART_MspDeInit()

void HAL_UART_MspDeInit ( UART_HandleTypeDef *  huart)

UART MSP De-Initialization This function freeze the hardware resources used in this example.

Parameters
huartUART handle pointer
Return values
None

USART3 GPIO Configuration PD8 ---—> USART3_TX PD9 ---—> USART3_RX

Definition at line 907 of file stm32f7xx_hal_msp.c.

908{
909 if(huart->Instance==USART3)
910 {
911 /* USER CODE BEGIN USART3_MspDeInit 0 */
912
913 /* USER CODE END USART3_MspDeInit 0 */
914 /* Peripheral clock disable */
915 __HAL_RCC_USART3_CLK_DISABLE();
916
921 HAL_GPIO_DeInit(GPIOD, STLK_RX_Pin|STLK_TX_Pin);
922
923 /* USER CODE BEGIN USART3_MspDeInit 1 */
924
925 /* USER CODE END USART3_MspDeInit 1 */
926 }
927
928}
#define STLK_RX_Pin
Definition: main.h:72
#define STLK_TX_Pin
Definition: main.h:74

◆ HAL_UART_MspInit()

void HAL_UART_MspInit ( UART_HandleTypeDef *  huart)

UART MSP Initialization This function configures the hardware resources used in this example.

Parameters
huartUART handle pointer
Return values
None

Initializes the peripherals clock

USART3 GPIO Configuration PD8 ---—> USART3_TX PD9 ---—> USART3_RX

Definition at line 860 of file stm32f7xx_hal_msp.c.

861{
862 GPIO_InitTypeDef GPIO_InitStruct = {0};
863 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
864 if(huart->Instance==USART3)
865 {
866 /* USER CODE BEGIN USART3_MspInit 0 */
867
868 /* USER CODE END USART3_MspInit 0 */
869
872 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART3;
873 PeriphClkInitStruct.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1;
874 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
875 {
877 }
878
879 /* Peripheral clock enable */
880 __HAL_RCC_USART3_CLK_ENABLE();
881
882 __HAL_RCC_GPIOD_CLK_ENABLE();
887 GPIO_InitStruct.Pin = STLK_RX_Pin|STLK_TX_Pin;
888 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
889 GPIO_InitStruct.Pull = GPIO_NOPULL;
890 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
891 GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
892 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
893
894 /* USER CODE BEGIN USART3_MspInit 1 */
895
896 /* USER CODE END USART3_MspInit 1 */
897 }
898
899}
Here is the call graph for this function:

Variable Documentation

◆ HAL_RCC_CAN1_CLK_ENABLED

uint32_t HAL_RCC_CAN1_CLK_ENABLED =0
static

Definition at line 329 of file stm32f7xx_hal_msp.c.

◆ hdma_adc1

DMA_HandleTypeDef hdma_adc1
extern

Definition at line 47 of file main.c.

◆ hdma_adc2

DMA_HandleTypeDef hdma_adc2
extern

Definition at line 46 of file AnalogSensor.h.

◆ hdma_adc3

DMA_HandleTypeDef hdma_adc3
extern

Definition at line 46 of file AnalogSensor.h.