Results 1 to 2 of 2

Thread: Query:How to change brightness of a screen(framebuffer) using Qtopia ?

  1. #1
    Join Date
    May 2009
    Posts
    1
    Qt products
    Platforms
    Unix/X11

    Smile Query:How to change brightness of a screen(framebuffer) using Qtopia ?

    Hi All,
    I have been developed a GUI for WIreless access point which is displaying on the LCD(framebuffer) screen, that GUI has LCD settings options like brightness, contrast and sharpness.

    Here when I run GUI the Qtopia will open framebuffer device and writes GUI data to it, So how can I get that file descriptor to call proper ioctl's in my program to change brightness, contrast and sharp. Or otherwise can I open the same framebuffer device again and use that file descriptor?

    Please help out on this issue.

    Thanks in advance
    Suresh S Gani

  2. #2
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Query:How to change brightness of a screen(framebuffer) using Qtopia ?

    Hi,
    I was able to access the device directly using the /dev/fb. This is a simple routine for blanking the LCD.

    Qt Code:
    1. int lcdBlank(bool val)
    2. {
    3. int fbfd;
    4. int blank = 0;
    5. int ret = 0;
    6.  
    7. if(val == true)
    8. blank = FB_BLANK_POWERDOWN;
    9. else
    10. blank = FB_BLANK_UNBLANK;
    11.  
    12. fbfd = open(FBDEVFILE, O_RDWR);
    13. if(fbfd < 0)
    14. {
    15. printf("Could Not Open FB for blanking\n");
    16. return -1;
    17. }
    18.  
    19. ret = ioctl(fbfd,FBIOBLANK, &blank);
    20. if (ret < 0)
    21. printf("Could not exe IOCTL for blanking lcd\n");
    22.  
    23. close(fbfd);
    24. return ret;
    25. }
    To copy to clipboard, switch view to plain text mode 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.