mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-25 16:47:29 +08:00
Merge d14f0a2c32
into eaab2dea92
This commit is contained in:
commit
0f739045e6
@ -473,6 +473,7 @@
|
||||
#define BOARD_BLACKBEEZMINI_V1 5251 // BlackBeezMini V1 (STM32F401CCU6)
|
||||
#define BOARD_XTLW_CLIMBER_8TH 5252 // XTLW Climber-8th (STM32F407VGT6)
|
||||
#define BOARD_FLY_RRF_E3_V1 5253 // Fly RRF E3 V1.0 (STM32F407VG)
|
||||
#define BOARD_LDO_LEVIATHAN_V1_2 5254 // LDO Leviathan V1.2 (STM32F446ZE)
|
||||
|
||||
//
|
||||
// Other ARM Cortex-M4
|
||||
|
@ -845,6 +845,8 @@
|
||||
#include "stm32f4/pins_XTLW_CLIMBER_8TH.h" // STM32F4 env:XTLW_CLIMBER_8TH
|
||||
#elif MB(FLY_RRF_E3_V1)
|
||||
#include "stm32f4/pins_FLY_RRF_E3_V1.h" // STM32F4 env:FLY_RRF_E3_V1
|
||||
#elif MB(LDO_LEVIATHAN_V1_2)
|
||||
#include "stm32f4/pins_LDO_LEVIATHAN_V1_2.h" // STM32F4 env:LDO_LEVIATHAN_V1_2
|
||||
|
||||
//
|
||||
// Other ARM Cortex-M4
|
||||
|
493
Marlin/src/pins/stm32f4/pins_LDO_LEVIATHAN_V1_2.h
Normal file
493
Marlin/src/pins/stm32f4/pins_LDO_LEVIATHAN_V1_2.h
Normal file
@ -0,0 +1,493 @@
|
||||
/**
|
||||
* Marlin 3D Printer Firmware
|
||||
* Copyright (c) 2024 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
||||
*
|
||||
* Based on Sprinter and grbl.
|
||||
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "env_validate.h"
|
||||
|
||||
#if HAS_MULTI_HOTEND
|
||||
#error "BOARD_LDO_LEVIATHAN_V1_2 only supports 1 hotend."
|
||||
#endif
|
||||
|
||||
#define BOARD_INFO_NAME "LDO Leviathan V1.2"
|
||||
#define BOARD_WEBSITE_URL "github.com/MotorDynamicsLab/Leviathan"
|
||||
|
||||
// Ignore temp readings during development
|
||||
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
|
||||
|
||||
// Use one of these or SDCard-based Emulation will be used
|
||||
#if NO_EEPROM_SELECTED
|
||||
//#define SRAM_EEPROM_EMULATION // Use BackSRAM-based EEPROM emulation
|
||||
#define FLASH_EEPROM_EMULATION // Use Flash-based EEPROM emulation
|
||||
#endif
|
||||
|
||||
#if ENABLED(FLASH_EEPROM_EMULATION)
|
||||
// Decrease delays and flash wear by spreading writes across the
|
||||
// 128 kB sector allocated for EEPROM emulation.
|
||||
#define FLASH_EEPROM_LEVELING
|
||||
#endif
|
||||
|
||||
// Avoid conflict with TIMER_TONE
|
||||
#define STEP_TIMER 8
|
||||
|
||||
#ifndef MARLIN_EEPROM_SIZE
|
||||
#define MARLIN_EEPROM_SIZE 0x1000 // 4K
|
||||
#endif
|
||||
|
||||
//
|
||||
// Filament Runout Sensor
|
||||
//
|
||||
#define FIL_RUNOUT_PIN PC0 // FILAMENT-SENSOR
|
||||
|
||||
//
|
||||
// Misc. Functions
|
||||
//
|
||||
#define LED_PIN PE6 // LED-Strip
|
||||
|
||||
//
|
||||
// Steppers
|
||||
//
|
||||
#define X_STEP_PIN PB10 // HV-STEPPER-0
|
||||
#define X_DIR_PIN PB11
|
||||
#define X_ENABLE_PIN PG0
|
||||
#ifndef X_CS_PIN
|
||||
#define X_CS_PIN PE15
|
||||
#endif
|
||||
|
||||
#define Y_STEP_PIN PF15 // HV-STEPPER-1
|
||||
#define Y_DIR_PIN PF14
|
||||
#define Y_ENABLE_PIN PE9
|
||||
#ifndef Y_CS_PIN
|
||||
#define Y_CS_PIN PE11
|
||||
#endif
|
||||
|
||||
#define Z_STEP_PIN PD4 // STEPPER-0
|
||||
#define Z_DIR_PIN PD3
|
||||
#define Z_ENABLE_PIN PD7
|
||||
|
||||
#define E0_STEP_PIN PC12 // STEPPER-1
|
||||
#define E0_DIR_PIN PC11
|
||||
#define E0_ENABLE_PIN PD2
|
||||
|
||||
#define E1_STEP_PIN PC9 // STEPPER-2
|
||||
#define E1_DIR_PIN PC8
|
||||
#define E1_ENABLE_PIN PC10
|
||||
|
||||
#define E2_STEP_PIN PG7 // STEPPER-3
|
||||
#define E2_DIR_PIN PG6
|
||||
#define E2_ENABLE_PIN PC7
|
||||
|
||||
#define E3_STEP_PIN PD10 // STEPPER-4
|
||||
#define E3_DIR_PIN PD9
|
||||
#define E3_ENABLE_PIN PD13
|
||||
|
||||
//
|
||||
// Integrated TMC5160/TMC2209 driver defaults
|
||||
//
|
||||
#if (HAS_X_AXIS && !AXIS_DRIVER_TYPE_X(TMC5160)) \
|
||||
|| (HAS_Y_AXIS && !AXIS_DRIVER_TYPE_Y(TMC5160)) \
|
||||
|| (NUM_Z_STEPPERS >= 1 && !AXIS_DRIVER_TYPE_Z(TMC2209)) \
|
||||
|| (NUM_Z_STEPPERS >= 2 && !AXIS_DRIVER_TYPE_Z2(TMC2209)) \
|
||||
|| (NUM_Z_STEPPERS >= 3 && !AXIS_DRIVER_TYPE_Z3(TMC2209)) \
|
||||
|| (NUM_Z_STEPPERS >= 4 && !AXIS_DRIVER_TYPE_Z4(TMC2209)) \
|
||||
|| (EXTRUDERS >= 1 && !AXIS_DRIVER_TYPE_E0(TMC2209)) \
|
||||
|| (EXTRUDERS >= 2 && !AXIS_DRIVER_TYPE_E1(TMC2209)) \
|
||||
|| (EXTRUDERS >= 3 && !AXIS_DRIVER_TYPE_E2(TMC2209)) \
|
||||
|| (EXTRUDERS >= 4 && !AXIS_DRIVER_TYPE_E3(TMC2209))
|
||||
#error "X and Y DRIVER TYPE must be TMC5160 and all others should be TMC2209 for BOARD_LDO_LEVIATHAN_V1_2."
|
||||
#endif
|
||||
|
||||
// RSENSE defaults
|
||||
#if HAS_X_AXIS
|
||||
static_assert(X_RSENSE == 0.075, "X_RSENSE (HV-STEPPER-0) must be 0.075 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if HAS_Y_AXIS
|
||||
static_assert(Y_RSENSE == 0.075, "Y_RSENSE (HV-STEPPER-1) must be 0.075 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if NUM_Z_STEPPERS >= 1
|
||||
static_assert(Z_RSENSE == 0.11, "Z_RSENSE (STEPPER-0) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if NUM_Z_STEPPERS >= 2
|
||||
static_assert(Z2_RSENSE == 0.11, "Z2_RSENSE (STEPPER-2) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if NUM_Z_STEPPERS >= 3
|
||||
static_assert(Z3_RSENSE == 0.11, "Z3_RSENSE (STEPPER-3) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if NUM_Z_STEPPERS >= 4
|
||||
static_assert(Z4_RSENSE == 0.11, "Z4_RSENSE (STEPPER-4) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if EXTRUDERS >= 1
|
||||
static_assert(E0_RSENSE == 0.11, "E0_RSENSE (STEPPER-1) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if EXTRUDERS >= 2
|
||||
static_assert(E1_RSENSE == 0.11, "E1_RSENSE (STEPPER-2) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if EXTRUDERS >= 3
|
||||
static_assert(E2_RSENSE == 0.11, "E2_RSENSE (STEPPER-3) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
#if EXTRUDERS >= 4
|
||||
static_assert(E3_RSENSE == 0.11, "E3_RSENSE (STEPPER-4) must be 0.11 for BOARD_LDO_LEVIATHAN_V1_2.");
|
||||
#endif
|
||||
|
||||
//
|
||||
// Trinamic Stallguard pins
|
||||
//
|
||||
#define X_DIAG_PIN PG1 // HV-STEPPER-0
|
||||
#define Y_DIAG_PIN PE10 // HV-STEPPER-1
|
||||
#define Z_DIAG_PIN PD6 // STEPPER-0
|
||||
#define E0_DIAG_PIN PD1 // STEPPER-1
|
||||
#define E1_DIAG_PIN PA15 // STEPPER-2
|
||||
#define E2_DIAG_PIN PC6 // STEPPER-3
|
||||
#define E3_DIAG_PIN PD12 // STEPPER-4
|
||||
|
||||
//
|
||||
// Limit Switches
|
||||
//
|
||||
#ifdef X_STALL_SENSITIVITY
|
||||
#define X_STOP_PIN X_DIAG_PIN
|
||||
#else
|
||||
#define X_STOP_PIN PC1 // X-ENDSTOP
|
||||
#endif
|
||||
|
||||
#ifdef Y_STALL_SENSITIVITY
|
||||
#define Y_STOP_PIN Y_DIAG_PIN
|
||||
#else
|
||||
#define Y_STOP_PIN PC2 // Y-ENDSTOP
|
||||
#endif
|
||||
|
||||
#ifdef Z_STALL_SENSITIVITY
|
||||
#define Z_STOP_PIN Z_DIAG_PIN
|
||||
#else
|
||||
#define Z_STOP_PIN PC3 // Z-ENDSTOP
|
||||
#endif
|
||||
|
||||
//
|
||||
// Z Probe (when not Z_MIN_PIN)
|
||||
//
|
||||
#ifndef Z_MIN_PROBE_PIN
|
||||
#define Z_MIN_PROBE_PIN PF1 // Z-PROBE
|
||||
#endif
|
||||
|
||||
//
|
||||
// Temperature Sensors
|
||||
//
|
||||
#define TEMP_BED_PIN PA1 // TH0
|
||||
#define TEMP_0_PIN PA2 // TH1
|
||||
#define TEMP_1_PIN PA0 // TH2
|
||||
#define TEMP_2_PIN PA3 // TH3
|
||||
|
||||
//
|
||||
// Heaters / Fans
|
||||
//
|
||||
#define HEATER_BED_PIN PG11 // HEATBED
|
||||
#define HEATER_0_PIN PG10 // HEATER
|
||||
|
||||
#define FAN0_PIN PB7 // FAN0
|
||||
#define FAN1_PIN PB3 // FAN1
|
||||
#define FAN2_PIN PF7 // FAN2
|
||||
#define FAN3_PIN PF9 // FAN3
|
||||
|
||||
#ifndef E0_FAN_TACHO_PIN
|
||||
//#define E0_FAN_TACHO_PIN PB4 // FAN1
|
||||
#endif
|
||||
|
||||
//
|
||||
// SPI pins for TMC5160 HV-STEPPER drivers
|
||||
//
|
||||
#if HAS_TMC_SPI
|
||||
#define TMC_USE_SW_SPI
|
||||
#ifndef TMC_SPI_MOSI
|
||||
#define TMC_SPI_MOSI PE14
|
||||
#endif
|
||||
#ifndef TMC_SPI_MISO
|
||||
#define TMC_SPI_MISO PE13
|
||||
#endif
|
||||
#ifndef TMC_SPI_SCK
|
||||
#define TMC_SPI_SCK PE12
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if HAS_TMC_UART
|
||||
/**
|
||||
* TMC2209 stepper drivers
|
||||
*
|
||||
* Hardware serial communication ports.
|
||||
* If undefined software serial is used according to the pins below
|
||||
*/
|
||||
|
||||
#define Z_SERIAL_TX_PIN PD5
|
||||
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
|
||||
|
||||
#define E0_SERIAL_TX_PIN PD0
|
||||
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
|
||||
|
||||
#define E1_SERIAL_TX_PIN PA8
|
||||
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
|
||||
|
||||
#define E2_SERIAL_TX_PIN PG8
|
||||
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
|
||||
|
||||
#define E3_SERIAL_TX_PIN PD11
|
||||
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
|
||||
|
||||
// Reduce baud rate to improve software serial reliability
|
||||
#ifndef TMC_BAUD_RATE
|
||||
#define TMC_BAUD_RATE 19200
|
||||
#endif
|
||||
|
||||
#endif // HAS_TMC_UART
|
||||
|
||||
/** ------ ------
|
||||
* (BEEPER) PG9 | 1 2 | PE7 (BTN_ENC) (MISO) PA6 | 1 2 | PA5 (SCK)
|
||||
* (LCD_EN) PG13 | 3 4 | PG14 (LCD_RS) (BTN_EN1) PE2 | 3 4 | PA4 (SD_SS)
|
||||
* (LCD_D4) PC13 5 6 | PC14 (LCD_D5) (BTN_EN2) PE3 5 6 | PA7 (MOSI)
|
||||
* (LCD_D6) PC15 | 7 8 | PF0 (LCD_D7) (SD_DETECT) PE5 | 7 8 | RESET
|
||||
* GND | 9 10 | 5V GND | 9 10 | PE4 (KILL)
|
||||
* ------ ------
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
#define EXP1_01_PIN PG9
|
||||
#define EXP1_02_PIN PG12
|
||||
#define EXP1_03_PIN PG13
|
||||
#define EXP1_04_PIN PG14
|
||||
#define EXP1_05_PIN PC13
|
||||
#define EXP1_06_PIN PC14
|
||||
#define EXP1_07_PIN PC15
|
||||
#define EXP1_08_PIN PF0
|
||||
|
||||
#define EXP2_01_PIN PA6
|
||||
#define EXP2_02_PIN PA5
|
||||
#define EXP2_03_PIN PE2
|
||||
#define EXP2_04_PIN PA4
|
||||
#define EXP2_05_PIN PE3
|
||||
#define EXP2_06_PIN PA7
|
||||
#define EXP2_07_PIN PE5
|
||||
#define EXP2_08_PIN -1
|
||||
#define EXP2_10_PIN PE4
|
||||
|
||||
//
|
||||
// SD Support
|
||||
//
|
||||
#if !defined(SDCARD_CONNECTION) && DISABLED(NO_LCD_SDCARD)
|
||||
#define SDCARD_CONNECTION LCD
|
||||
#endif
|
||||
|
||||
#if SD_CONNECTION_IS(LCD)
|
||||
|
||||
#define SDSS EXP2_04_PIN
|
||||
#define SD_SS_PIN SDSS
|
||||
#define SD_SCK_PIN EXP2_02_PIN
|
||||
#define SD_MISO_PIN EXP2_01_PIN
|
||||
#define SD_MOSI_PIN EXP2_06_PIN
|
||||
#define SD_DETECT_PIN EXP2_07_PIN
|
||||
#elif SD_CONNECTION_IS(ONBOARD)
|
||||
#error "ONBOARD is not a supported SDCARD_CONNECTION for BOARD_LDO_LEVIATHAN_V1_2."
|
||||
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
|
||||
#error "CUSTOM_CABLE is not a supported SDCARD_CONNECTION for BOARD_LDO_LEVIATHAN_V1_2."
|
||||
#endif
|
||||
|
||||
//
|
||||
// LCDs and Controllers
|
||||
//
|
||||
#if HAS_WIRED_LCD
|
||||
|
||||
#define BEEPER_PIN EXP1_01_PIN
|
||||
#define BTN_ENC EXP1_02_PIN
|
||||
|
||||
#if ENABLED(CR10_STOCKDISPLAY)
|
||||
|
||||
#define LCD_PINS_RS EXP1_07_PIN
|
||||
|
||||
#define BTN_EN1 EXP1_03_PIN
|
||||
#define BTN_EN2 EXP1_05_PIN
|
||||
|
||||
#define LCD_PINS_EN EXP1_08_PIN
|
||||
#define LCD_PINS_D4 EXP1_06_PIN
|
||||
|
||||
#else
|
||||
|
||||
#define LCD_PINS_RS EXP1_04_PIN
|
||||
|
||||
#define BTN_EN1 EXP2_03_PIN
|
||||
#define BTN_EN2 EXP2_05_PIN
|
||||
|
||||
#define LCD_PINS_EN EXP1_03_PIN
|
||||
#define LCD_PINS_D4 EXP1_05_PIN
|
||||
|
||||
#if ENABLED(FYSETC_MINI_12864)
|
||||
#define DOGLCD_CS EXP1_03_PIN
|
||||
#define DOGLCD_A0 EXP1_04_PIN
|
||||
//#define LCD_BACKLIGHT_PIN -1
|
||||
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
|
||||
#if ANY(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
|
||||
#ifndef RGB_LED_R_PIN
|
||||
#define RGB_LED_R_PIN EXP1_06_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_G_PIN
|
||||
#define RGB_LED_G_PIN EXP1_07_PIN
|
||||
#endif
|
||||
#ifndef RGB_LED_B_PIN
|
||||
#define RGB_LED_B_PIN EXP1_08_PIN
|
||||
#endif
|
||||
#elif ENABLED(FYSETC_MINI_12864_2_1)
|
||||
#define NEOPIXEL_PIN EXP1_06_PIN
|
||||
#endif
|
||||
#endif // !FYSETC_MINI_12864
|
||||
|
||||
#if IS_ULTIPANEL
|
||||
#define LCD_PINS_D5 EXP1_06_PIN
|
||||
#define LCD_PINS_D6 EXP1_07_PIN
|
||||
#define LCD_PINS_D7 EXP1_08_PIN
|
||||
|
||||
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
|
||||
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif // HAS_WIRED_LCD
|
||||
|
||||
// Alter timing for graphical display
|
||||
#if IS_U8GLIB_ST7920
|
||||
#define BOARD_ST7920_DELAY_1 120
|
||||
#define BOARD_ST7920_DELAY_2 80
|
||||
#define BOARD_ST7920_DELAY_3 580
|
||||
#endif
|
||||
|
||||
#if HAS_SPI_TFT // Config for Classic UI (emulated DOGM) and Color UI
|
||||
|
||||
#define TFT_SCK_PIN EXP2_02_PIN
|
||||
#define TFT_MISO_PIN EXP2_01_PIN
|
||||
#define TFT_MOSI_PIN EXP2_06_PIN
|
||||
|
||||
#define BTN_EN1 EXP2_03_PIN
|
||||
#define BTN_EN2 EXP2_05_PIN
|
||||
|
||||
#ifndef TFT_WIDTH
|
||||
#define TFT_WIDTH 480
|
||||
#endif
|
||||
#ifndef TFT_HEIGHT
|
||||
#define TFT_HEIGHT 320
|
||||
#endif
|
||||
|
||||
#if ENABLED(BTT_TFT35_SPI_V1_0)
|
||||
|
||||
/**
|
||||
* ------ ------
|
||||
* BEEPER | 1 2 | LCD-BTN MISO | 1 2 | CLK
|
||||
* T_MOSI | 3 4 | T_CS LCD-ENCA | 3 4 | TFTCS
|
||||
* T_CLK | 5 6 T_MISO LCD-ENCB | 5 6 MOSI
|
||||
* PENIRQ | 7 8 | F_CS RS | 7 8 | RESET
|
||||
* GND | 9 10 | VCC GND | 9 10 | NC
|
||||
* ------ ------
|
||||
* EXP1 EXP2
|
||||
*
|
||||
* 480x320, 3.5", SPI Display with Rotary Encoder.
|
||||
* Stock Display for the BIQU B1 SE Series.
|
||||
* Schematic: https://github.com/bigtreetech/TFT35-SPI/blob/master/v1/Hardware/BTT%20TFT35-SPI%20V1-SCH.pdf
|
||||
*/
|
||||
#define TFT_CS_PIN EXP2_04_PIN
|
||||
#define TFT_DC_PIN EXP2_07_PIN
|
||||
#define TFT_A0_PIN TFT_DC_PIN
|
||||
|
||||
#define TOUCH_CS_PIN EXP1_04_PIN
|
||||
#define TOUCH_SCK_PIN EXP1_05_PIN
|
||||
#define TOUCH_MISO_PIN EXP1_06_PIN
|
||||
#define TOUCH_MOSI_PIN EXP1_03_PIN
|
||||
#define TOUCH_INT_PIN EXP1_07_PIN
|
||||
|
||||
#ifndef TOUCH_CALIBRATION_X
|
||||
#define TOUCH_CALIBRATION_X 17540
|
||||
#endif
|
||||
#ifndef TOUCH_CALIBRATION_Y
|
||||
#define TOUCH_CALIBRATION_Y -11388
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_X
|
||||
#define TOUCH_OFFSET_X -21
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_Y
|
||||
#define TOUCH_OFFSET_Y 337
|
||||
#endif
|
||||
#ifndef TOUCH_ORIENTATION
|
||||
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
|
||||
#endif
|
||||
|
||||
#elif ENABLED(MKS_TS35_V2_0)
|
||||
|
||||
/** ------ ------
|
||||
* BEEPER | 1 2 | BTN_ENC SPI1_MISO | 1 2 | SPI1_SCK
|
||||
* TFT_BKL / LCD_EN | 3 4 | TFT_RESET / LCD_RS BTN_EN1 | 3 4 | SPI1_CS
|
||||
* TOUCH_CS / LCD_D4 | 5 6 TOUCH_INT / LCD_D5 BTN_EN2 | 5 6 SPI1_MOSI
|
||||
* SPI1_CS / LCD_D6 | 7 8 | SPI1_RS / LCD_D7 SPI1_RS | 7 8 | RESET
|
||||
* GND | 9 10 | VCC GND | 9 10 | VCC
|
||||
* ------ ------
|
||||
* EXP1 EXP2
|
||||
*/
|
||||
#define TFT_CS_PIN EXP1_07_PIN // SPI1_CS
|
||||
#define TFT_DC_PIN EXP1_08_PIN // SPI1_RS
|
||||
#define TFT_A0_PIN TFT_DC_PIN
|
||||
|
||||
#define TFT_RESET_PIN EXP1_04_PIN
|
||||
|
||||
#define LCD_BACKLIGHT_PIN EXP1_03_PIN
|
||||
#define TFT_BACKLIGHT_PIN LCD_BACKLIGHT_PIN
|
||||
|
||||
#define TOUCH_BUTTONS_HW_SPI
|
||||
#define TOUCH_BUTTONS_HW_SPI_DEVICE 1
|
||||
|
||||
#define TOUCH_CS_PIN EXP1_05_PIN // SPI1_NSS
|
||||
#define TOUCH_SCK_PIN EXP2_02_PIN // SPI1_SCK
|
||||
#define TOUCH_MISO_PIN EXP2_01_PIN // SPI1_MISO
|
||||
#define TOUCH_MOSI_PIN EXP2_06_PIN // SPI1_MOSI
|
||||
|
||||
#define LCD_READ_ID 0xD3
|
||||
#define LCD_USE_DMA_SPI
|
||||
|
||||
#define TFT_BUFFER_WORDS 14400
|
||||
|
||||
#ifndef TOUCH_CALIBRATION_X
|
||||
#define TOUCH_CALIBRATION_X -17253
|
||||
#endif
|
||||
#ifndef TOUCH_CALIBRATION_Y
|
||||
#define TOUCH_CALIBRATION_Y 11579
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_X
|
||||
#define TOUCH_OFFSET_X 514
|
||||
#endif
|
||||
#ifndef TOUCH_OFFSET_Y
|
||||
#define TOUCH_OFFSET_Y -24
|
||||
#endif
|
||||
#ifndef TOUCH_ORIENTATION
|
||||
#define TOUCH_ORIENTATION TOUCH_LANDSCAPE
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// NeoPixel LED
|
||||
// The FYSETC_MINI_12864_2_1 uses one of the EXP pins
|
||||
//
|
||||
#if DISABLED(FYSETC_MINI_12864_2_1) && !defined(NEOPIXEL_PIN)
|
||||
#define NEOPIXEL_PIN PF10 // NEOPIXEL
|
||||
#endif
|
@ -0,0 +1,34 @@
|
||||
{
|
||||
"build": {
|
||||
"cpu": "cortex-m4",
|
||||
"extra_flags": "-DSTM32F446xx",
|
||||
"f_cpu": "180000000L",
|
||||
"mcu": "stm32f446zet6",
|
||||
"variant": "MARLIN_LDO_LEVIATHAN_V1_2"
|
||||
},
|
||||
"connectivity": [
|
||||
"can"
|
||||
],
|
||||
"debug": {
|
||||
"jlink_device": "STM32F446ZE",
|
||||
"openocd_target": "stm32f4x",
|
||||
"svd_path": "STM32F446x.svd"
|
||||
},
|
||||
"frameworks": [
|
||||
"arduino",
|
||||
"stm32cube"
|
||||
],
|
||||
"name": "STM32F446ZE (128k RAM. 512k Flash)",
|
||||
"upload": {
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 524288,
|
||||
"protocol": "stlink",
|
||||
"protocols": [
|
||||
"stlink",
|
||||
"dfu",
|
||||
"jlink"
|
||||
]
|
||||
},
|
||||
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f446ze.html",
|
||||
"vendor": "ST"
|
||||
}
|
@ -0,0 +1,385 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2016, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "Arduino.h"
|
||||
#include "PeripheralPins.h"
|
||||
|
||||
// =====
|
||||
// Note: Commented lines are alternative possibilities which are not used per default.
|
||||
// If you change them, you will have to know what you do
|
||||
// =====
|
||||
|
||||
|
||||
//*** ADC ***
|
||||
|
||||
#ifdef HAL_ADC_MODULE_ENABLED
|
||||
const PinMap PinMap_ADC[] = {
|
||||
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0 TH2
|
||||
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 TH0
|
||||
{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 TH1
|
||||
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 TH3
|
||||
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 Extension Port 13
|
||||
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 Extension Port 14
|
||||
{PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14 Extension Port 11
|
||||
{PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 Extension Port 12
|
||||
|
||||
// {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0
|
||||
// {PA_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC3_IN0
|
||||
// {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1
|
||||
// {PA_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC3_IN1
|
||||
// {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2
|
||||
// {PA_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC3_IN2
|
||||
// {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3
|
||||
// {PA_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC3_IN3
|
||||
// {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
|
||||
// {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4
|
||||
// {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
|
||||
// {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5
|
||||
// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
|
||||
// {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6
|
||||
// {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
|
||||
// {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7
|
||||
// {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8
|
||||
// {PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9
|
||||
// {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
|
||||
// {PC_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10
|
||||
// {PC_0, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC3_IN10
|
||||
// {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11
|
||||
// {PC_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11
|
||||
// {PC_1, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC3_IN11
|
||||
// {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12
|
||||
// {PC_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12
|
||||
// {PC_2, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC3_IN12
|
||||
// {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
|
||||
// {PC_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13
|
||||
// {PC_3, ADC3, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC3_IN13
|
||||
// {PC_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC2_IN14
|
||||
// {PC_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** DAC ***
|
||||
|
||||
#ifdef HAL_DAC_MODULE_ENABLED
|
||||
const PinMap PinMap_DAC[] = {
|
||||
// {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
|
||||
// {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - LD2
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** I2C ***
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
const PinMap PinMap_I2C_SDA[] = {
|
||||
// {PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
|
||||
// {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
|
||||
// {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
|
||||
// {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
|
||||
// {PC_7, FMPI2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_FMPI2C1)},
|
||||
// {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
|
||||
// {PC_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_I2C_MODULE_ENABLED
|
||||
const PinMap PinMap_I2C_SCL[] = {
|
||||
// {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
|
||||
// {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
|
||||
// {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
|
||||
// {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
|
||||
// {PC_6, FMPI2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_FMPI2C1)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** PWM ***
|
||||
|
||||
#ifdef HAL_TIM_MODULE_ENABLED
|
||||
const PinMap PinMap_PWM[] = {
|
||||
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 FAN1
|
||||
{PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 FAN0
|
||||
{PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 LED-Strip
|
||||
{PF_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 FAN2
|
||||
{PF_9, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1 FAN3
|
||||
|
||||
// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
|
||||
// {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1
|
||||
// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
|
||||
// {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
|
||||
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - STLink Tx
|
||||
// {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 - STLink Tx
|
||||
// {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - STLink Tx
|
||||
// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - STLink Rx
|
||||
// {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 - STLink Rx
|
||||
// {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - STLink Rx
|
||||
// {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
|
||||
// {PA_5, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
|
||||
// {PA_6, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
|
||||
// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
|
||||
// {PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM14, 1, 0)}, // TIM14_CH1
|
||||
// {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
|
||||
// {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
|
||||
// {PA_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N
|
||||
// {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
|
||||
// {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
|
||||
// {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
|
||||
// {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
|
||||
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
|
||||
// {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
|
||||
// {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
|
||||
// {PB_0, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
|
||||
// {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
|
||||
// {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
|
||||
// {PB_1, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
|
||||
// {PB_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
|
||||
// {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
|
||||
// {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
|
||||
// {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
|
||||
// {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
|
||||
// {PB_8, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
|
||||
// {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
|
||||
// {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
|
||||
// {PB_9, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
|
||||
// {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
|
||||
// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
|
||||
// {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
|
||||
// {PB_14, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 1, 0)}, // TIM12_CH1
|
||||
// {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
|
||||
// {PB_14, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N
|
||||
// {PB_15, TIM12, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM12, 2, 0)}, // TIM12_CH2
|
||||
// {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
|
||||
// {PB_15, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 1)}, // TIM8_CH3N
|
||||
// {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
|
||||
// {PC_6, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 0)}, // TIM8_CH1
|
||||
// {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
|
||||
// {PC_7, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 0)}, // TIM8_CH2
|
||||
// {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
|
||||
// {PC_8, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 3, 0)}, // TIM8_CH3
|
||||
// {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
|
||||
// {PC_9, TIM8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 4, 0)}, // TIM8_CH4
|
||||
// {PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
|
||||
// {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
|
||||
// {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
|
||||
// {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
|
||||
// {PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
|
||||
// {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
|
||||
// {PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
|
||||
// {PF_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
|
||||
// {PF_8, TIM13, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_TIM13, 1, 0)}, // TIM13_CH1
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** SERIAL ***
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
const PinMap PinMap_UART_TX[] = {
|
||||
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
{PE_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, // Extension Port
|
||||
|
||||
// {PA_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
|
||||
// {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
// {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
|
||||
// {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
const PinMap PinMap_UART_RX[] = {
|
||||
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
{PE_7, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, // Extension Port
|
||||
|
||||
// {PA_1, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
|
||||
// {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
// {PC_5, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
|
||||
// {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
const PinMap PinMap_UART_RTS[] = {
|
||||
// {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
|
||||
// {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
// {PA_15, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PC_8, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_UART_MODULE_ENABLED
|
||||
const PinMap PinMap_UART_CTS[] = {
|
||||
// {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
|
||||
// {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
|
||||
// {PB_0, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)},
|
||||
// {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
|
||||
// {PC_9, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_UART5)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** SPI ***
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
const PinMap PinMap_SPI_MOSI[] = {
|
||||
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // EXP1
|
||||
{PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // TMC5160
|
||||
{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // Extension Port
|
||||
|
||||
// {PB_0, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
|
||||
// {PB_2, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI3)},
|
||||
// {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
|
||||
// {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
// {PC_1, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
|
||||
// {PC_1, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI3)},
|
||||
// {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
// {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
const PinMap PinMap_SPI_MISO[] = {
|
||||
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // EXP1
|
||||
{PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // TMC5160
|
||||
{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // Extension Port
|
||||
|
||||
// {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
|
||||
// {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
// {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
// {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
const PinMap PinMap_SPI_SCLK[] = {
|
||||
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // EXP1
|
||||
{PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // TMC5160
|
||||
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // Extension Port
|
||||
|
||||
// {PA_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
// {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
|
||||
// {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
// {PC_7, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
// {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_SPI_MODULE_ENABLED
|
||||
const PinMap PinMap_SPI_SSEL[] = {
|
||||
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // EXP1
|
||||
{PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)}, // TMC5160
|
||||
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // Extension Port
|
||||
|
||||
// {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
// {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
|
||||
// {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
|
||||
// {PB_4, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_SPI2)},
|
||||
// {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** CAN ***
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
const PinMap PinMap_CAN_RD[] = {
|
||||
{PB_5, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, // CAN-Port
|
||||
{PB_12, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, // Extension Port
|
||||
|
||||
// {PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
|
||||
// {PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_CAN_MODULE_ENABLED
|
||||
const PinMap PinMap_CAN_TD[] = {
|
||||
{PB_6, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, // CAN-Port
|
||||
{PB_13, CAN2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN2)}, // Extension Port
|
||||
|
||||
// {PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
|
||||
// {PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)},
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** ETHERNET ***
|
||||
|
||||
//*** No Ethernet ***
|
||||
|
||||
//*** QUADSPI ***
|
||||
|
||||
#ifdef HAL_QSPI_MODULE_ENABLED
|
||||
const PinMap PinMap_QUADSPI[] = {
|
||||
// {PA_1, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO3
|
||||
// {PB_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_CLK
|
||||
// {PB_6, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QSPI)}, // QUADSPI_BK1_NCS
|
||||
// {PC_9, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO0
|
||||
// {PC_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK1_IO1
|
||||
// {PC_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF9_QSPI)}, // QUADSPI_BK2_NCS
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
//*** USB ***
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
const PinMap PinMap_USB_OTG_FS[] = {
|
||||
{PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
|
||||
{PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
|
||||
|
||||
// {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
|
||||
// {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)}, // USB_OTG_FS_VBUS
|
||||
// {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef HAL_PCD_MODULE_ENABLED
|
||||
const PinMap PinMap_USB_OTG_HS[] = {
|
||||
{NC, NP, 0}
|
||||
};
|
||||
#endif
|
@ -0,0 +1,25 @@
|
||||
/* SYS_WKUP */
|
||||
#ifdef PWR_WAKEUP_PIN1
|
||||
SYS_WKUP1 = PA_0,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN2
|
||||
SYS_WKUP2 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN3
|
||||
SYS_WKUP3 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN4
|
||||
SYS_WKUP4 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN5
|
||||
SYS_WKUP5 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN6
|
||||
SYS_WKUP6 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN7
|
||||
SYS_WKUP7 = NC,
|
||||
#endif
|
||||
#ifdef PWR_WAKEUP_PIN8
|
||||
SYS_WKUP8 = NC,
|
||||
#endif
|
@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#define HAL_MODULE_ENABLED
|
||||
#define HAL_ADC_MODULE_ENABLED
|
||||
#define HAL_CRC_MODULE_ENABLED
|
||||
#define HAL_DMA_MODULE_ENABLED
|
||||
#define HAL_EXTI_MODULE_ENABLED // Needed for Endstop (and other external) Interrupts
|
||||
#define HAL_GPIO_MODULE_ENABLED
|
||||
#define HAL_I2C_MODULE_ENABLED
|
||||
#define HAL_PWR_MODULE_ENABLED
|
||||
#define HAL_RCC_MODULE_ENABLED
|
||||
//#define HAL_RTC_MODULE_ENABLED // Real Time Clock...do we use it?
|
||||
#define HAL_SPI_MODULE_ENABLED
|
||||
#define HAL_TIM_MODULE_ENABLED
|
||||
#define HAL_USART_MODULE_ENABLED
|
||||
#define HAL_CORTEX_MODULE_ENABLED
|
||||
//#define HAL_UART_MODULE_ENABLED // by default
|
||||
//#define HAL_PCD_MODULE_ENABLED // Since STM32 v3.10700.191028 this is automatically added if any type of USB is enabled (as in Arduino IDE)
|
||||
#define HAL_SD_MODULE_ENABLED
|
||||
|
||||
//#undef HAL_SD_MODULE_ENABLED
|
||||
#undef HAL_DAC_MODULE_ENABLED
|
||||
#undef HAL_FLASH_MODULE_ENABLED
|
||||
#undef HAL_CAN_MODULE_ENABLED
|
||||
#undef HAL_CAN_LEGACY_MODULE_ENABLED
|
||||
#undef HAL_CEC_MODULE_ENABLED
|
||||
#undef HAL_CRYP_MODULE_ENABLED
|
||||
#undef HAL_DCMI_MODULE_ENABLED
|
||||
#undef HAL_DMA2D_MODULE_ENABLED
|
||||
#undef HAL_ETH_MODULE_ENABLED
|
||||
#undef HAL_NAND_MODULE_ENABLED
|
||||
#undef HAL_NOR_MODULE_ENABLED
|
||||
#undef HAL_PCCARD_MODULE_ENABLED
|
||||
#undef HAL_SRAM_MODULE_ENABLED
|
||||
#undef HAL_SDRAM_MODULE_ENABLED
|
||||
#undef HAL_HASH_MODULE_ENABLED
|
||||
#undef HAL_SMBUS_MODULE_ENABLED
|
||||
#undef HAL_I2S_MODULE_ENABLED
|
||||
#undef HAL_IWDG_MODULE_ENABLED
|
||||
#undef HAL_LTDC_MODULE_ENABLED
|
||||
#undef HAL_DSI_MODULE_ENABLED
|
||||
#undef HAL_QSPI_MODULE_ENABLED
|
||||
#undef HAL_RNG_MODULE_ENABLED
|
||||
#undef HAL_SAI_MODULE_ENABLED
|
||||
#undef HAL_IRDA_MODULE_ENABLED
|
||||
#undef HAL_SMARTCARD_MODULE_ENABLED
|
||||
#undef HAL_WWDG_MODULE_ENABLED
|
||||
//#undef HAL_HCD_MODULE_ENABLED
|
||||
#undef HAL_FMPI2C_MODULE_ENABLED
|
||||
#undef HAL_SPDIFRX_MODULE_ENABLED
|
||||
#undef HAL_DFSDM_MODULE_ENABLED
|
||||
#undef HAL_LPTIM_MODULE_ENABLED
|
||||
#undef HAL_MMC_MODULE_ENABLED
|
@ -0,0 +1,197 @@
|
||||
/*
|
||||
*****************************************************************************
|
||||
**
|
||||
|
||||
** File : LinkerScript.ld
|
||||
**
|
||||
** Abstract : Linker script for STM32F446ZE Device with
|
||||
** 512KByte FLASH, 128KByte RAM
|
||||
**
|
||||
** Set heap size, stack size and stack location according
|
||||
** to application requirements.
|
||||
**
|
||||
** Set memory bank area and size if external memory is used.
|
||||
**
|
||||
** Target : STMicroelectronics STM32
|
||||
**
|
||||
**
|
||||
** Distribution: The file is distributed as is, without any warranty
|
||||
** of any kind.
|
||||
**
|
||||
*****************************************************************************
|
||||
** @attention
|
||||
**
|
||||
** Copyright (c) 2014 Ac6
|
||||
**
|
||||
** Redistribution and use in source and binary forms, with or without modification,
|
||||
** are permitted provided that the following conditions are met:
|
||||
** 1. Redistributions of source code must retain the above copyright notice,
|
||||
** this list of conditions and the following disclaimer.
|
||||
** 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
** this list of conditions and the following disclaimer in the documentation
|
||||
** and/or other materials provided with the distribution.
|
||||
** 3. Neither the name of Ac6 nor the names of its contributors
|
||||
** may be used to endorse or promote products derived from this software
|
||||
** without specific prior written permission.
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
**
|
||||
*****************************************************************************
|
||||
*/
|
||||
|
||||
/* Entry Point */
|
||||
ENTRY(Reset_Handler)
|
||||
|
||||
/* Highest address of the user mode stack */
|
||||
_estack = 0x2001FFFF; /* end of RAM */
|
||||
/* Generate a link error if heap and stack don't fit into RAM */
|
||||
_Min_Heap_Size = 0x200;; /* required amount of heap */
|
||||
_Min_Stack_Size = 0x400;; /* required amount of stack */
|
||||
|
||||
/* Specify the memory areas */
|
||||
MEMORY
|
||||
{
|
||||
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
|
||||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||
QSPI (xrw) : ORIGIN = 0x90000000, LENGTH = 1024K
|
||||
}
|
||||
|
||||
/* Define output sections */
|
||||
SECTIONS
|
||||
{
|
||||
/* The startup code goes first into FLASH */
|
||||
.isr_vector :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
KEEP(*(.isr_vector)) /* Startup code */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
/* The program code and other data goes into FLASH */
|
||||
.text :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.text) /* .text sections (code) */
|
||||
*(.text*) /* .text* sections (code) */
|
||||
*(.glue_7) /* glue arm to thumb code */
|
||||
*(.glue_7t) /* glue thumb to arm code */
|
||||
*(.eh_frame)
|
||||
|
||||
KEEP (*(.init))
|
||||
KEEP (*(.fini))
|
||||
|
||||
. = ALIGN(4);
|
||||
_etext = .; /* define a global symbols at end of code */
|
||||
} >FLASH
|
||||
|
||||
/* Constant data goes into FLASH */
|
||||
.rodata :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||
. = ALIGN(4);
|
||||
} >FLASH
|
||||
|
||||
_qspi_init_base = LOADADDR(.qspi);
|
||||
_qspi_init_length = SIZEOF(.qspi);
|
||||
|
||||
.qspi :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_qspi_start = .; /* create a global symbol at qspi start */
|
||||
*(.qspi) /* .qspi sections */
|
||||
*(.qspi*) /* .qspi* sections */
|
||||
. = ALIGN(4);
|
||||
_qspi_end = .; /* define a global symbols at end of qspi */
|
||||
|
||||
} >QSPI AT> FLASH
|
||||
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
|
||||
.ARM : {
|
||||
__exidx_start = .;
|
||||
*(.ARM.exidx*)
|
||||
__exidx_end = .;
|
||||
} >FLASH
|
||||
|
||||
.preinit_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||
KEEP (*(.preinit_array*))
|
||||
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||
} >FLASH
|
||||
.init_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__init_array_start = .);
|
||||
KEEP (*(SORT(.init_array.*)))
|
||||
KEEP (*(.init_array*))
|
||||
PROVIDE_HIDDEN (__init_array_end = .);
|
||||
} >FLASH
|
||||
.fini_array :
|
||||
{
|
||||
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||
KEEP (*(SORT(.fini_array.*)))
|
||||
KEEP (*(.fini_array*))
|
||||
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||
} >FLASH
|
||||
|
||||
/* used by the startup to initialize data */
|
||||
_sidata = LOADADDR(.data);
|
||||
|
||||
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||
.data :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_sdata = .; /* create a global symbol at data start */
|
||||
*(.data) /* .data sections */
|
||||
*(.data*) /* .data* sections */
|
||||
|
||||
. = ALIGN(4);
|
||||
_edata = .; /* define a global symbol at data end */
|
||||
} >RAM AT> FLASH
|
||||
|
||||
/* Uninitialized data section */
|
||||
. = ALIGN(4);
|
||||
.bss :
|
||||
{
|
||||
/* This is used by the startup in order to initialize the .bss secion */
|
||||
_sbss = .; /* define a global symbol at bss start */
|
||||
__bss_start__ = _sbss;
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
|
||||
. = ALIGN(4);
|
||||
_ebss = .; /* define a global symbol at bss end */
|
||||
__bss_end__ = _ebss;
|
||||
} >RAM
|
||||
|
||||
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||
._user_heap_stack :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
PROVIDE ( end = . );
|
||||
PROVIDE ( _end = . );
|
||||
. = . + _Min_Heap_Size;
|
||||
. = . + _Min_Stack_Size;
|
||||
. = ALIGN(4);
|
||||
} >RAM
|
||||
|
||||
/* Remove information from the standard libraries */
|
||||
/DISCARD/ :
|
||||
{
|
||||
libc.a ( * )
|
||||
libm.a ( * )
|
||||
libgcc.a ( * )
|
||||
}
|
||||
|
||||
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||
}
|
@ -0,0 +1,246 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "pins_arduino.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Pin number
|
||||
const PinName digitalPin[] = {
|
||||
PA_0, //D0
|
||||
PA_1, //D1
|
||||
PA_2, //D2
|
||||
PA_3, //D3
|
||||
PA_4, //D4
|
||||
PA_5, //D5
|
||||
PA_6, //D6
|
||||
PA_7, //D7
|
||||
PA_8, //D8
|
||||
PA_9, //D9
|
||||
PA_10, //D10
|
||||
PA_11, //D11
|
||||
PA_12, //D12
|
||||
PA_13, //D13
|
||||
PA_14, //D14
|
||||
PA_15, //D15
|
||||
PB_0, //D16
|
||||
PB_1, //D17
|
||||
PB_2, //D18
|
||||
PB_3, //D19
|
||||
PB_4, //D20
|
||||
PB_5, //D21
|
||||
PB_6, //D22
|
||||
PB_7, //D23
|
||||
PB_8, //D24
|
||||
PB_9, //D25
|
||||
PB_10, //D26
|
||||
PB_11, //D27
|
||||
PB_12, //D28
|
||||
PB_13, //D29
|
||||
PB_14, //D30
|
||||
PB_15, //D31
|
||||
PC_0, //D32
|
||||
PC_1, //D33
|
||||
PC_2, //D34
|
||||
PC_3, //D35
|
||||
PC_4, //D36
|
||||
PC_5, //D37
|
||||
PC_6, //D38
|
||||
PC_7, //D39
|
||||
PC_8, //D40
|
||||
PC_9, //D41
|
||||
PC_10, //D42
|
||||
PC_11, //D43
|
||||
PC_12, //D44
|
||||
PC_13, //D45
|
||||
PC_14, //D46
|
||||
PC_15, //D47
|
||||
PD_0, //D48
|
||||
PD_1, //D49
|
||||
PD_2, //D50
|
||||
PD_3, //D51
|
||||
PD_4, //D52
|
||||
PD_5, //D53
|
||||
PD_6, //D54
|
||||
PD_7, //D55
|
||||
PD_8, //D56
|
||||
PD_9, //D57
|
||||
PD_10, //D58
|
||||
PD_11, //D59
|
||||
PD_12, //D60
|
||||
PD_13, //D61
|
||||
PD_14, //D62
|
||||
PD_15, //D63
|
||||
PE_0, //D64
|
||||
PE_1, //D65
|
||||
PE_2, //D66
|
||||
PE_3, //D67
|
||||
PE_4, //D68
|
||||
PE_5, //D69
|
||||
PE_6, //D70
|
||||
PE_7, //D71
|
||||
PE_8, //D72
|
||||
PE_9, //D73
|
||||
PE_10, //D74
|
||||
PE_11, //D75
|
||||
PE_12, //D76
|
||||
PE_13, //D77
|
||||
PE_14, //D78
|
||||
PE_15, //D79
|
||||
PF_0, //D80
|
||||
PF_1, //D81
|
||||
PF_2, //D82
|
||||
PF_3, //D83
|
||||
PF_4, //D84
|
||||
PF_5, //D85
|
||||
PF_6, //D86
|
||||
PF_7, //D87
|
||||
PF_8, //D88
|
||||
PF_9, //D89
|
||||
PF_10, //D90
|
||||
PF_11, //D91
|
||||
PF_12, //D92
|
||||
PF_13, //D93
|
||||
PF_14, //D94
|
||||
PF_15, //D95
|
||||
PG_0, //D96
|
||||
PG_1, //D97
|
||||
PG_2, //D98
|
||||
PG_3, //D99
|
||||
PG_4, //D100
|
||||
PG_5, //D101
|
||||
PG_6, //D102
|
||||
PG_7, //D103
|
||||
PG_8, //D104
|
||||
PG_9, //D105
|
||||
PG_10, //D106
|
||||
PG_11, //D107
|
||||
PG_12, //D108
|
||||
PG_13, //D109
|
||||
PG_14, //D110
|
||||
PG_15, //D111
|
||||
|
||||
//Duplicated ADC Pins
|
||||
PA_0, //D112/A0
|
||||
PA_1, //D113/A1
|
||||
PA_2, //D114/A2
|
||||
PA_3, //D115/A3
|
||||
PB_0, //D116/A4
|
||||
PB_1, //D117/A5
|
||||
PC_4, //D119/A6
|
||||
PC_5, //D120/A7
|
||||
};
|
||||
|
||||
// Analog (Ax) pin number array
|
||||
const uint32_t analogInputPin[] = {
|
||||
0, // A0, PA0
|
||||
1, // A1, PA1
|
||||
2, // A2, PA2
|
||||
3, // A3, PA3
|
||||
16, // A4, PB0
|
||||
17, // A5, PB1
|
||||
36, // A6, PC4
|
||||
37, // A7, PC5
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief System Clock Configuration
|
||||
* The system Clock is configured as follow :
|
||||
* System Clock source = PLL (HSE)
|
||||
* SYSCLK(Hz) = 180000000
|
||||
* HCLK(Hz) = 180000000
|
||||
* AHB Prescaler = 1
|
||||
* APB1 Prescaler = 4
|
||||
* APB2 Prescaler = 2
|
||||
* HSE Frequency(Hz) = 12000000
|
||||
* PLL_M = 6
|
||||
* PLL_N = 180
|
||||
* PLL_P = 2
|
||||
* PLL_Q = 7
|
||||
* VDD(V) = 3.3
|
||||
* Main regulator output voltage = Scale1 mode
|
||||
* Flash Latency(WS) = 5
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
WEAK void SystemClock_Config(void)
|
||||
{
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;
|
||||
|
||||
|
||||
/* Enable Power Control clock */
|
||||
__HAL_RCC_PWR_CLK_ENABLE();
|
||||
|
||||
#ifdef HAL_PWR_MODULE_ENABLED
|
||||
/* The voltage scaling allows optimizing the power consumption when the device is
|
||||
clocked below the maximum system frequency, to update the voltage scaling value
|
||||
regarding system frequency refer to product datasheet. */
|
||||
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
|
||||
#endif
|
||||
|
||||
/* Enable HSE Oscillator and activate PLL with HSE as source */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
|
||||
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
|
||||
RCC_OscInitStruct.PLL.PLLM = 6;
|
||||
RCC_OscInitStruct.PLL.PLLN = 180;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = 7;
|
||||
RCC_OscInitStruct.PLL.PLLR = 2;
|
||||
HAL_RCC_OscConfig(&RCC_OscInitStruct);
|
||||
|
||||
HAL_PWREx_EnableOverDrive();
|
||||
|
||||
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
|
||||
clocks dividers */
|
||||
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK |
|
||||
RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);
|
||||
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLRCLK;
|
||||
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
|
||||
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
|
||||
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
|
||||
HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5);
|
||||
|
||||
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_CLK48;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIM = 6;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIN = 96;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIQ = 2;
|
||||
PeriphClkInitStruct.PLLSAI.PLLSAIP = RCC_PLLSAIP_DIV4;
|
||||
PeriphClkInitStruct.PLLSAIDivQ = 1;
|
||||
PeriphClkInitStruct.Clk48ClockSelection = RCC_CLK48CLKSOURCE_PLLSAIP;
|
||||
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@ -0,0 +1,216 @@
|
||||
/*
|
||||
Copyright (c) 2011 Arduino. All right reserved.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
See the GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _VARIANT_ARDUINO_STM32_
|
||||
#define _VARIANT_ARDUINO_STM32_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // __cplusplus
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Pins
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#define PA0 0 //D0
|
||||
#define PA1 1 //D1
|
||||
#define PA2 2 //D2
|
||||
#define PA3 3 //D3
|
||||
#define PA4 4 //D4
|
||||
#define PA5 5 //D5
|
||||
#define PA6 6 //D6
|
||||
#define PA7 7 //D7
|
||||
#define PA8 8 //D8
|
||||
#define PA9 9 //D9
|
||||
#define PA10 10 //D10
|
||||
#define PA11 11 //D11
|
||||
#define PA12 12 //D12
|
||||
#define PA13 13 //D13
|
||||
#define PA14 14 //D14
|
||||
#define PA15 15 //D15
|
||||
#define PB0 16 //D16
|
||||
#define PB1 17 //D17
|
||||
#define PB2 18 //D18
|
||||
#define PB3 19 //D19
|
||||
#define PB4 20 //D20
|
||||
#define PB5 21 //D21
|
||||
#define PB6 22 //D22
|
||||
#define PB7 23 //D23
|
||||
#define PB8 24 //D24
|
||||
#define PB9 25 //D25
|
||||
#define PB10 26 //D26
|
||||
#define PB11 27 //D27
|
||||
#define PB12 28 //D28
|
||||
#define PB13 29 //D29
|
||||
#define PB14 30 //D30
|
||||
#define PB15 31 //D31
|
||||
#define PC0 32 //D32
|
||||
#define PC1 33 //D33
|
||||
#define PC2 34 //D34
|
||||
#define PC3 35 //D35
|
||||
#define PC4 36 //D36
|
||||
#define PC5 37 //D37
|
||||
#define PC6 38 //D38
|
||||
#define PC7 39 //D39
|
||||
#define PC8 40 //D40
|
||||
#define PC9 41 //D41
|
||||
#define PC10 42 //D42
|
||||
#define PC11 43 //D43
|
||||
#define PC12 44 //D44
|
||||
#define PC13 45 //D45
|
||||
#define PC14 46 //D46
|
||||
#define PC15 47 //D47
|
||||
#define PD0 48 //D48
|
||||
#define PD1 49 //D49
|
||||
#define PD2 50 //D50
|
||||
#define PD3 51 //D51
|
||||
#define PD4 52 //D52
|
||||
#define PD5 53 //D53
|
||||
#define PD6 54 //D54
|
||||
#define PD7 55 //D55
|
||||
#define PD8 56 //D56
|
||||
#define PD9 57 //D57
|
||||
#define PD10 58 //D58
|
||||
#define PD11 59 //D59
|
||||
#define PD12 60 //D60
|
||||
#define PD13 61 //D61
|
||||
#define PD14 62 //D62
|
||||
#define PD15 63 //D63
|
||||
#define PE0 64 //D64
|
||||
#define PE1 65 //D65
|
||||
#define PE2 66 //D66
|
||||
#define PE3 67 //D67
|
||||
#define PE4 68 //D68
|
||||
#define PE5 69 //D69
|
||||
#define PE6 70 //D70
|
||||
#define PE7 71 //D71
|
||||
#define PE8 72 //D72
|
||||
#define PE9 73 //D73
|
||||
#define PE10 74 //D74
|
||||
#define PE11 75 //D75
|
||||
#define PE12 76 //D76
|
||||
#define PE13 77 //D77
|
||||
#define PE14 78 //D78
|
||||
#define PE15 79 //D79
|
||||
#define PF0 80 //D80
|
||||
#define PF1 81 //D81
|
||||
#define PF2 82 //D82
|
||||
#define PF3 83 //D83
|
||||
#define PF4 84 //D84
|
||||
#define PF5 85 //D85
|
||||
#define PF6 86 //D86
|
||||
#define PF7 87 //D87
|
||||
#define PF8 88 //D88
|
||||
#define PF9 89 //D89
|
||||
#define PF10 90 //D90
|
||||
#define PF11 91 //D91
|
||||
#define PF12 92 //D92
|
||||
#define PF13 93 //D93
|
||||
#define PF14 94 //D94
|
||||
#define PF15 95 //D95
|
||||
#define PG0 96 //D96
|
||||
#define PG1 97 //D97
|
||||
#define PG2 98 //D98
|
||||
#define PG3 99 //D99
|
||||
#define PG4 100 //D100
|
||||
#define PG5 101 //D101
|
||||
#define PG6 102 //D102
|
||||
#define PG7 103 //D103
|
||||
#define PG8 104 //D104
|
||||
#define PG9 105 //D105
|
||||
#define PG10 106 //D106
|
||||
#define PG11 107 //D107
|
||||
#define PG12 108 //D108
|
||||
#define PG13 109 //D109
|
||||
#define PG14 110 //D110
|
||||
#define PG15 111 //D111
|
||||
|
||||
// This must be a literal with the same value as PEND
|
||||
#define NUM_DIGITAL_PINS 112
|
||||
// This must be a literal with a value less than or equal to MAX_ANALOG_INPUTS
|
||||
#define NUM_ANALOG_INPUTS 8
|
||||
#define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
|
||||
|
||||
//#define ADC_RESOLUTION 12
|
||||
|
||||
// PWM resolution
|
||||
//#define PWM_RESOLUTION 12
|
||||
#define PWM_FREQUENCY 1000 // >= 20 Khz => inaudible noise for fans
|
||||
#define PWM_MAX_DUTY_CYCLE 255
|
||||
|
||||
// SPI Definitions
|
||||
#define PIN_SPI_SS PA4
|
||||
#define PIN_SPI_MOSI PA7
|
||||
#define PIN_SPI_MISO PA6
|
||||
#define PIN_SPI_SCK PA5
|
||||
|
||||
// I2C Definitions
|
||||
//#define PIN_WIRE_SDA PB9
|
||||
//#define PIN_WIRE_SCL PB8
|
||||
|
||||
// Timer Definitions
|
||||
// Do not use timer used by PWM pin. See PinMap_PWM.
|
||||
#define TIMER_TONE TIM6 // TIMER_TONE must be defined in this file
|
||||
#define TIMER_SERVO TIM5 // TIMER_SERVO must be defined in this file
|
||||
#define TIMER_SERIAL TIM7 // TIMER_SERIAL must be defined in this file
|
||||
|
||||
// UART Definitions
|
||||
//#define SERIAL_UART_INSTANCE 1 // Connected to EXP3 header
|
||||
/* Enable Serial 3 */
|
||||
#define HAVE_HWSERIAL1
|
||||
#define HAVE_HWSERIAL3
|
||||
|
||||
// Default pin used for 'Serial' instance (ex: ST-Link)
|
||||
// Mandatory for Firmata
|
||||
#define PIN_SERIAL_RX PA10
|
||||
#define PIN_SERIAL_TX PA9
|
||||
|
||||
/* HAL configuration */
|
||||
#define HSE_VALUE 12000000U
|
||||
|
||||
#define FLASH_PAGE_SIZE (4U * 1024U)
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
* Arduino objects - C++ only
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
// These serial port names are intended to allow libraries and architecture-neutral
|
||||
// sketches to automatically default to the correct port name for a particular type
|
||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
||||
//
|
||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
||||
//
|
||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
||||
//
|
||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
||||
//
|
||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
||||
// pins are NOT connected to anything by default.
|
||||
#define SERIAL_PORT_MONITOR Serial
|
||||
#define SERIAL_PORT_HARDWARE_OPEN Serial
|
||||
#endif
|
||||
|
||||
#endif /* _VARIANT_ARDUINO_STM32_ */
|
@ -926,3 +926,14 @@ build_flags = ${stm_flash_drive.build_flags}
|
||||
-DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6
|
||||
-DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED
|
||||
-DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8
|
||||
|
||||
#
|
||||
# LDO Leviathan V1.2 (STM32F446ZE ARM Cortex-M4)
|
||||
#
|
||||
[env:LDO_LEVIATHAN_V1_2]
|
||||
extends = stm32_variant
|
||||
board = marlin_LDO_LEVIATHAN_V1_2
|
||||
board_build.offset = 0x0000
|
||||
board_upload.offset_address = 0x08000000
|
||||
upload_protocol = dfu
|
||||
upload_command = dfu-util -a 0 -s 0x08000000:leave -D "$SOURCE"
|
||||
|
Loading…
Reference in New Issue
Block a user