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
[] = {
84 // Duplicated pins in order to be aligned with PinMap_ADC
99 // ----------------------------------------------------------------------------
106 * @brief System Clock Configuration
107 * The system Clock is configured as follow :
108 * System Clock source = PLL (HSI)
109 * SYSCLK(Hz) = 64000000
110 * HCLK(Hz) = 64000000
116 * Flash Latency(WS) = 2
122 //64MHZ Internal Clock
123 // WEAK void SystemClock_Config(void)
125 // RCC_OscInitTypeDef RCC_OscInitStruct;
126 // RCC_ClkInitTypeDef RCC_ClkInitStruct;
127 // RCC_PeriphCLKInitTypeDef PeriphClkInit;
129 // /* Initializes the CPU, AHB and APB busses clocks */
130 // RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
131 // RCC_OscInitStruct.HSIState = RCC_HSI_ON;
132 // RCC_OscInitStruct.HSICalibrationValue = 16;
133 // RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
134 // RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
135 // RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
136 // if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
140 // /* Initializes the CPU, AHB and APB busses clocks */
141 // RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
142 // | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
143 // RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
144 // RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
145 // RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
146 // RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
148 // if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
152 // PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
153 // PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
154 // if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
160 //72 MHz with 24Mhz ext. clock input/// (R9MM RX configuration)
161 void SystemClock_Config(void)
163 RCC_OscInitTypeDef RCC_OscInitStruct
= {0};
164 RCC_ClkInitTypeDef RCC_ClkInitStruct
= {0};
166 /** Initializes the CPU, AHB and APB busses clocks
168 RCC_OscInitStruct
.OscillatorType
= RCC_OSCILLATORTYPE_HSE
;
169 RCC_OscInitStruct
.HSEState
= RCC_HSE_ON
;
170 RCC_OscInitStruct
.HSEPredivValue
= RCC_HSE_PREDIV_DIV2
;
171 RCC_OscInitStruct
.HSIState
= RCC_HSI_ON
;
172 RCC_OscInitStruct
.PLL
.PLLState
= RCC_PLL_ON
;
173 RCC_OscInitStruct
.PLL
.PLLSource
= RCC_PLLSOURCE_HSE
;
174 RCC_OscInitStruct
.PLL
.PLLMUL
= RCC_PLL_MUL6
;
175 if (HAL_RCC_OscConfig(&RCC_OscInitStruct
) != HAL_OK
)
179 /** Initializes the CPU, AHB and APB busses clocks
181 RCC_ClkInitStruct
.ClockType
= RCC_CLOCKTYPE_HCLK
|RCC_CLOCKTYPE_SYSCLK
182 |RCC_CLOCKTYPE_PCLK1
|RCC_CLOCKTYPE_PCLK2
;
183 RCC_ClkInitStruct
.SYSCLKSource
= RCC_SYSCLKSOURCE_PLLCLK
;
184 RCC_ClkInitStruct
.AHBCLKDivider
= RCC_SYSCLK_DIV1
;
185 RCC_ClkInitStruct
.APB1CLKDivider
= RCC_HCLK_DIV2
;
186 RCC_ClkInitStruct
.APB2CLKDivider
= RCC_HCLK_DIV1
;
188 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct
, FLASH_LATENCY_2
) != HAL_OK
)