aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/machine_atsamd51.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-09-16 13:50:48 +0200
committerRon Evans <[email protected]>2022-09-20 21:00:17 +0200
commit7513fa2c96ee8a775349c4dcf4c82dbc73ca9b2c (patch)
tree1f56b69d24abe235bb2db5cc463f6e31e88e7e71 /src/machine/machine_atsamd51.go
parentbc946f346dc2c0f718e7fd826c139b353f0b15f0 (diff)
downloadtinygo-7513fa2c96ee8a775349c4dcf4c82dbc73ca9b2c.tar.gz
tinygo-7513fa2c96ee8a775349c4dcf4c82dbc73ca9b2c.zip
machine: add KHz, MHz, GHz constants, deprecate TWI_FREQ_* constants
There are two main issues with these constants: * They don't follow the Go naming convention. * They call themselves "TWI", while it makes a lot more sense to refer to the actual name which is I2C (or I²C). I have not removed them but just deprecated them. Perhaps we can remove them when we move towards version 1.0.
Diffstat (limited to 'src/machine/machine_atsamd51.go')
-rw-r--r--src/machine/machine_atsamd51.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/machine/machine_atsamd51.go b/src/machine/machine_atsamd51.go
index 20040bf96..66e1a96a1 100644
--- a/src/machine/machine_atsamd51.go
+++ b/src/machine/machine_atsamd51.go
@@ -1151,7 +1151,7 @@ const i2cTimeout = 1000
func (i2c *I2C) Configure(config I2CConfig) error {
// Default I2C bus speed is 100 kHz.
if config.Frequency == 0 {
- config.Frequency = TWI_FREQ_100KHZ
+ config.Frequency = 100 * KHz
}
// Use default I2C pins if not set.