# PM_GetAmpGain

## C Specification

      #include <nitro/spi.h>

      u32 PM_GetAmpGain( PMAmpGain* gainBuf );

## Arguments

gainBuf | The buffer that stores the results of settings that determine the amp gain.

## 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.

## Description

This function gets the current setting for the gain of the programmable gain amp.
The value of the `PMAmpGain` enumerator type is saved in the gainBuf argument and can contain either one of the following values:

`PM_AMPGAIN_20` | gain = 20 times
`PM_AMPGAIN_40` | gain = 40 times
`PM_AMPGAIN_80` | gain = 80 times
`PM_AMPGAIN_160` | gain = 160 times

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. Therefore, this function may not operate promptly after you call it. 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

Reads the value of the PMIC register PGA_GAIN.

## See Also

`PM_Init`, `PM_SetAmpGain*`

## Revision History

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

CONFIDENTIAL