nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ modem_battery_voltage_get()

int modem_battery_voltage_get ( int *  battery_voltage)

#include <include/modem/modem_battery.h>

Function for retrieving the latest voltage measured automatically during modem wakeup or reception. During modem inactivity, the modem measures battery voltage when this function is called.

Note
This function sends the Nordic-proprietary XVBAT command that reads battery voltage. When the modem is active (either LTE communication or GNSS receiver), the XVBAT command returns the latest voltage measured automatically during modem wakeup or reception. The voltage measured during transmission is not reported. During modem inactivity, the modem measures battery voltage when the XVBAT command is received.
Parameters
[out]battery_voltagePointer to the variable for battery voltage. Battery voltage in mV, with a resolution of 4mV.
Return values
0if successful.
-EINVALif input argument was invalid.
-EFAULTif AT command failed.