This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

motorware 中添加I2C

Other Parts Discussed in Thread: MOTORWARE

我想在motorware proj_lab3a例程中加入I2C程序;

1.  在hal_obj.h  中的HAL_Obj结构体添加了

    I2C_Handle i2cHandle;
    I2C_Obj i2c;

2.在hal.c中添加了

 硬件初始化

// initialize the I2C
  obj->i2cHandle = I2C_init((void *)I2CA_BASE_ADDR,sizeof(I2C_Obj));

//  配置了IIC

  HAL_setupI2C(handle);

3.  程序编辑通过;

    但在仿真时IIC寄存器并没有写成功,求助是什么原因