We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f73941 commit f578694Copy full SHA for f578694
src/machine/machine_stm32f103.go
@@ -204,15 +204,23 @@ func (spi SPI) configurePins(config SPIConfig) {
204
// There are 2 I2C interfaces on the STM32F103xx.
205
// Since the first interface is named I2C1, both I2C0 and I2C1 refer to I2C1.
206
// TODO: implement I2C2.
207
+
208
+/*
209
var (
210
I2C1 = (*I2C)(unsafe.Pointer(stm32.I2C1))
211
I2C0 = I2C1
212
)
213
+*/
214
215
type I2C struct {
216
Bus *stm32.I2C_Type
217
}
218
219
+var (
220
+ I2C1 = &I2C{Bus: stm32.I2C1}
221
+ I2C0 = I2C1
222
+)
223
224
func (i2c *I2C) configurePins(config I2CConfig) {
225
if config.SDA == PB9 {
226
// use alternate I2C1 pins PB8/PB9 via AFIO mapping
0 commit comments