Loading...
Searching...
No Matches
cfg_i2c_default.h File Reference

Default I2C configuration for GD32VF103 boards. More...

Detailed Description

Default I2C configuration for GD32VF103 boards.

Author
Gunar Schorcht gunar.nosp@m.@sch.nosp@m.orcht.nosp@m..net

Definition in file cfg_i2c_default.h.

#include "periph_cpu.h"
+ Include dependency graph for cfg_i2c_default.h:

Go to the source code of this file.

I2C configuration

Note
This board may require external pullup resistors for i2c operation.
#define I2C_DEV_1_USED   0
 Disable the second I2C device I2C_DEV(1) by default.
 
#define I2C_NUMOF   ARRAY_SIZE(i2c_config)
 
static const i2c_conf_t i2c_config []
 Default I2C device configuration.
 

Macro Definition Documentation

◆ I2C_DEV_1_USED

#define I2C_DEV_1_USED   0

Disable the second I2C device I2C_DEV(1) by default.

The second I2C device I2C_DEV(1) is only defined if I2C_DEV_1_USED is set to 1 by the board. This allows to use the default configuration with one or two I2C devices depending on whether other peripherals are enabled that would collide with the I2C devices.

Definition at line 45 of file cfg_i2c_default.h.

◆ I2C_NUMOF

#define I2C_NUMOF   ARRAY_SIZE(i2c_config)

Definition at line 80 of file cfg_i2c_default.h.

Variable Documentation

◆ i2c_config

const i2c_conf_t i2c_config[]
static
Initial value:
= {
{
.dev = I2C0,
.speed = I2C_SPEED_NORMAL,
.scl_pin = GPIO_PIN(PORT_B, 6),
.sda_pin = GPIO_PIN(PORT_B, 7),
.rcu_mask = RCU_APB1EN_I2C0EN_Msk,
.irqn = I2C0_EV_IRQn,
},
}
@ PORT_B
port B
Definition periph_cpu.h:48
#define GPIO_PIN(x, y)
Define a CPU specific GPIO pin generator macro.
Definition periph_cpu.h:46
@ I2C_SPEED_NORMAL
normal mode: ~100 kbit/s
Definition periph_cpu.h:278

Default I2C device configuration.

The default I2C device configuration allows to define up to two I2C devices I2C_DEV(0) and I2C_DEV(1). I2C_DEV(0) is always defined if the I2C peripheral is enabled by the module periph_spi. The second I2C device I2C_DEV(1) is only defined if I2C_DEV_1_USED is set to 1 by the board. This allows to use the default configuration with one or two I2C devices depending on whether other peripherals are enabled that would collide with the I2C devices.

Definition at line 59 of file cfg_i2c_default.h.