Backlight Control in WinCE

Source: Internet
Author: User

To control the backlight, you must know the relevant settings. The following is the configuration of the backlight in wince. It is read in the bl_readregistry function.

  1. [HKEY_CURRENT_USER/controlpanel/backlight]
  2. "Actimeout" = DWORD: 0000012c
  3. "Useext" = DWORD: 00000001
  4. "Usebattery" = DWORD: 00000001
  5. "Batterytimeout" = DWORD: 0000003c

The driver backlite is a backlight control driver, but it is an incomplete driver. You need to write code control based on your own platform. Different circuit control methods are different and related to LCD. First, complete void backlightctrl (bool blight), the control function of your platform ). Below are my own functions.

 

  1. Void backlightctrl (bool blight)
  2. {
  3. Volatile iopreg * s2410iop;
  4. S2410iop = (iopreg *) iop_base;
  5. S2410iop-> rgpgcon & = ~ (3 <8 );
  6. S2410iop-> rgpgcon | = (1 <8 );
  7. If (blight)
  8. {
  9. S2410iop-> rgpgdat | = (1 <4 );
  10. Retailmsg (1, (text ("turn on! /R/N ")));
  11. }
  12. Else
  13. {
  14. S2410iop-> rgpgdat & = ~ (1 <4 );
  15. Retailmsg (1, (text ("turn off! /R/N ")));
  16. }
  17. }

Then, in bl_monitorthread, the backlight will be switched ON and OFF based on different events. If your LCD supports brightness adjustment, it can be handled similarly. In addition, to enable automatic LCD recovery when operating the touch screen, you also need to add the "userinputevent" event to the touch screen driver and set the event by pressing or lifting it. In this way, it can be associated with the backlight driver. The keyboard driver is similar.

 

In addition, add

  1. [HKEY_LOCAL_MACHINE/Drivers/builtin/backlite]
  2. "Index" = DWORD: 0
  3. "Prefix" = "Bak"
  4. "DLL" = "backlite. dll"
  5. "Order" = DWORD: 29

Add in platform. bib

  1. Backlite. dll $ (_ flatreleasedir)/backlite. dll NK sh

Note: If the "Copy of dirs" and "dirs" files in the DRIVERS directory do not have driver information, you need to add them by yourself, this mainly enables PB to compile and copy the generated files to the $ (_ flatreleasedir) directory. If you do not add the files, manually compile the files with cmd and copy the files, finally, use make image to generate the system.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.