CYApi AltIntfcCount()

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

cross mob
Anonymous
Not applicable

I don't unstand the API method of AltIntfcCount();

The explain is:

This function returns the number of alternate interfaces exposed by the device.

The primary interface (AltSetting == 0) is not counted as an alternate interface.

IN the descriptor it has a interface

1.png

but in the bulkloop application ,why it  +1;,the result is 1

int interfaces = this->m_selectedUSBDevice->AltIntfcCount()+1;   

2.png

0 Likes
1 Solution

Hello,

Please refer to firmware BulkLpAutoCpp builded error

Best regards,

Srinath S

View solution in original post

0 Likes
7 Replies
alamandaa_16
Moderator
Moderator
Moderator
10 likes received First like received

Hi,

Interface descriptors have a bInterfaceNumber field specifying the Interface number and a bAlternateSetting which allows an interface to change settings on the fly.for example you could have device with one interface, that interface has bInterfaceNumber set to zero indicating it is the first interface descriptor and a bAlternativeSetting of zero.

Please refer to following link:"https://www.beyondlogic.org/usbnutshell/usb5.shtml#DeviceDescriptors "

Regards,

Anil Srinivas.

0 Likes
Anonymous
Not applicable

I changed cyfxbulklpdscr's const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32)))

as added another interface ,but when I loaded to FX3,it did work and display.Could you tell me why?

2.png

1.png

0 Likes

Hi,

If you increase the number of interfaces that means indirectly increases the number of devices(i.e number of interfaces proportional to the number of devices). I added two interfaces to bulkloopdescriptor file corresponding devices shows in device manager.twoFX3Devices.PNG

Explanation of your firmware: You have two interfaces in configuration descriptor and device manager shows two devices.

Device-1: Interface one has bInterfaceNumber set to zero indicating it is the first interface descriptor and a bAlternativeSetting of zero.

Device-2: Interface two would have a bInterfaceNumber set to one indicating it is the second interface and a bAlternativeSetting of zero.

Regards,

Anil Srinivas.

0 Likes
Anonymous
Not applicable

Hi !

I added a interface,but  it cann't find.

1.png

2.png

3.png

The result: "The device cannot start (Code 10)".

错误1.png

错误2.png

0 Likes

Hi,

Please do small modifications in above code replace CY_FX_EP_PRODUCER2 with 0x02 and CY_FX_EP_CONSUMER2 with 0x82.

Regards,

Anil Srinivas.

0 Likes
Anonymous
Not applicable

I did it .All the same like before!

0 Likes

Hello,

Please refer to firmware BulkLpAutoCpp builded error

Best regards,

Srinath S

0 Likes