My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

variant.cpp 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. /*
  2. Copyright (c) 2011 Arduino. All right reserved.
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with this library; if not, write to the Free Software
  13. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  14. */
  15. #include "pins_arduino.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. const PinName digitalPin[] = {
  20. PA_0,
  21. PA_1,
  22. PA_2,
  23. PA_3,
  24. PA_4,
  25. PA_5,
  26. PA_6,
  27. PA_7,
  28. PA_8,
  29. PA_9, // RXD
  30. PA_10, // TXD
  31. PA_11, // USB D-
  32. PA_12, // USB D+
  33. PA_13, // JTDI
  34. PA_14, // JTCK
  35. PA_15,
  36. PB_0,
  37. PB_1,
  38. PB_2,
  39. PB_3, // JTDO
  40. PB_4, // JTRST
  41. PB_5,
  42. PB_6,
  43. PB_7,
  44. PB_8,
  45. PB_9,
  46. PB_10,
  47. PB_11, // LED
  48. PB_12,
  49. PB_13,
  50. PB_14,
  51. PB_15,
  52. PC_0,
  53. PC_1,
  54. PC_2,
  55. PC_3,
  56. PC_4,
  57. PC_5,
  58. PC_6,
  59. PC_7,
  60. PC_8,
  61. PC_9,
  62. PC_10,
  63. PC_11,
  64. PC_12,
  65. PC_13,
  66. PC_14, // OSC32_1
  67. PC_15, // OSC32_2
  68. PD_0, // OSCIN
  69. PD_1, // OSCOUT
  70. PD_2
  71. };
  72. // Analog (Ax) pin number array
  73. const uint32_t analogInputPin[] = {
  74. 0, // A0, PA0
  75. 1, // A1, PA1
  76. 2, // A2, PA2
  77. 3, // A3, PA3
  78. 4, // A4, PA4
  79. 5, // A5, PA5
  80. 6, // A6, PA6
  81. 7, // A7, PA7
  82. 16, // A8, PB0
  83. 17, // A9, PB1
  84. 32, // A10, PC0
  85. 33, // A11, PC1
  86. 34, // A12, PC2
  87. 35, // A13, PC3
  88. 36, // A14, PC4
  89. 37 // A15, PC5
  90. };
  91. #ifdef __cplusplus
  92. }
  93. #endif
  94. // ----------------------------------------------------------------------------
  95. #ifdef __cplusplus
  96. extern "C" {
  97. #endif
  98. /**
  99. * @brief System Clock Configuration
  100. * @param None
  101. * @retval None
  102. */
  103. WEAK void SystemClock_Config(void)
  104. {
  105. RCC_OscInitTypeDef RCC_OscInitStruct = {};
  106. RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
  107. RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
  108. /* Initializes the CPU, AHB and APB busses clocks */
  109. RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  110. RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  111. RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
  112. RCC_OscInitStruct.HSIState = RCC_HSI_ON;
  113. RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  114. RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  115. RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
  116. if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
  117. Error_Handler();
  118. }
  119. /* Initializes the CPU, AHB and APB busses clocks */
  120. RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
  121. | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
  122. RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  123. RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  124. RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  125. RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
  126. if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
  127. Error_Handler();
  128. }
  129. PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
  130. PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
  131. PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
  132. if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
  133. Error_Handler();
  134. }
  135. }
  136. #ifdef __cplusplus
  137. }
  138. #endif