CY_DEVICE_SERIAL_BLOCK question

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

cross mob
DeCh_4514661
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

Hello Cypress,

Could you please advise how I can identify SBC0/SBC1 of cy7c65216D if both of them are set as I2C?

I am using linux C++ cyusbserial API and want to control 12 GPIOs, do I need to grab both handles of SBC0 and SBC1?

Thanks!

Derlin

  

0 Likes
1 Solution
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received
5 Replies
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Derlin,

Please refer this KBA: https://community.infineon.com/t5/Knowledge-Base-Articles/USB-Serial-Bridge-Controller-Managing-I-Os... for managing GPIOs with API.

Best Regards

Hi Meghavi,

Thank you for your reply. Based on the link you sent me, there is no need for me to grab handle by checking "CY_TYPE_I2C"? as below.

Derlin

 

rStatus = CyGetListofDevices(&numDevices);
printf("Number of Decice: %d \n",numDevices);

if ((rStatus != CY_SUCCESS) || (numDevices == 0))
{
printf(" Did not get it");
}

for (DeviceIdx = 0; DeviceIdx < numDevices; DeviceIdx++)
{
rStatus = CyGetDeviceInfo(DeviceIdx, &DeviceInfo);
if (rStatus != CY_SUCCESS)
{
continue;
}
for (InterfaceIdx = 0; InterfaceIdx < DeviceInfo.numInterfaces; InterfaceIdx++)
{
if (DeviceInfo.deviceType[InterfaceIdx] == CY_TYPE_I2C)
{
devicenumber[indexNumber]=DeviceIdx;
interfacenum[indexNumber]=InterfaceIdx;
printf("found I2C DeviceIndex: %d, InterfaceIndex: %d \n", DeviceIdx, InterfaceIdx);
indexNumber++;
}
}
}

 

0 Likes
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Derlin,

It is not necessary to check the Interface type. However, it won't affect any functionality if it is used. 

Best Regards

0 Likes
DeCh_4514661
Level 1
Level 1
5 replies posted 5 questions asked First reply posted

Hi Meghavi,

Can I ask one more question?

When I check the devices (rStatus = CyGetListofDevices(&numDevices);), usually it will return several devices (cypress devices?? why there are many devices), then I can further check the serial number to get the device I want then grab the handle without checking the  CY_TYPE_I2C?

 

Thanks!

Derlin 

 

 

 

0 Likes
Meghavi
Moderator
Moderator
Moderator
250 replies posted 100 solutions authored 10 likes received

Hi Derlin,

You can refer the function findCypressDevice() mentioned in the KBA and get the cypress devices. After getting the cypress device you can grab the handle without checking CY_TYPE_I2C.

Best Regards

0 Likes