CommunityGD32Cores / ArduinoCore-GD32

Arduino core for GD32 devices, community developed, based on original GigaDevice's core
Other
85 stars 33 forks source link

Make all I2C peripherals available #78

Closed maxgerhardt closed 1 year ago

maxgerhardt commented 1 year ago

Exposed as Wire (I2C), Wire1 (I2C1), Wire2 (I2C2) if available.

Fixes a bug with shared I2C buffers that should never have been shared between instances.

I2C2 often has only one set of pins available, which are our default I2C0 pins. Meaning our default choise for Wire (I2C0) with PB6 and PB7 collide with I2C2. Howvever, as I see it, people would then redefine the I2C0 pins so that these become available for I2C2 -- it is more important to keep the "Wire is on PB6 and PB7" default behavior since that is also what the STM32Duino core does.

Removes USE_I2C(n) macros, uses HAVE_I2C(n) instead. Unused I2C objects are thrown out by the linker.

All pin mappings are redefinable.