GPIO Initialization Function.
1316{
1317 GPIO_InitTypeDef GPIO_InitStruct = {0};
1318
1319
1320
1321
1322 __HAL_RCC_GPIOE_CLK_ENABLE();
1323 __HAL_RCC_GPIOC_CLK_ENABLE();
1324 __HAL_RCC_GPIOF_CLK_ENABLE();
1325 __HAL_RCC_GPIOH_CLK_ENABLE();
1326 __HAL_RCC_GPIOA_CLK_ENABLE();
1327 __HAL_RCC_GPIOB_CLK_ENABLE();
1328 __HAL_RCC_GPIOG_CLK_ENABLE();
1329 __HAL_RCC_GPIOD_CLK_ENABLE();
1330
1331
1332 HAL_GPIO_WritePin(GPIOF, GPIO_PIN_12|GPIO_PIN_13, GPIO_PIN_RESET);
1333
1334
1335 HAL_GPIO_WritePin(GPIOE, GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11
1336 |GPIO_PIN_13, GPIO_PIN_RESET);
1337
1338
1339 HAL_GPIO_WritePin(GPIOD, GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
1340
1341
1342 HAL_GPIO_WritePin(GPIOG, GPIO_PIN_9, GPIO_PIN_RESET);
1343
1344
1346
1347
1348
1349 GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_10|GPIO_PIN_12
1350 |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_0|GPIO_PIN_1;
1351 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1352 GPIO_InitStruct.Pull = GPIO_NOPULL;
1353 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
1354
1355
1357 GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING;
1358 GPIO_InitStruct.Pull = GPIO_NOPULL;
1360
1361
1362 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_11;
1363 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1364 GPIO_InitStruct.Pull = GPIO_NOPULL;
1365 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
1366
1367
1368
1369 GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
1370 |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_4|GPIO_PIN_6;
1371 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1372 GPIO_InitStruct.Pull = GPIO_NOPULL;
1373 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
1374
1375
1376 GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13;
1377 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1378 GPIO_InitStruct.Pull = GPIO_NOPULL;
1379 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1380 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
1381
1382
1383
1384
1385 GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
1386 |GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_8
1387 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_15;
1388 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1389 GPIO_InitStruct.Pull = GPIO_NOPULL;
1390 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
1391
1392
1393
1394 GPIO_InitStruct.Pin = GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_11
1395 |GPIO_PIN_13;
1396 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1397 GPIO_InitStruct.Pull = GPIO_NOPULL;
1398 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1399 HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
1400
1401
1402
1403
1404 GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
1405 |GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6
1406 |GPIO_PIN_7;
1407 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1408 GPIO_InitStruct.Pull = GPIO_NOPULL;
1409 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1410
1411
1412 GPIO_InitStruct.Pin = GPIO_PIN_14|GPIO_PIN_15;
1413 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1414 GPIO_InitStruct.Pull = GPIO_NOPULL;
1415 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1416 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1417
1418
1420 GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
1421 GPIO_InitStruct.Pull = GPIO_NOPULL;
1423
1424
1425
1426 GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8|GPIO_PIN_9
1427 |GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
1428 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1429 GPIO_InitStruct.Pull = GPIO_NOPULL;
1430 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1431 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1432 HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
1433
1434
1435 GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12;
1436 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
1437 GPIO_InitStruct.Pull = GPIO_NOPULL;
1438 HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
1439
1440
1441 GPIO_InitStruct.Pin = GPIO_PIN_2;
1442 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1443 GPIO_InitStruct.Pull = GPIO_NOPULL;
1444 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1445 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1446 HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
1447
1448
1449 GPIO_InitStruct.Pin = GPIO_PIN_9;
1450 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1451 GPIO_InitStruct.Pull = GPIO_NOPULL;
1452 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1453 HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
1454
1455
1456 GPIO_InitStruct.Pin =
LD2_Pin;
1457 GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
1458 GPIO_InitStruct.Pull = GPIO_NOPULL;
1459 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
1461
1462
1463 GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
1464 GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
1465 GPIO_InitStruct.Pull = GPIO_NOPULL;
1466 GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
1467 GPIO_InitStruct.Alternate = GPIO_AF12_SDMMC1;
1468 HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
1469
1470
1471
1472}
#define USB_OverCurrent_GPIO_Port
#define USB_OverCurrent_Pin
#define USER_Btn_GPIO_Port