mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-07 13:19:01 +00:00
sam: simplify I2C peripheral declarations
This commit changes the I2C declarations so that the objects are
instantiated in each chip file (e.g. machine_atsamd21e18.go) and used to
define I2C0 (and similar) in the board file (e.g. board_qtpy.go). This
should make it easier to define new board files, and reduces the need
for separate *_baremetal.go files.
I have tested this the following way:
- With the LIS3DH driver example on the Circuit Playground Express and
the PyBadge.
- With the LSM6DS3 driver example on the Arduino Nano 33 IoT.
They both still work fine.
This commit is contained in:
committed by
Ron Evans
parent
e50885a6f2
commit
ae864bdf0c
@@ -81,6 +81,11 @@ const (
|
||||
SCL_PIN = PB03 // SCL: SERCOM5/PAD[1]
|
||||
)
|
||||
|
||||
// I2C on the Metro M4.
|
||||
var (
|
||||
I2C0 = sercomI2CM5
|
||||
)
|
||||
|
||||
// SPI pins
|
||||
const (
|
||||
SPI0_SCK_PIN = PA13 // SCK: SERCOM2/PAD[1]
|
||||
|
||||
Reference in New Issue
Block a user