machine/samd21: move definitions for I2C interfaces into board files, since pin connections on each SAMD21-based board implementation can differ
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
родитель
543696eafc
коммит
3538ba943c
3 изменённых файлов: 15 добавлений и 6 удалений
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
|
import "device/sam"
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PB09
|
D0 = PB09
|
||||||
|
@ -68,3 +70,9 @@ const (
|
||||||
SDA_PIN = PA00 // SDA: SERCOM3/PAD[0]
|
SDA_PIN = PA00 // SDA: SERCOM3/PAD[0]
|
||||||
SCL_PIN = PA01 // SCL: SERCOM3/PAD[1]
|
SCL_PIN = PA01 // SCL: SERCOM3/PAD[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// I2C on the Circuit Playground Express.
|
||||||
|
var (
|
||||||
|
I2C0 = I2C{Bus: sam.SERCOM5_I2CM} // external device
|
||||||
|
I2C1 = I2C{Bus: sam.SERCOM1_I2CM} // internal device
|
||||||
|
)
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
|
import "device/sam"
|
||||||
|
|
||||||
// GPIO Pins
|
// GPIO Pins
|
||||||
const (
|
const (
|
||||||
D0 = PA11 // UART0 RX
|
D0 = PA11 // UART0 RX
|
||||||
|
@ -51,3 +53,8 @@ const (
|
||||||
SDA_PIN = PA22 // SDA: SERCOM3/PAD[0]
|
SDA_PIN = PA22 // SDA: SERCOM3/PAD[0]
|
||||||
SCL_PIN = PA23 // SCL: SERCOM3/PAD[1]
|
SCL_PIN = PA23 // SCL: SERCOM3/PAD[1]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// I2C on the ItsyBitsy M0.
|
||||||
|
var (
|
||||||
|
I2C0 = I2C{Bus: sam.SERCOM3_I2CM}
|
||||||
|
)
|
||||||
|
|
|
@ -420,12 +420,6 @@ type I2C struct {
|
||||||
Bus *sam.SERCOM_I2CM_Type
|
Bus *sam.SERCOM_I2CM_Type
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since the I2C interfaces on the SAMD21 use the SERCOMx peripherals,
|
|
||||||
// you can have multiple ones. we currently only implement one.
|
|
||||||
var (
|
|
||||||
I2C0 = I2C{Bus: sam.SERCOM3_I2CM}
|
|
||||||
)
|
|
||||||
|
|
||||||
// I2CConfig is used to store config info for I2C.
|
// I2CConfig is used to store config info for I2C.
|
||||||
type I2CConfig struct {
|
type I2CConfig struct {
|
||||||
Frequency uint32
|
Frequency uint32
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче