cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

MaAr_2545856
New Contributor II

I want to enable all the camera control listed in the attached image.what all changes I have to do in the fx3 firmware.video-parameters.PNG

0 Likes
1 Solution
YangyangC_06
Employee

In this response, I will take the procedures to enable brightness control as an example.

  • Enable the bmControl bit in the corresponding descriptor.

BaiduShurufa_2018-8-15_15-50-39.bmp

  • Add the handle function in USBSetupCB(in the switch case statement related to control interface)
  • Create a user thread(EP0 thread in this example) to handle the event related to control interface.

            if (eventFlag & CX3_UVC_VIDEO_CONTROL_REQUEST_EVENT)

            {

                switch ((wIndex >> 8))

                {

                    case CX3_UVC_PROCESSING_UNIT_ID:

                        UVCHandleProcessingUnitRqts ();

                        break;

//                    case CY_FX_UVC_CAMERA_TERMINAL_ID:

//                        UVCHandleCameraTerminalRqts ();

//                        break;

//

//                    case CY_FX_UVC_INTERFACE_CTRL:

//                        UVCHandleInterfaceCtrlRqts ();

//                        break;

//

//                    case CY_FX_UVC_EXTENSION_UNIT_ID:

//                        UVCHandleExtensionUnitRqts ();

//                        break;

                    default:

                        /* Unsupported request. Fail by stalling the control endpoint. */

                        CyU3PUsbStall (0, CyTrue, CyFalse);

                        break;

                }

            }

  • Create the function UVCHandleProcessingUnitRqts to handle all the supported requests.

You could check the attachment for detailed information.  I am afriad that I miss something above.

View solution in original post

0 Likes
5 Replies
YangyangC_06
Employee

In this response, I will take the procedures to enable brightness control as an example.

  • Enable the bmControl bit in the corresponding descriptor.

BaiduShurufa_2018-8-15_15-50-39.bmp

  • Add the handle function in USBSetupCB(in the switch case statement related to control interface)
  • Create a user thread(EP0 thread in this example) to handle the event related to control interface.

            if (eventFlag & CX3_UVC_VIDEO_CONTROL_REQUEST_EVENT)

            {

                switch ((wIndex >> 8))

                {

                    case CX3_UVC_PROCESSING_UNIT_ID:

                        UVCHandleProcessingUnitRqts ();

                        break;

//                    case CY_FX_UVC_CAMERA_TERMINAL_ID:

//                        UVCHandleCameraTerminalRqts ();

//                        break;

//

//                    case CY_FX_UVC_INTERFACE_CTRL:

//                        UVCHandleInterfaceCtrlRqts ();

//                        break;

//

//                    case CY_FX_UVC_EXTENSION_UNIT_ID:

//                        UVCHandleExtensionUnitRqts ();

//                        break;

                    default:

                        /* Unsupported request. Fail by stalling the control endpoint. */

                        CyU3PUsbStall (0, CyTrue, CyFalse);

                        break;

                }

            }

  • Create the function UVCHandleProcessingUnitRqts to handle all the supported requests.

You could check the attachment for detailed information.  I am afriad that I miss something above.

View solution in original post

0 Likes
YangyangC_06
Employee

I attach the firmware for CX3. But it doesn't matter.

0 Likes
MaAr_2545856
New Contributor II

I want to enable camera terminal request. I tried changing the value in the descriptor. But in the AMcap the camera control tab was disabled.

  0xFF,0x03,0x00,                 /* bmControls field of camera terminal: No controls supported */

What changes I have to make for enabling the options as shown in figure.

0x03,                           /* Size of controls field for this terminal : 3 bytes */

                                        /* A bit set to 1 indicates that the mentioned Control is

                                         * supported for the video stream in the bmControls field

                                         * D0: Scanning Mode

                                         * D1: Auto-Exposure Mode

  

                                         */

#ifdef UVC_PTZ_SUPPORT

        0x00,0x0A,0x00,                 /* bmControls field of camera terminal: PTZ supported */

#else

        0x00,0x00,0x00,                 /* bmControls field of camera terminal: No controls supported */

0 Likes
YangyangC_06
Employee

You need to debug your firmware to find the error.  Using some software tools, like BUS HOUND, may help you a lot.

In addition, UART printting is also helpful.

In general, you need to confirm the get/set command are well handled in your firmare.

Of course, you need to define the necessary macros for this feature. I have done that in my example above.

Just as I have said, the implement steps of this feature are the same for CX3 and FX3. It doesn't depend on that since they are both UVC cameras.

If you  insist to get an example based on FX3, you could refer to AN75779.

http://www.cypress.com/documentation/application-notes/an75779-how-implement-image-sensor-interface-...