2 *******************************************************************************
3 * Copyright (c) 2021, STMicroelectronics
6 * This software component is licensed by ST under BSD 3-Clause license,
7 * the "License"; You may not use this file except in compliance with the
8 * License. You may obtain a copy of the License at:
9 * opensource.org/licenses/BSD-3-Clause
11 *******************************************************************************
14 #include "pins_arduino.h"
20 // Digital PinName array
21 const PinName digitalPin
[] = {
61 // Analog (Ax) pin number array
62 const uint32_t analogInputPin
[] = {
75 * @brief System Clock Configuration
79 WEAK
void SystemClock_Config(void)
81 RCC_OscInitTypeDef RCC_OscInitStruct
= {0};
82 RCC_ClkInitTypeDef RCC_ClkInitStruct
= {0};
83 RCC_PeriphCLKInitTypeDef PeriphClkInit
= {0};
85 /** Initializes the RCC Oscillators according to the specified parameters
86 * in the RCC_OscInitTypeDef structure.
88 RCC_OscInitStruct
.OscillatorType
= RCC_OSCILLATORTYPE_HSE
;
89 RCC_OscInitStruct
.HSEState
= RCC_HSE_ON
;
90 RCC_OscInitStruct
.HSEPredivValue
= RCC_HSE_PREDIV_DIV2
;
91 RCC_OscInitStruct
.HSIState
= RCC_HSI_ON
;
92 RCC_OscInitStruct
.PLL
.PLLState
= RCC_PLL_ON
;
93 RCC_OscInitStruct
.PLL
.PLLSource
= RCC_PLLSOURCE_HSE
;
94 RCC_OscInitStruct
.PLL
.PLLMUL
= RCC_PLL_MUL9
;
95 if (HAL_RCC_OscConfig(&RCC_OscInitStruct
) != HAL_OK
)
99 /** Initializes the CPU, AHB and APB buses clocks
101 RCC_ClkInitStruct
.ClockType
= RCC_CLOCKTYPE_HCLK
|RCC_CLOCKTYPE_SYSCLK
102 |RCC_CLOCKTYPE_PCLK1
|RCC_CLOCKTYPE_PCLK2
;
103 RCC_ClkInitStruct
.SYSCLKSource
= RCC_SYSCLKSOURCE_PLLCLK
;
104 RCC_ClkInitStruct
.AHBCLKDivider
= RCC_SYSCLK_DIV1
;
105 RCC_ClkInitStruct
.APB1CLKDivider
= RCC_HCLK_DIV2
;
106 RCC_ClkInitStruct
.APB2CLKDivider
= RCC_HCLK_DIV1
;
108 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct
, FLASH_LATENCY_2
) != HAL_OK
)
112 PeriphClkInit
.PeriphClockSelection
= RCC_PERIPHCLK_USART1
|RCC_PERIPHCLK_USART2
113 |RCC_PERIPHCLK_USART3
;
114 PeriphClkInit
.Usart1ClockSelection
= RCC_USART1CLKSOURCE_PCLK2
;
115 PeriphClkInit
.Usart2ClockSelection
= RCC_USART2CLKSOURCE_PCLK1
;
116 PeriphClkInit
.Usart3ClockSelection
= RCC_USART3CLKSOURCE_PCLK1
;
117 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit
) != HAL_OK
)