diff options
author | sago35 <[email protected]> | 2020-06-05 15:14:31 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-05 08:14:31 +0200 |
commit | 0c880ec44c3199cebbdf3611eba331d5b683afdd (patch) | |
tree | 2aa1abb35635146fa707b4dbcb8f612129823350 /src/machine/board_metro-m4-airlift.go | |
parent | 64d51b215f63a3b178c6337ab252086d16003ff7 (diff) | |
download | tinygo-0c880ec44c3199cebbdf3611eba331d5b683afdd.tar.gz tinygo-0c880ec44c3199cebbdf3611eba331d5b683afdd.zip |
Standardize SAMD51 UART settings (#1155)
* machine/samd51: standardize samd51 uart settings
Diffstat (limited to 'src/machine/board_metro-m4-airlift.go')
-rw-r--r-- | src/machine/board_metro-m4-airlift.go | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/src/machine/board_metro-m4-airlift.go b/src/machine/board_metro-m4-airlift.go index a62c4c244..c1f49a190 100644 --- a/src/machine/board_metro-m4-airlift.go +++ b/src/machine/board_metro-m4-airlift.go @@ -1,9 +1,7 @@ -// +build sam,atsamd51,metro_m4_airlift +// +build metro_m4_airlift package machine -import "device/sam" - // used to reset into bootloader const RESET_MAGIC_VALUE = 0xf01669ef @@ -53,7 +51,10 @@ const ( UART_RX_PIN = D0 ) -// Note: UART1 is on SERCOM3, defined in machine_atsamd51.go +const ( + UART2_TX_PIN = PA04 + UART2_RX_PIN = PA07 +) const ( NINA_CS = PA15 @@ -66,23 +67,12 @@ const ( NINA_RTS = PB23 ) -// UART2 is on SERCOM0, defined in machine_atsamd51.go, and connects to the -// onboard ESP32-WROOM chip. - // I2C pins const ( SDA_PIN = PB02 // SDA: SERCOM5/PAD[0] SCL_PIN = PB03 // SCL: SERCOM5/PAD[1] ) -// I2C on the Metro M4. -var ( - I2C0 = I2C{ - Bus: sam.SERCOM5_I2CM, - SERCOM: 5, - } -) - // SPI pins const ( SPI0_SCK_PIN = PA13 // SCK: SERCOM2/PAD[1] @@ -94,29 +84,12 @@ const ( NINA_SCK = SPI0_SCK_PIN ) -// SPI on the Metro M4. -var ( - SPI0 = SPI{ - Bus: sam.SERCOM2_SPIM, - SERCOM: 2, - } - NINA_SPI = SPI0 -) - const ( SPI1_SCK_PIN = D12 // MISO: SERCOM1/PAD[1] SPI1_MOSI_PIN = D11 // MOSI: SERCOM1/PAD[3] SPI1_MISO_PIN = D13 // SCK: SERCOM1/PAD[0] ) -// SPI1 on the Metro M4 on pins 11,12,13 -var ( - SPI1 = SPI{ - Bus: sam.SERCOM1_SPIM, - SERCOM: 1, - } -) - // USB CDC identifiers const ( usb_STRING_PRODUCT = "Adafruit Metro M4 Airlift Lite" |