tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

machine: remove TWI_FREQ_* constants

Open aykevl opened this issue 4 years ago • 0 comments

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_400KHZ you 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.

aykevl avatar Feb 06 '21 10:02 aykevl