aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/spi.go
diff options
context:
space:
mode:
authorWeston Schmidt <[email protected]>2021-02-09 14:28:28 -0800
committerRon Evans <[email protected]>2021-02-10 12:56:48 +0100
commitf4b4dd8d62eb89922525d2a9ab35843aa0ad3062 (patch)
tree361c040946198b28c11c4c2cc2b8dae8cb722299 /src/machine/spi.go
parent9f5bd2c460cfcf5dca40fe043d8a51a25f1a79b3 (diff)
downloadtinygo-f4b4dd8d62eb89922525d2a9ab35843aa0ad3062.tar.gz
tinygo-f4b4dd8d62eb89922525d2a9ab35843aa0ad3062.zip
Add SPI support for Atmega based chips.
This is based on @Nerzal's #1398 PR, but is a bit of a refactor and expansion to support all the Atmega based chips present in tinygo.
Diffstat (limited to 'src/machine/spi.go')
-rw-r--r--src/machine/spi.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/machine/spi.go b/src/machine/spi.go
index a10df267b..e9e3c42d8 100644
--- a/src/machine/spi.go
+++ b/src/machine/spi.go
@@ -1,4 +1,4 @@
-// +build !baremetal sam stm32,!stm32f7x2 fe310 k210
+// +build !baremetal sam stm32,!stm32f7x2 fe310 k210 atmega
package machine
@@ -13,7 +13,8 @@ const (
)
var (
- ErrTxInvalidSliceSize = errors.New("SPI write and read slices must be same size")
+ ErrTxInvalidSliceSize = errors.New("SPI write and read slices must be same size")
+ errSPIInvalidMachineConfig = errors.New("SPI port was not configured properly by the machine")
)
// Tx handles read/write operation for SPI interface. Since SPI is a syncronous write/read