Add missing wifi targets for some DIY modules (#1210)
[ExpressLRS.git] / src / variants / GHOST_ATTO / variant.cpp
blob81c631b88892f6e2a8374322995481d2c58cef3e
1 /*
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"
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 // Pin number
26 const PinName digitalPin[] = {
27 PA_10, //D0
28 PA_9, //D1
29 PA_12, //D2
30 PB_0, //D3/A7
31 PB_7, //D4
32 PB_6, //D5
33 PB_1, //D6/A8
34 PF_0, //D7
35 PF_1, //D8
36 PA_8, //D9
37 PA_11, //D10
38 PB_5, //D11
39 PB_4, //D12
40 PB_3, //D13
41 PA_0, //D14/A0
42 PA_1, //D15/A1
43 PA_3, //D16/A2
44 PA_4, //D17/A3
45 PA_5, //D18
46 PA_6, //D19/A4
47 PA_7, //D20/A5
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[] = {
57 14, //A0
58 15, //A1
59 16, //A2
60 17, //A3
61 19, //A4
62 20, //A5
63 21, //A6
64 3, //A7
65 6, //A8
68 #ifdef __cplusplus
70 #endif
72 // ----------------------------------------------------------------------------
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
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)
94 Error_Handler();
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)
107 Error_Handler();
111 #ifdef __cplusplus
113 #endif