5 Replies Latest reply on May 10, 2018 4:10 AM by abga

    gpio simulation i2c problem

    jimmjimmshen_1759911

      i try to usb GPIO to simulate i2c peripheral

      send data is fine but i cant read SDA value

       

      this how i init SDA pin

       

      apiRetStatus = CyU3PDeviceGpioOverride(25, CyTrue);

      if (apiRetStatus != 0) {

      CyU3PDebugPrint(4, "CyU3PDeviceGpioOverride failed, error code = %d\n", apiRetStatus);

      }

      gpioConfig.outValue = CyTrue;

      gpioConfig.driveLowEn = CyTrue;

      gpioConfig.driveHighEn = CyTrue;

      gpioConfig.inputEn = CyTrue;

      gpioConfig.intrMode = CY_U3P_GPIO_NO_INTR;

      apiRetStatus = CyU3PGpioSetSimpleConfig(25, &gpioConfig);

      if (apiRetStatus != CY_U3P_SUCCESS) {

      }

      CyU3PThreadSleep(10);

      CyU3PGpioSetValue(25, CyTrue);

       

       

      while i call CyU3PGpioGetValue function it always return 0;