Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB superspeed peripherals Forum Discussions

LDX
Level 1
Level 1
5 sign-ins First reply posted First question asked

The second parameter of CyU3PPibRegisterCallback is:

 

uint32_t intMask /**< Bitmask representing the various interrupts callbacks to be enabled.
This value is derived by ORing the various callback types of
interest from the CyU3PPibIntrType enumeration. */

 

But values from the enum CyU3PPibIntrType are not bit masks, then how can these values be ORed together?

For example, if only CYU3P_PIB_ERR_THR0_WR_OVERRUN and CYU3P_PIB_ERR_THR1_RD_UNDERRUN is needed, then how to set intMask of CyU3PPibRegisterCallback?

0 Likes
1 Solution
Bakal
Moderator
Moderator
Moderator
50 sign-ins 10 solutions authored 25 replies posted

Hello,

In CyU3PPibRegisterCallback when the CYU3P_PIB_INTR_ERROR=4, it masks the GPIF_ERR bit 31 and PIB_ERR bit 29 as mentioned in the TRM.

Bakal_0-1671107778990.png

For more information, you can go through the source file of CyU3PPibRegisterCallback in SDK.

Regards,
Sakshi Bakal

 

View solution in original post

0 Likes
3 Replies
Bakal
Moderator
Moderator
Moderator
50 sign-ins 10 solutions authored 25 replies posted

Hello,

The second parameter of the CyU3PPibRegisterCallback is to enable the PIB interrupts, so if you set the second parameter as 0xffff it will enable all the PIB interrupts. 

Regards,
Sakshi Bakal

0 Likes
LDX
Level 1
Level 1
5 sign-ins First reply posted First question asked

The problem is, when I try to check what values are inside CyU3PPibIntrType , what I indeed check is CyU3PPibErrorType. There is no problems with CyU3PPibIntrType and the valued CYU3P_PIB_INTR_ERROR=4 should be used.

But there is one more problem: in EZ-USB FX3 TRM, the register PIB_INTR_MASK doesn't have bit 2 (1<<2=4=CYU3P_PIB_INTR_ERROR) at all, it have GPIF_INTERRUPT as bit 4, corresponding to 1<<4=16 instead of 4=CYU3P_PIB_INTR_ERROR. Also, the TRM doesn't give an explaination of what those bits mean in PIB_INTR_MASK.

 

0 Likes
Bakal
Moderator
Moderator
Moderator
50 sign-ins 10 solutions authored 25 replies posted

Hello,

In CyU3PPibRegisterCallback when the CYU3P_PIB_INTR_ERROR=4, it masks the GPIF_ERR bit 31 and PIB_ERR bit 29 as mentioned in the TRM.

Bakal_0-1671107778990.png

For more information, you can go through the source file of CyU3PPibRegisterCallback in SDK.

Regards,
Sakshi Bakal

 

0 Likes