# PM_GetBackLight

## C Specification

      #include <nitro/spi.h>

      u32 PM_GetBackLight( PMBackLightSwitch* top, PMBackLightSwitch* bottom );

## Arguments

top | Buffer where the state of the upper screen backlight is written.
bottom | Buffer where the state of the lower screen backlight is written.

## Return Values

The `PM_RESULT_SUCCESS` return value indicates that the execution of the command has succeeded. The `PM_RESULT_ERROR` return value indicates that an error has occurred with the ARM7 processor.

This function obtains and writes the backlight state in the address indicated by top and bottom. The saved values are as follows:

`PM_BACKLIGHT_ON` | Backlight is ON.
`PM_BACKLIGHT_OFF ` | Backlight is OFF.

## Description

Checks the state of the backlight.

The `top` and `bottom` arguments are pointers to the `PMBackLightSwitch` type. The results of this function are stored here. When a NULL pointer is specified, it does not write the backlight state that corresponds to that display.

This function uses PXI to send the command that performs the corresponding operation in the ARM7 processor. The ARM7 side that receives that command is executed by operating the PMIC. Before you use this function, initialize the PM library by using the `PM_Init()` function. The `PM_Init()` function has to be called only once. Also, when you call `OS_Init()`, there is no need to call `PM_Init()` separately since it is called from within `OS_Init()`.)

Note: If `PM_RESULT_ERROR` was returned as the return value, it is usually an unrecoverable error. It might be returned when ARM7 is not ready or the variable region was destroyed. If this is returned there may be a problem in the program.

## Internal Operation

This function reads the PMIC_CTL value of the PMIC register.

## See Also

`PM_Init`, `PMSetBackLight`

## Revision History

07/07/2005 Referred to the return value, `PM_RESULT_ERROR`.
08/09/2004 Initial version.