From 2138fd785466f32085a4a0b9ad7b24ae4b71b73b Mon Sep 17 00:00:00 2001 From: BCG Date: Wed, 5 Feb 2020 11:45:33 -0500 Subject: [PATCH] machine/samd51: Moving QSPI definitions to common file The QSPI peripheral is only available on a fixed set of pins, so these can be added as constants for all atsamd51 boards. --- src/machine/board_pybadge.go | 7 ------- src/machine/machine_atsamd51.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/machine/board_pybadge.go b/src/machine/board_pybadge.go index 1d8c30f5..2d7ab9ad 100644 --- a/src/machine/board_pybadge.go +++ b/src/machine/board_pybadge.go @@ -55,13 +55,6 @@ const ( TFT_LITE = PA01 SPEAKER_ENABLE = PA27 - - QSPI_SCK = PB10 - QSPI_CS = PB11 - QSPI_DATA_1 = PA08 - QSPI_DATA_2 = PA09 - QSPI_DATA_3 = PA10 - QSPI_DATA_4 = PA11 ) const ( diff --git a/src/machine/machine_atsamd51.go b/src/machine/machine_atsamd51.go index d61e9aa4..411e6793 100644 --- a/src/machine/machine_atsamd51.go +++ b/src/machine/machine_atsamd51.go @@ -1195,6 +1195,16 @@ func (spi SPI) Transfer(w byte) (byte, error) { return byte(spi.Bus.DATA.Get()), nil } +// The QSPI peripheral on ATSAMD51 is only available on the following pins +const ( + QSPI_SCK = PB10 + QSPI_CS = PB11 + QSPI_DATA0 = PA08 + QSPI_DATA1 = PA09 + QSPI_DATA2 = PA10 + QSPI_DATA3 = PA11 +) + // PWM const period = 0xFFFF