上传文件至 YD-PYBV11

main
vcc_gnd gardener 2024-02-07 23:32:33 +08:00
parent 416cabed71
commit a81c1322e9
4 changed files with 268 additions and 0 deletions

113
YD-PYBV11/mpconfigboard.h Normal file
View File

@ -0,0 +1,113 @@
#define MICROPY_HW_BOARD_NAME "YD-Pyboard V3.0-MPY-1.21.1-2"
#define MICROPY_HW_MCU_NAME "STM32F405RG"
#define MICROPY_HW_HAS_SWITCH (1)
#define MICROPY_HW_HAS_FLASH (1)
#define MICROPY_HW_HAS_KXTJ3 (1)
#define MICROPY_HW_HAS_LCD (1)
#define MICROPY_HW_ENABLE_RNG (1)
#define MICROPY_HW_ENABLE_RTC (1)
#define MICROPY_HW_ENABLE_SERVO (1)
#define MICROPY_HW_ENABLE_DAC (1)
#define MICROPY_HW_ENABLE_USB (1)
#define MICROPY_HW_ENABLE_SDCARD (1)
#define MICROPY_PY_THREAD (1)
// HSE is 12MHz
#define MICROPY_HW_CLK_PLLM (12)
#define MICROPY_HW_CLK_PLLN (336)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (7)
#define MICROPY_HW_CLK_LAST_FREQ (1)
// The pyboard has a 32kHz crystal for the RTC
#define MICROPY_HW_RTC_USE_LSE (1)
#define MICROPY_HW_RTC_USE_US (0)
#define MICROPY_HW_RTC_USE_CALOUT (1)
// UART config
#define MICROPY_HW_UART1_NAME "XB"
#define MICROPY_HW_UART1_TX (pin_B6)
#define MICROPY_HW_UART1_RX (pin_B7)
#define MICROPY_HW_UART2_TX (pin_A2)
#define MICROPY_HW_UART2_RX (pin_A3)
#define MICROPY_HW_UART2_RTS (pin_A1)
#define MICROPY_HW_UART2_CTS (pin_A0)
#define MICROPY_HW_UART3_NAME "YB"
#define MICROPY_HW_UART3_TX (pin_B10)
#define MICROPY_HW_UART3_RX (pin_B11)
#define MICROPY_HW_UART3_RTS (pin_B14)
#define MICROPY_HW_UART3_CTS (pin_B13)
#define MICROPY_HW_UART4_NAME "XA"
#define MICROPY_HW_UART4_TX (pin_A0)
#define MICROPY_HW_UART4_RX (pin_A1)
#define MICROPY_HW_UART6_NAME "YA"
#define MICROPY_HW_UART6_TX (pin_C6)
#define MICROPY_HW_UART6_RX (pin_C7)
// I2C buses
#define MICROPY_HW_I2C1_NAME "X"
#define MICROPY_HW_I2C1_SCL (pin_B6)
#define MICROPY_HW_I2C1_SDA (pin_B7)
#define MICROPY_HW_I2C2_NAME "Y"
#define MICROPY_HW_I2C2_SCL (pin_B10)
#define MICROPY_HW_I2C2_SDA (pin_B11)
// SPI buses
#define MICROPY_HW_SPI1_NAME "X"
#define MICROPY_HW_SPI1_NSS (pin_A4) // X5
#define MICROPY_HW_SPI1_SCK (pin_A5) // X6
#define MICROPY_HW_SPI1_MISO (pin_A6) // X7
#define MICROPY_HW_SPI1_MOSI (pin_A7) // X8
#define MICROPY_HW_SPI2_NAME "Y"
#define MICROPY_HW_SPI2_NSS (pin_B12) // Y5
#define MICROPY_HW_SPI2_SCK (pin_B13) // Y6
#define MICROPY_HW_SPI2_MISO (pin_B14) // Y7
#define MICROPY_HW_SPI2_MOSI (pin_B15) // Y8
// I2S buses
#define MICROPY_HW_I2S2 (1)
// CAN buses
#define MICROPY_HW_CAN1_NAME "YA"
#define MICROPY_HW_CAN1_TX (pin_B9) // Y4
#define MICROPY_HW_CAN1_RX (pin_B8) // Y3
#define MICROPY_HW_CAN2_NAME "YB"
#define MICROPY_HW_CAN2_TX (pin_B13) // Y6
#define MICROPY_HW_CAN2_RX (pin_B12) // Y5
// USRSW has no pullup or pulldown, and pressing the switch makes the input go low
#define MICROPY_HW_USRSW_PIN (pin_B3)
#define MICROPY_HW_USRSW_PULL (GPIO_PULLUP)
#define MICROPY_HW_USRSW_EXTI_MODE (GPIO_MODE_IT_FALLING)
#define MICROPY_HW_USRSW_PRESSED (0)
// The pyboard has 4 LEDs
#define MICROPY_HW_LED1 (pin_A13) // red
#define MICROPY_HW_LED2 (pin_A14) // green
#define MICROPY_HW_LED3 (pin_A15) // yellow
#define MICROPY_HW_LED4 (pin_B4) // blue
#define MICROPY_HW_LED3_PWM { TIM2, 2, TIM_CHANNEL_1, GPIO_AF1_TIM2 }
#define MICROPY_HW_LED4_PWM { TIM3, 3, TIM_CHANNEL_1, GPIO_AF2_TIM3 }
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
// SD card detect switch
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_A8)
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLDOWN)
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_SET)
// USB config
#define MICROPY_HW_USB_FS (1)
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
// MMA accelerometer config-
// Bootloader configuration (only needed if Mboot is used)
#define MBOOT_I2C_PERIPH_ID 1
#define MBOOT_I2C_SCL (pin_B8)
#define MBOOT_I2C_SDA (pin_B9)
#define MBOOT_I2C_ALTFUNC (4)

