Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > CyU3PI2cSetConfig problem

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



CyU3PI2cSetConfig problem
Moderator:
RSKV

Post Reply
Follow this topic



CyU3PI2cSetConfig problem

gd_net posted on 30 Jun 2011 8:06 AM PST
Senior Member
17 Forum Posts

Hello,

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

   g.

 

 

 




Re: CyU3PI2cSetConfig problem

sksm posted on 01 Jul 2011 04:48 AM PST
Cypress Employee
1 Forum Post

Hi,

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.

Thanks,

SKSM






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.