# PM_GetBackLight

## C Specification

      #include <nitro/spi.h>

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

## Description

Checks the state of the backlight

The `top` and `bottom` arguments are pointers to the `PMBackLightSwitch` type. The results of these arguments 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.

`PM_Init()` only has to be called once. Also, when you call `OS_Init()`, there is no need to call `PM_Init()` separately since it is called from within `OS_Init()`.

## Internal Operation

Reads the value of the PMIC register PMIC_CTL.

## Arguments

`top` | Buffer that writes the state of the upper screen backlight
`bottom` | Buffer that writes the state of the lower screen backlight

## 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 in the ARM7 processor.

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

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

## See Also

`PM_Init`, `PMSetBackLight`

## Revision History

08/09/2004 Initial version