在gd32里写i2c 设备初始化的时候代码一直卡在 while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)){}; 出不去,地址定义应该没有什么问题,能求求帮忙看看吗
void icm42607_init(void)
{
/* wait until I2C bus is idle */
while(i2c_flag_get(I2C0, I2C_FLAG_I2CBSY));
i2c_start_on_bus(I2C0);
/* wait until SBSEND bit is set */
while(!i2c_flag_get(I2C0, I2C_FLAG_SBSEND)){};
/* send slave address to I2C bus */
i2c_master_addressing(I2C0,ICM426_ADDR,I2C_TRANSMITTER);
/* wait until ADDSEND bit is set */
while(!i2c_flag_get(I2C0, I2C_FLAG_ADDSEND)){};
/* clear the ADDSEND bit */
i2c_flag_clear(I2C0,I2C_FLAG_ADDSEND);
/* wait until the transmit data buffer is empty */
while( SET != i2c_flag_get(I2C0, I2C_FLAG_TBE)){};
i2c_data_transmit(I2C0, ICM426_SOFTWARE_RESET);
/* wait until BTC bit is set */
while(!i2c_flag_get(I2C0, I2C_FLAG_BTC)){};
i2c_stop_on_bus(I2C0);
/* wait until the stop condition is finished */
delay_1ms(15);
}