tinygo
tinygo copied to clipboard
machine: remove TWI_FREQ_* constants
These constants:
- Have the wrong name (TWI instead of I2C)
- Are not formatted according to Go guidelines
- Are not necessary: if you want
TWI_FREQ_400KHZyou could write that directly with 400e3.
Therefore I propose that we removed them.
There is also a small change to nrf chips to also support 250kHz I2C and to machine_stm32_i2c.go to accept other values than just 100kHz/400kHz (but 100kHz/400kHz will be picked anyway). These changes allow the use of other frequencies than just 100kHz and 400kHz in I2CConfig while still doing something reasonable.
I have tested this on the pca10040 board. Also see https://github.com/tinygo-org/drivers/pull/229.