5 Replies Latest reply on Apr 2, 2020 4:47 PM by roMo_4201811

    Brightness control with KBA225062

    roMo_4201811

      Hello,

      I edited my project using the steps described in KBA225062 to enable brightness control, but the brightness slider does not appear in camera controls of any of the video tools (Amcap, MPC-HC, ecamview). All sliders are grayed out.

      Any suggestions how to get the slider to appear?

        • 1. Re: Brightness control with KBA225062
          JayakrishnaT_76

          Hello,

           

          Please confirm that you are using the denebola kit and want to implement the brightness control feature in the SDK project Cx3UvcOV5640.

           

          Best Regards,

          Jayakrishna

          • 2. Re: Brightness control with KBA225062
            roMo_4201811

            Hi,

            I am using the Denebola kit with our own imager board with OnSemi AR0144 imager. I got the imager board working streaming images @ 30ips before starting this brightness enhancement. My code is derived from the project Cx3UvcOV5640 but has obviously been changed to support the new imager. Any help you can provide is appreciated.

            Regards,

            Rockie

            • 3. Re: Brightness control with KBA225062
              JayakrishnaT_76

              Hello,

               

              Please comment all the changes that you made from the KBA and make the following changes and let me know if you are able to see the brightness slider.

              1. Inside the Processing Unit Descriptor found in cycx3_Uvcdscr.cmake the following change:

               

              2. Inside the function CyCx3AppUSBSetupCB in cycx3_uvc.c, you can find the following line of code:

               

              else if (CY_U3P_GET_LSB(wIndex) == CX3_APP_CONTROL_INTERFACE)

               

              Replace everything inside this elseif statement with the following lines of code:

               

                      isHandled = CyTrue;

                      if((wIndex == 0x200) && (wValue == 0x200))/*Brightness*/

                      {

                      switch(bRequest)

                      {

                                    case CX3_USB_APP_GET_INFO_REQ:

               

               

                                       gl16GetControl = 3;

                                       CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                       isHandled = CyTrue;

               

               

                      break;

                                    case CX3_USB_APP_GET_MIN_REQ:

               

               

                                    gl16GetControl = 0;

                                    CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                    break;

                                    case CX3_USB_APP_GET_MAX_REQ:

                                    gl16GetControl = 100;

                                    CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                    break;

               

               

                                    case CX3_USB_APP_GET_RES_REQ:

                                    gl16GetControl = 1;

                                        CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                        break;

                                    case CX3_USB_APP_GET_CUR_REQ:

               

               

                                    gl16GetControl = 15;

                                    CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                    break;

               

               

                                    case CX3_USB_APP_GET_DEF_REQ:

                                    gl16GetControl = 15;

                                    CyU3PUsbSendEP0Data (2, (uint8_t*)&gl16GetControl);

                                    break;

               

               

                                    case CX3_USB_APP_SET_CUR_REQ:

                                    status = CyU3PUsbGetEP0Data(16,(uint8_t*)&gl16SetControl,&readCount);

                                    break;

               

               

              Make sure that you declare the global variables gl16GetControl and glSetControl at the start of cycx3_uvc.c file as follows:

              uint16_t gl16GetControl = 0;

              uint16_t gl16SetControl = 0;

               

               

              3. Now build the project and check if you are able to see the brightness slider. I verified this on my end using denebola kit and found that it was there.

               

              Note: This just makes the brightness slider appear only. As you might be knowing to actually change the brightness, you need to write to the corresponding register of the mage sensor. This can be done by writing the value obtained in the global variable gl16SetControl to the appropriate register of the image sensor via I2C.

               

              Best Regards,

              Jayakrishna

              • 4. Re: Brightness control with KBA225062
                roMo_4201811

                Yes that worked! The brightness slide is there. I will now make the other changes described in kba225062 to process the brightness value.

                Thanks very much for your help.

                Rockie

                • 5. Re: Brightness control with KBA225062
                  roMo_4201811

                  I was able to get it fully operational by just adding my sensor specific function calls to your code. Much easier than kba225062. I was able to add gain control as well. Consider this item closed.

                  Thanks for your support.

                  Rockie