mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 19:44:00 +00:00
machine: Add board support for BigTreeTech SKR Pico (#4842)
* machine: add support for BTT SKR Pico Adds support for the BigTreeTech SKR Pico 3D-printer mainboard. This board uses the RP2040. * Fix build tag * Add I2C defaults * Run UART test instead of blinky1 * Use NoPin for I2C and SPI on BTT SKR Pico * Cleanup comments * Don't use ADC pin names
This commit is contained in:
@@ -630,6 +630,8 @@ endif
|
|||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=nrf52840-mdk examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=nrf52840-mdk examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
|
$(TINYGO) build -size short -o test.hex -target=btt-skr-pico examples/uart
|
||||||
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
//go:build btt_skr_pico
|
||||||
|
|
||||||
|
// This contains the pin mappings for the BigTreeTech SKR Pico.
|
||||||
|
//
|
||||||
|
// Purchase link: https://biqu.equipment/products/btt-skr-pico-v1-0
|
||||||
|
// Board schematic: https://github.com/bigtreetech/SKR-Pico/blob/master/Hardware/BTT%20SKR%20Pico%20V1.0-SCH.pdf
|
||||||
|
// Pin diagram: https://github.com/bigtreetech/SKR-Pico/blob/master/Hardware/BTT%20SKR%20Pico%20V1.0-PIN.pdf
|
||||||
|
|
||||||
|
package machine
|
||||||
|
|
||||||
|
// TMC stepper driver motor direction.
|
||||||
|
// X/Y/Z/E refers to motors for X/Y/Z and the extruder.
|
||||||
|
const (
|
||||||
|
X_DIR = GPIO10
|
||||||
|
Y_DIR = GPIO5
|
||||||
|
Z_DIR = GPIO28
|
||||||
|
E_DIR = GPIO13
|
||||||
|
)
|
||||||
|
|
||||||
|
// TMC stepper driver motor step
|
||||||
|
const (
|
||||||
|
X_STEP = GPIO11
|
||||||
|
Y_STEP = GPIO6
|
||||||
|
Z_STEP = GPIO19
|
||||||
|
E_STEP = GPIO14
|
||||||
|
)
|
||||||
|
|
||||||
|
// TMC stepper driver enable
|
||||||
|
const (
|
||||||
|
X_ENABLE = GPIO12
|
||||||
|
Y_ENABLE = GPIO7
|
||||||
|
Z_ENABLE = GPIO2
|
||||||
|
E_ENABLE = GPIO15
|
||||||
|
)
|
||||||
|
|
||||||
|
// TMC stepper driver UART
|
||||||
|
const (
|
||||||
|
TMC_UART_TX = UART1_TX_PIN
|
||||||
|
TMC_UART_RX = UART1_RX_PIN
|
||||||
|
)
|
||||||
|
|
||||||
|
// Endstops
|
||||||
|
const (
|
||||||
|
X_ENDSTOP = GPIO4
|
||||||
|
Y_ENDSTOP = GPIO3
|
||||||
|
Z_ENDSTOP = GPIO25
|
||||||
|
E_ENDSTOP = GPIO16
|
||||||
|
)
|
||||||
|
|
||||||
|
// Fan PWM
|
||||||
|
const (
|
||||||
|
FAN1_PWM = GPIO17
|
||||||
|
FAN2_PWM = GPIO18
|
||||||
|
FAN3_PWM = GPIO20
|
||||||
|
)
|
||||||
|
|
||||||
|
// Heater PWM
|
||||||
|
const (
|
||||||
|
HEATER_BED_PWM = GPIO21
|
||||||
|
HEATER_EXTRUDER_PWM = GPIO23
|
||||||
|
)
|
||||||
|
|
||||||
|
// Thermistors
|
||||||
|
const (
|
||||||
|
THERM_BED = GPIO26 // Bed heater
|
||||||
|
THERM_EXTRUDER = GPIO27 // Toolhead heater
|
||||||
|
)
|
||||||
|
|
||||||
|
// Misc
|
||||||
|
const (
|
||||||
|
RGB = GPIO24 // Neopixel
|
||||||
|
SERVO = GPIO29 // Servo
|
||||||
|
PROBE = GPIO22 // Probe
|
||||||
|
)
|
||||||
|
|
||||||
|
// Onboard crystal oscillator frequency, in MHz.
|
||||||
|
const (
|
||||||
|
xoscFreq = 12 // MHz
|
||||||
|
)
|
||||||
|
|
||||||
|
// I2C. We don't have this available
|
||||||
|
const (
|
||||||
|
I2C0_SDA_PIN = NoPin
|
||||||
|
I2C0_SCL_PIN = NoPin
|
||||||
|
|
||||||
|
I2C1_SDA_PIN = NoPin
|
||||||
|
I2C1_SCL_PIN = NoPin
|
||||||
|
)
|
||||||
|
|
||||||
|
// SPI. We don't have this available
|
||||||
|
const (
|
||||||
|
SPI0_SCK_PIN = NoPin
|
||||||
|
SPI0_SDO_PIN = NoPin
|
||||||
|
SPI0_SDI_PIN = NoPin
|
||||||
|
SPI1_SCK_PIN = NoPin
|
||||||
|
SPI1_SDO_PIN = NoPin
|
||||||
|
SPI1_SDI_PIN = NoPin
|
||||||
|
)
|
||||||
|
|
||||||
|
// USB CDC identifiers
|
||||||
|
const (
|
||||||
|
usb_STRING_PRODUCT = "SKR Pico"
|
||||||
|
usb_STRING_MANUFACTURER = "BigTreeTech"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
usb_VID uint16 = 0x2e8a
|
||||||
|
usb_PID uint16 = 0x0003
|
||||||
|
)
|
||||||
|
|
||||||
|
// UART pins
|
||||||
|
const (
|
||||||
|
UART0_TX_PIN = GPIO0
|
||||||
|
UART0_RX_PIN = GPIO1
|
||||||
|
UART1_TX_PIN = GPIO8
|
||||||
|
UART1_RX_PIN = GPIO9
|
||||||
|
UART_TX_PIN = UART0_TX_PIN
|
||||||
|
UART_RX_PIN = UART0_RX_PIN
|
||||||
|
)
|
||||||
|
|
||||||
|
var DefaultUART = UART0
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"inherits": [
|
||||||
|
"rp2040"
|
||||||
|
],
|
||||||
|
"build-tags": ["btt_skr_pico"],
|
||||||
|
"serial-port": ["2e8a:000A"],
|
||||||
|
"ldflags": [
|
||||||
|
"--defsym=__flash_size=16M"
|
||||||
|
],
|
||||||
|
"extra-files": [
|
||||||
|
"targets/pico-boot-stage2.S"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user