2 Copyright (c) 2011 Arduino. All right reserved.
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 See the GNU Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "pins_arduino.h"
26 const PinName digitalPin
[] = {
48 PA_2
, //D21/A6 - STLink Tx
49 PA_15
//D22 - STLink Rx
52 // If analog pins are not contiguous in the digitalPin array:
53 // Add the analogInputPin array without defining NUM_ANALOG_FIRST
54 // Analog (Ax) pin number array
55 // where x is the index to retrieve the digital pin number
56 const uint32_t analogInputPin
[] = {
72 // ----------------------------------------------------------------------------
78 WEAK
void SystemClock_Config(void)
80 RCC_OscInitTypeDef RCC_OscInitStruct
= {0};
81 RCC_ClkInitTypeDef RCC_ClkInitStruct
= {0};
83 /** Initializes the CPU, AHB and APB busses clocks
85 RCC_OscInitStruct
.OscillatorType
= RCC_OSCILLATORTYPE_HSE
;
86 RCC_OscInitStruct
.HSEState
= RCC_HSE_ON
;
87 RCC_OscInitStruct
.HSEPredivValue
= RCC_HSE_PREDIV_DIV4
;
88 RCC_OscInitStruct
.HSIState
= RCC_HSI_ON
;
89 RCC_OscInitStruct
.PLL
.PLLState
= RCC_PLL_ON
;
90 RCC_OscInitStruct
.PLL
.PLLSource
= RCC_PLLSOURCE_HSE
;
91 RCC_OscInitStruct
.PLL
.PLLMUL
= RCC_PLL_MUL9
;
92 if (HAL_RCC_OscConfig(&RCC_OscInitStruct
) != HAL_OK
)
96 /** Initializes the CPU, AHB and APB busses clocks
98 RCC_ClkInitStruct
.ClockType
= RCC_CLOCKTYPE_HCLK
|RCC_CLOCKTYPE_SYSCLK
99 |RCC_CLOCKTYPE_PCLK1
|RCC_CLOCKTYPE_PCLK2
;
100 RCC_ClkInitStruct
.SYSCLKSource
= RCC_SYSCLKSOURCE_PLLCLK
;
101 RCC_ClkInitStruct
.AHBCLKDivider
= RCC_SYSCLK_DIV1
;
102 RCC_ClkInitStruct
.APB1CLKDivider
= RCC_HCLK_DIV2
;
103 RCC_ClkInitStruct
.APB2CLKDivider
= RCC_HCLK_DIV1
;
105 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct
, FLASH_LATENCY_2
) != HAL_OK
)