View File

@ -0,0 +1,37 @@
MCU_SERIES = f4
CMSIS_MCU = STM32F405xx
AF_FILE = boards/stm32f405_af.csv
ifeq ($(USE_MBOOT),1)
# When using Mboot all the text goes together after the filesystem
LD_FILES = boards/stm32f405.ld boards/common_blifs.ld
TEXT0_ADDR = 0x08020000
else
# When not using Mboot the ISR text goes first, then the rest after the filesystem
LD_FILES = boards/stm32f405.ld boards/common_ifs.ld
TEXT0_ADDR = 0x08000000
TEXT1_ADDR = 0x08020000
endif
# MicroPython settings
MICROPY_VFS_LFS2 = 1
# Provide different variants for the downloads page.
ifeq ($(BOARD_VARIANT),DP)
MICROPY_FLOAT_IMPL=double
endif
ifeq ($(BOARD_VARIANT),THREAD)
CFLAGS += -DMICROPY_PY_THREAD=1
endif
ifeq ($(BOARD_VARIANT),DP_THREAD)
MICROPY_FLOAT_IMPL=double
CFLAGS += -DMICROPY_PY_THREAD=1
endif
ifeq ($(BOARD_VARIANT),NETWORK)
MICROPY_PY_NETWORK_WIZNET5K=5200
endif
# PYB-specific frozen modules
FROZEN_MANIFEST ?= boards/PYBV10/manifest.py

103
YD-PYBV11/pins.csv Normal file
View File

