mirror of https://github.com/tinygo-org/tinygo.git
Matt Schultz
2 years ago
committed by
Ron Evans
6 changed files with 105 additions and 1 deletions
@ -0,0 +1,63 @@ |
|||
//go:build trinkey_qt2040
|
|||
// +build trinkey_qt2040
|
|||
|
|||
// This file contains the pin mappings for the Adafruit Trinkey QT2040 board.
|
|||
//
|
|||
// The Trinkey QT2040 is a small development board based on the RP2040 which
|
|||
// plugs into a USB A port. The board has a minimal pinout: an integrated
|
|||
// NeoPixel LED and a STEMMA QT I2C port.
|
|||
//
|
|||
// - Product: https://www.adafruit.com/product/5056
|
|||
// - Overview: https://learn.adafruit.com/adafruit-trinkey-qt2040
|
|||
// - Pinouts: https://learn.adafruit.com/adafruit-trinkey-qt2040/pinouts
|
|||
// - Datasheets: https://learn.adafruit.com/adafruit-trinkey-qt2040/downloads
|
|||
|
|||
package machine |
|||
|
|||
// Onboard crystal oscillator frequency, in MHz
|
|||
const xoscFreq = 12 // MHz
|
|||
|
|||
// Onboard LEDs
|
|||
const ( |
|||
NEOPIXEL = GPIO27 |
|||
WS2812 = NEOPIXEL |
|||
) |
|||
|
|||
// I2C pins
|
|||
const ( |
|||
I2C0_SDA_PIN = GPIO16 |
|||
I2C0_SCL_PIN = GPIO17 |
|||
|
|||
I2C1_SDA_PIN = NoPin |
|||
I2C1_SCL_PIN = NoPin |
|||
) |
|||
|
|||
// SPI pins
|
|||
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 |
|||
) |
|||
|
|||
// UART pins
|
|||
const ( |
|||
UART0_TX_PIN = NoPin |
|||
UART0_RX_PIN = NoPin |
|||
UART_TX_PIN = UART0_TX_PIN |
|||
UART_RX_PIN = UART0_RX_PIN |
|||
) |
|||
|
|||
// USB identifiers
|
|||
const ( |
|||
usb_STRING_PRODUCT = "Trinkey QT2040" |
|||
usb_STRING_MANUFACTURER = "Adafruit" |
|||
) |
|||
|
|||
var ( |
|||
usb_VID uint16 = 0x239a |
|||
usb_PID uint16 = 0x8109 |
|||
) |
@ -0,0 +1,17 @@ |
|||
// Adafruit Trinkey QT2040 Stage 2 Bootloader |
|||
|
|||
// |
|||
// This file defines the parameters specific to the flash-chip found |
|||
// on the Adafruit Trinkey QT2040. The generic implementation is in |
|||
// rp2040-boot-stage2.S |
|||
// |
|||
|
|||
#define BOARD_PICO_FLASH_SPI_CLKDIV 4 |
|||
#define BOARD_CMD_READ 0xe7 |
|||
#define BOARD_QUAD_OK 1 |
|||
#define BOARD_QUAD_ENABLE_STATUS_BYTE 2 |
|||
#define BOARD_QUAD_ENABLE_BIT_MASK 2 |
|||
#define BOARD_SPLIT_STATUS_WRITE 1 |
|||
#define BOARD_WAIT_CYCLES 2 |
|||
|
|||
#include "rp2040-boot-stage2.S" |
@ -0,0 +1,11 @@ |
|||
{ |
|||
"inherits": [ |
|||
"rp2040" |
|||
], |
|||
"serial-port": ["acm:239a:8109"], |
|||
"build-tags": ["trinkey_qt2040"], |
|||
"linkerscript": "targets/trinkey-qt2040.ld", |
|||
"extra-files": [ |
|||
"targets/trinkey-qt2040-boot-stage2.S" |
|||
] |
|||
} |
@ -0,0 +1,10 @@ |
|||
|
|||
MEMORY |
|||
{ |
|||
/* Reserve exactly 256 bytes at start of flash for second stage bootloader */ |
|||
BOOT2_TEXT (rx) : ORIGIN = 0x10000000, LENGTH = 256 |
|||
FLASH_TEXT (rx) : ORIGIN = 0x10000000 + 256, LENGTH = 8192K - 256 |
|||
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256k |
|||
} |
|||
|
|||
INCLUDE "targets/rp2040.ld" |
Loading…
Reference in new issue