Setting backlight

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting backlight

1,119 Views
andersbergström
Contributor II

Hi,

I am currently trying to set the backlight level for a display on a eval board.

I have read the reference manual for the i.MX51 EVK Windows Embedded Compact 7 and I have added the "BSP_PMIC_MC13892 = 1" to the BSP environment variales.

I use the following code without result.

BKL_SETTINGS_INFO bklInfo;

HANDLE hDevice = NULL;

  hDevice = CreateFile(TEXT("PMI1:"), GENERIC_READ |GENERIC_WRITE,

  FILE_SHARE_WRITE | FILE_SHARE_READ,       // Share

  NULL,                   // No security

  OPEN_EXISTING,          // Only open...

  FILE_FLAG_RANDOM_ACCESS,// Flags

  NULL);                  // No template file

  if ((hDevice == NULL) || (hDevice == INVALID_HANDLE_VALUE))

  {

       Trace::getInstance().log(USE_LEVEL_ERROR, "Unable to open device");

  }

  bklInfo.fEnable_Battery = FALSE;

  bklInfo.fEnable_ExPower = FALSE;

  bRes = DeviceIoControl(hDevice, IOCTL_BKL_SET_SETTINGS, &bklInfo, sizeof(bklInfo), NULL, 0, NULL, NULL);

  CloseHandle(hDevice);

I´m not even sure that i use the correct function calls since i have not been able to find any examples of how to configure the driver.

Best Regards,

/ Anders

Labels (3)
0 Kudos
2 Replies

868 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi Anders,

The PMIC driver can be tested using the following actions:

- The command line for running the PMIC tests is s i2cpmic

- Use the touch driver to test MC13892 touch function

- Use the battery driver to test MC13892 battery function

- Use the backlight driver to test MC13892 backlight function All of these actions calls the same APIs that you are trying to use and they works perfectly with the EVK, please check the chapter 15.6 of the Wince

Reference manual for information about backlight APIs and signaling LED.

Hope this helps

0 Kudos

868 Views
andersbergström
Contributor II

Hi,

I am new to Windows Embedded so i might got something wrong.

I im trying to use the functions, as described in the reference manual, to initialy read the backlight level without any success.

HANDLE hDevice = NULL;

  UINT8 lvl = 0;

  hDevice = CreateFile(TEXT("PMI1:"), GENERIC_READ |GENERIC_WRITE,

  FILE_SHARE_WRITE | FILE_SHARE_READ,      // Share

  NULL,                  // No security

  OPEN_EXISTING,          // Only open...

  FILE_FLAG_RANDOM_ACCESS,// Flags

  NULL);                  // No template file

  if ((hDevice == NULL) || (hDevice == INVALID_HANDLE_VALUE))

  {

  Trace::getInstance().log(USE_LEVEL_ERROR, "Unable to open device");

  }

  PmicBacklightGetCurrentLevel(BACKLIGHT_MAIN_DISPLAY, &lvl);

  Trace::getInstance().log(USE_LEVEL_ERROR, "Backlight level: %d", lvl);

  PmicBacklightGetCurrentLevel(BACKLIGHT_AUX_DISPLAY, &lvl);

  Trace::getInstance().log(USE_LEVEL_ERROR, "Backlight 2 level: %d", lvl);

  PmicBacklightGetCurrentLevel(BACKLIGHT_KEYPAD, &lvl);

  Trace::getInstance().log(USE_LEVEL_ERROR, "Backlight 3 level: %d", lvl);

  PmicBacklightGetDutyCycle(BACKLIGHT_MAIN_DISPLAY, &lvl)

  Trace::getInstance().log(USE_LEVEL_ERROR, "Duty cycle level: %d", lvl);

  PmicBacklightGetDutyCycle(BACKLIGHT_AUX_DISPLAY, &lvl)

  Trace::getInstance().log(USE_LEVEL_ERROR, "Duty cycle 2 level: %d", lvl);

  PmicBacklightGetDutyCycle(BACKLIGHT_KEYPAD, &lvl)

  Trace::getInstance().log(USE_LEVEL_ERROR, "Duty cycle 3 level: %d", lvl);

Is there anything that needs to be done with the project settings? What files should i include.

That is unclear from the reference manual.

Also, there is a function called "BSPBacklightSetIntensity" in bspbacklight.cpp. Is it possible to use that one?

Best regards,

/ Anders

0 Kudos