You are here

CyU3PI2cSetConfig problem | Cypress Semiconductor

CyU3PI2cSetConfig problem

Summary: 1 Reply, Latest post by sksm on 01 Jul 2011 06:48 AM PDT
Verified Answers: 1
Last post
Log in to post new comments.
gd_net's picture
20 posts


I try to get the I2C interface working without DMA.

My initialisation looks like following:

    CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
    CyU3PI2cConfig_t config;

    CyU3PDebugPrint (4, "CyU3PI2cInit...\r\n");
    status = CyU3PI2cInit();
    if(status != CY_U3P_SUCCESS){
        CyU3PDebugPrint (4, "CyU3PI2cInit Failed, Error Code = %x\r\n",status);
        return status;

    config.bitRate = 100000;
    config.isDma = CyFalse;
    config.busTimeout = 0xFFFFFFFFU;
    config.dmaTimeout = 0xFFFF;

    status = CyU3PI2cSetConfig(&config, &IS_I2cIR);
    if(status != CY_U3P_SUCCESS)
        CyU3PDebugPrint (4, "CyU3PI2cSetConfig Failed, Error Code = %x\r\n",status);
        return status;

   CyU3PI2cSetConfig fails with errorcode CY_U3P_ERROR_BAD_ARGUMENT.

   When setting "config.isDma = CyTrue", CyU3PI2cSetConfig returns with CY_U3P_SUCCESS.

   What could be wrong?

   Best regards





sksm's picture
Cypress Employee
1 post


In the function CyU3PI2cSetConfig, the second argument is the callback. This callback is used only when the DMA mode is used. So if the DMA mode is set to CyFalse, then you dont need to pass this callback argument. This is triggering the BAD_ARGUMENT error.



Log in to post new comments.