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
95 // If analog pins are not contiguous in the digitalPin array:
96 // Add the analogInputPin array without defining NUM_ANALOG_FIRST
97 // Analog (Ax) pin number array
98 // where x is the index to retrieve the digital pin number
99 const uint32_t analogInputPin
[] = {
120 // ----------------------------------------------------------------------------
127 * @brief System Clock Configuration
128 * The system Clock is configured as follow :
129 * System Clock source = PLL (HSI)
130 * SYSCLK(Hz) = 64000000
131 * HCLK(Hz) = 64000000
137 * Flash Latency(WS) = 2
143 //64MHZ Internal Clock
144 // WEAK void SystemClock_Config(void)
146 // RCC_OscInitTypeDef RCC_OscInitStruct;
147 // RCC_ClkInitTypeDef RCC_ClkInitStruct;
148 // RCC_PeriphCLKInitTypeDef PeriphClkInit;
150 // /* Initializes the CPU, AHB and APB busses clocks */
151 // RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
152 // RCC_OscInitStruct.HSIState = RCC_HSI_ON;
153 // RCC_OscInitStruct.HSICalibrationValue = 16;
154 // RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
155 // RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
156 // RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL16;
157 // if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
161 // /* Initializes the CPU, AHB and APB busses clocks */
162 // RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
163 // | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
164 // RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
165 // RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
166 // RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
167 // RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
169 // if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
173 // PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
174 // PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
175 // if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
181 //72 MHz with 24Mhz ext. clock input/// (R9MM RX configuration)
182 void SystemClock_Config(void)
184 RCC_OscInitTypeDef RCC_OscInitStruct
= {0};
185 RCC_ClkInitTypeDef RCC_ClkInitStruct
= {0};
187 /** Initializes the CPU, AHB and APB busses clocks
189 RCC_OscInitStruct
.OscillatorType
= RCC_OSCILLATORTYPE_HSE
;
190 RCC_OscInitStruct
.HSEState
= RCC_HSE_ON
;
191 RCC_OscInitStruct
.HSEPredivValue
= RCC_HSE_PREDIV_DIV2
;
192 RCC_OscInitStruct
.HSIState
= RCC_HSI_ON
;
193 RCC_OscInitStruct
.PLL
.PLLState
= RCC_PLL_ON
;
194 RCC_OscInitStruct
.PLL
.PLLSource
= RCC_PLLSOURCE_HSE
;
195 RCC_OscInitStruct
.PLL
.PLLMUL
= RCC_PLL_MUL6
;
196 if (HAL_RCC_OscConfig(&RCC_OscInitStruct
) != HAL_OK
)
200 /** Initializes the CPU, AHB and APB busses clocks
202 RCC_ClkInitStruct
.ClockType
= RCC_CLOCKTYPE_HCLK
|RCC_CLOCKTYPE_SYSCLK
203 |RCC_CLOCKTYPE_PCLK1
|RCC_CLOCKTYPE_PCLK2
;
204 RCC_ClkInitStruct
.SYSCLKSource
= RCC_SYSCLKSOURCE_PLLCLK
;
205 RCC_ClkInitStruct
.AHBCLKDivider
= RCC_SYSCLK_DIV1
;
206 RCC_ClkInitStruct
.APB1CLKDivider
= RCC_HCLK_DIV2
;
207 RCC_ClkInitStruct
.APB2CLKDivider
= RCC_HCLK_DIV1
;
209 if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct
, FLASH_LATENCY_2
) != HAL_OK
)