一直卡在标红这行,请问有知道的么,谢谢
int main(void)
{
int i;
/* RCU config */
rcu_config();
/* GPIO config */
gpio_config();
/* I2C config */
i2c_config();
for(i=0; i<16; i++){
i2c_transmitter=i+0x80;
}
/* wait until I2C bus is idle */
while(i2c_flag_get(BOARD_I2C, I2C_FLAG_I2CBSY));
/* send a start condition to I2C bus */
i2c_start_on_bus(BOARD_I2C);
/* wait until SBSEND bit is set */
while(!i2c_flag_get(BOARD_I2C, I2C_FLAG_SBSEND));
/* send slave address to I2C bus */
i2c_master_addressing(BOARD_I2C, I2C_SLAVE_ADDRESS7, I2C_TRANSMITTER);
/* wait until ADDSEND bit is set */
while(!i2c_flag_get(BOARD_I2C, I2C_FLAG_ADDSEND));
/* clear ADDSEND bit */
i2c_flag_clear(BOARD_I2C, I2C_STAT0_ADDSEND);
/* wait until the transmit data buffer is empty */
while(!i2c_flag_get(BOARD_I2C, I2C_FLAG_TBE));
for(i=0; i<16; i++){
/* data transmission */
i2c_data_transmit(BOARD_I2C, i2c_transmitter);
/* wait until the TBE bit is set */
while(!i2c_flag_get(BOARD_I2C, I2C_FLAG_TBE));
}
/* send a stop condition to I2C bus */
i2c_stop_on_bus(BOARD_I2C);
while(I2C_CTL0(BOARD_I2C)&0x0200);
/* infinite loop */
while(1){
}
}
|