@ -0,0 +1,103 @@
X1,PA0
X2,PA1
X3,PA2
X4,PA3
X5,PA4
X6,PA5
X7,PA6
X8,PA7
X9,PB6
X10,PB7
X11,PC4
X12,PC5
X13,Reset
X14,GND
X15,3.3V
X16,VIN
X17,PB3
X18,PC13
X19,PC0
X20,PC1
X21,PC2
X22,PC3
X23,A3.3V
X24,AGND
Y1,PC6
Y2,PC7
Y3,PB8
Y4,PB9
Y5,PB12
Y6,PB13
Y7,PB14
Y8,PB15
Y9,PB10
Y10,PB11
Y11,PB0
Y12,PB1
Y13,Reset
Y14,GND
Y15,3.3V
Y16,VIN
SW,PB3
LED_RED,PA13
LED_GREEN,PA14
LED_YELLOW,PA15
LED_BLUE,PB4
MMA_INT,PB2
RGB,PB5
SD_D0,PC8
SD_D1,PC9
SD_D2,PC10
SD_D3,PC11
SD_CMD,PD2
SD_CK,PC12
SD,PA8
SD_SW,PA8
USB_VBUS,PA9
USB_ID,PA10
USB_DM,PA11
USB_DP,PA12
A0,PA0
A1,PA1
A2,PA2
A3,PA3
A4,PA4
A5,PA5
A6,PA6
A7,PA7
B6,PB6
B7,PB7
C4,PC4
C5,PC5
B3,PB3
C13,PC13
C0,PC0
C1,PC1
C2,PC2
C3,PC3
C6,PC6
C7,PC7
B8,PB8
B9,PB9
B12,PB12
B13,PB13
B14,PB14
B15,PB15
B10,PB10
B11,PB11
B0,PB0
B1,PB1
B3,PB3
A13,PA13
A14,PA14
A15,PA15
B4,PB4
B2,PB2
B5,PB5
C8,PC8
C9,PC9
C10,PC10
C11,PC11
D2,PD2
C12,PC12
A8,PA8
1 X1 PA0
2 X2 PA1
3 X3 PA2
4 X4 PA3
5 X5 PA4
6 X6 PA5
7 X7 PA6
8 X8 PA7
9 X9 PB6
10 X10 PB7
11 X11 PC4
12 X12 PC5
13 X13 Reset
14 X14 GND
15 X15 3.3V
16 X16 VIN
17 X17 PB3
18 X18 PC13
19 X19 PC0
20 X20 PC1
21 X21 PC2
22 X22 PC3
23 X23 A3.3V
24 X24 AGND
25 Y1 PC6
26 Y2 PC7
27 Y3 PB8
28 Y4 PB9
29 Y5 PB12
30 Y6 PB13
31 Y7 PB14
32 Y8 PB15
33 Y9 PB10
34 Y10 PB11
35 Y11 PB0
36 Y12 PB1
37 Y13 Reset
38 Y14 GND
39 Y15 3.3V
40 Y16 VIN
41 SW PB3
42 LED_RED PA13
43 LED_GREEN PA14
44 LED_YELLOW PA15
45 LED_BLUE PB4
46 MMA_INT PB2
47 RGB PB5
48 SD_D0 PC8
49 SD_D1 PC9
50 SD_D2 PC10
51 SD_D3 PC11
52 SD_CMD PD2
53 SD_CK PC12
54 SD PA8
55 SD_SW PA8
56 USB_VBUS PA9
57 USB_ID PA10
58 USB_DM PA11
59 USB_DP PA12
60 A0 PA0
61 A1 PA1
62 A2 PA2
63 A3 PA3
64 A4 PA4
65 A5 PA5
66 A6 PA6
67 A7 PA7
68 B6 PB6
69 B7 PB7
70 C4 PC4
71 C5 PC5
72 B3 PB3
73 C13 PC13
74 C0 PC0
75 C1 PC1
76 C2 PC2
77 C3 PC3
78 C6 PC6
79 C7 PC7
80 B8 PB8
81 B9 PB9
82 B12 PB12
83 B13 PB13
84 B14 PB14
85 B15 PB15
86 B10 PB10
87 B11 PB11
88 B0 PB0
89 B1 PB1
90 B3 PB3
91 A13 PA13
92 A14 PA14
93 A15 PA15
94 B4 PB4
95 B2 PB2
96 B5 PB5
97 C8 PC8
98 C9 PC9
99 C10 PC10
100 C11 PC11
101 D2 PD2
102 C12 PC12
103 A8 PA8

View File

@ -0,0 +1,15 @@
#ifndef MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
#define MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H
// Oscillator values in Hz
#define HSE_VALUE (12000000)
#define LSE_VALUE (32768)
#define EXTERNAL_CLOCK_VALUE (12288000)
// Oscillator timeouts in ms
#define HSE_STARTUP_TIMEOUT (100)
#define LSE_STARTUP_TIMEOUT (5000)
#include "boards/stm32f4xx_hal_conf_base.h"
#endif // MICROPY_INCLUDED_STM32F4XX_HAL_CONF_H