CC26xx Driver Library
[aon_batmon] AON Battery Monitor

Functions

static void AONBatMonEnable (void)
 Enable the temperature and battery monitoring. More...
 
static void AONBatMonDisable (void)
 Disable the temperature and battery monitoring. More...
 
int32_t AONBatMonTemperatureGetDegC (void)
 Get the current temperature measurement as a signed value in Deg Celsius. More...
 
static uint32_t AONBatMonBatteryVoltageGet (void)
 Get the battery monitor measurement. More...
 
static bool AONBatMonNewBatteryMeasureReady (void)
 Check if battery monitor measurement has changed. More...
 
static bool AONBatMonNewTempMeasureReady (void)
 Check if temperature monitor measurement has changed. More...
 

Detailed Description

Function Documentation

static uint32_t AONBatMonBatteryVoltageGet ( void  )
inlinestatic

Get the battery monitor measurement.

This function will return the current battery monitor measurement. The battery voltage measurements are updated every cycle.

Note
The returned value is NOT sign-extended!
Use the function AONBatMonNewBatteryMeasureReady() to test for a change in measurement.
Returns
Returns the current battery monitor value of the battery voltage measurement in a <int.frac> format size <3.8> in units of volt.
See also
AONBatMonNewBatteryMeasureReady()

Definition at line 191 of file aon_batmon.h.

static void AONBatMonDisable ( void  )
inlinestatic

Disable the temperature and battery monitoring.

This function will disable the measurements of the temperature and the battery voltage.

Returns
None

Definition at line 144 of file aon_batmon.h.

static void AONBatMonEnable ( void  )
inlinestatic

Enable the temperature and battery monitoring.

This function will enable the measurements of the temperature and the battery voltage.

To speed up the measurement of the levels the measurement can be enabled before configuring the battery and temperature settings. When all of the AON_BATMON registers are configured, the calculation of the voltage and temperature values can be enabled (the measurement will now take effect/propagate to other blocks).

It is possible to enable both at the same time, after the AON_BATMON registers are configured, but then the first values will be ready at a later point compared to the scenario above.

Note
Temperature and battery voltage measurements are not done in parallel. The measurement cycle is controlled by a hardware Finite State Machine. First the temperature and then the battery voltage each taking one cycle to complete. However, if the comparator measuring the battery voltage detects a change on the reference value, a new measurement of the battery voltage only is performed immediately after. This has no impact on the cycle count.
Returns
None

Definition at line 123 of file aon_batmon.h.

static bool AONBatMonNewBatteryMeasureReady ( void  )
inlinestatic

Check if battery monitor measurement has changed.

This function checks if a new battery monitor value is available. If the measurement value has changed since last clear the function returns true.

If the measurement has changed the function will automatically clear the status bit.

Note
It is always possible to read out the current value of the battery level using AONBatMonBatteryVoltageGet() but this function can be used to check if the measurement has changed.
Returns
Returns true if the measurement value has changed and false otherwise.
See also
AONBatMonNewTempMeasureReady(), AONBatMonBatteryVoltageGet()

Definition at line 224 of file aon_batmon.h.

static bool AONBatMonNewTempMeasureReady ( void  )
inlinestatic

Check if temperature monitor measurement has changed.

This function checks if a new temperature value is available. If the measurement value has changed since last clear the function returns true.

If the measurement has changed the function will automatically clear the status bit.

Note
It is always possible to read out the current value of the temperature using AONBatMonTemperatureGetDegC() but this function can be used to check if the measurement has changed.
Returns
Returns true if the measurement value has changed and false otherwise.
See also
AONBatMonNewBatteryMeasureReady(), AONBatMonTemperatureGetDegC()

Definition at line 269 of file aon_batmon.h.

int32_t AONBatMonTemperatureGetDegC ( void  )

Get the current temperature measurement as a signed value in Deg Celsius.

This function returns an calibrated and rounded value in degree Celsius. The temperature measurements are updated every cycle.

Note
The temperature drifts slightly depending on the battery voltage. This function compensates for this drift and returns a calibrated temperature.
Use the function AONBatMonNewTempMeasureReady() to test for a new measurement.
Returns
Returns signed integer part of temperature in Deg C (-256 .. +255)
See also
AONBatMonNewTempMeasureReady()

Definition at line 60 of file aon_batmon.c.

Referenced by OSCHF_GetStartupTime(), OSCHF_SwitchToRcOscTurnOffXosc(), SysCtrlAdjustRechargeAfterPowerDown(), and SysCtrlSetRechargeBeforePowerDown().