Fix bad I2C0/I2C1 declaration

This commit is contained in:
Olivier Fauchon
2021-05-03 00:57:21 +02:00
committed by Ron Evans
parent 1f73941c43
commit f5786941e5
+8
View File
@@ -204,15 +204,23 @@ func (spi SPI) configurePins(config SPIConfig) {
// There are 2 I2C interfaces on the STM32F103xx.
// Since the first interface is named I2C1, both I2C0 and I2C1 refer to I2C1.
// TODO: implement I2C2.
/*
var (
I2C1 = (*I2C)(unsafe.Pointer(stm32.I2C1))
I2C0 = I2C1
)
*/
type I2C struct {
Bus *stm32.I2C_Type
}
var (
I2C1 = &I2C{Bus: stm32.I2C1}
I2C0 = I2C1
)
func (i2c *I2C) configurePins(config I2CConfig) {
if config.SDA == PB9 {
// use alternate I2C1 pins PB8/PB9 via AFIO mapping