First, enable the I2C interface on the raspi-config management tool.
See the figure below for specific options:
Remember to restart when you are finished.
Then, enter the command line to edit the config.txt file, which is the most important part:
Locate the line containing "dtparam=i2c_arm=on" and add "i2c _ arm _ baud = 400000" after it. This line indicates that the transmission rate of I2C is set to 40kbit/s.
Save and exit, and you're done after restarting.
In addition, according to the description of BCM2835 ARM peripheral (page 28), it is mentioned that Raspberry Pie has a "fast mode" drive, and baudrate can take a value between 100000~400000. 100000 is the default value, so I can set it to 400000 to enable I2C express mode for Raspberry Pie.