i2csoft: add source code for each target

This commit is contained in:
sago35
2021-09-24 10:15:02 +09:00
committed by Ron Evans
parent 2c9a05a413
commit 4f82c231cb
6 changed files with 63 additions and 30 deletions
+3 -9
View File
@@ -7,16 +7,10 @@ import (
"device"
)
// wait waits for half the time of the SCL operation interval. It is set to
// about 100 kHz.
func (i2c *I2C) wait() {
// atsamd51
// 10 : about 387kHz
// 56 : about 99kHz
wait := 10
if i2c.baudrate < 400*1e3 {
wait = 56
}
wait := 60
for i := 0; i < wait; i++ {
device.Asm(`nop`)
}