Functions | |
__STATIC_INLINE void | AONBatMonEnable (void) |
Enable the temperatur and battery monitoring. More... | |
__STATIC_INLINE void | AONBatMonDisable (void) |
Disable the temperatur and battery monitoring. More... | |
__STATIC_INLINE void | AONBatMonMeasurementCycleSet (uint32_t ui32Cycle) |
Adjust the measurement cycle for the temperature and the battery voltage. More... | |
__STATIC_INLINE uint32_t | AONBatMonMeasurementCycleGet (void) |
Get the measurement cycle for the temperature and the battery voltage. More... | |
__STATIC_INLINE void | AONBatMonBatteryTrimSet (uint32_t ui32TrimP0, uint32_t ui32TrimP1) |
Set the trim values for the battery voltage calculation. More... | |
__STATIC_INLINE void | AONBatMonTemperatureTrimSet (uint32_t ui32TrimP0, uint32_t ui32TrimP1, uint32_t ui32TrimP2) |
Set the trim values for the temperature calculation. More... | |
__STATIC_INLINE uint32_t | AONBatMonTemperatureGet (void) |
Get the current temperature measurement. More... | |
int32_t | AON_BatmonTempGetDegC (void) |
Get the current temperature measurement as a signed value in Deg Celsius. More... | |
__STATIC_INLINE uint32_t | AONBatMonBatteryVoltageGet (void) |
Get the battery monitor measurement. More... | |
__STATIC_INLINE bool | AONBatMonNewBatteryMeasureReady (void) |
Check if battery monitor measurement has changed. More... | |
__STATIC_INLINE bool | AONBatMonNewTempMeasureReady (void) |
Check if temperature monitor measurement has changed. More... | |
int32_t AON_BatmonTempGetDegC | ( | 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 as defined using AONBatMonMeasurementCycleSet().
Definition at line 55 of file aon_batmon.c.
Referenced by OSCHF_GetStartupTime(), OSCHF_SwitchToRcOscTurnOffXosc(), SysCtrlAdjustRechargeAfterPowerDown(), and SysCtrlSetRechargeBeforePowerDown().
__STATIC_INLINE void AONBatMonBatteryTrimSet | ( | uint32_t | ui32TrimP0, |
uint32_t | ui32TrimP1 | ||
) |
Set the trim values for the battery voltage calculation.
The trim value must be setup correctly before enabling the battery voltage measurement, to ensure correct calculation and system behaviour. The output from the battery monitor measurement is a 10 bit vector with a 2 bit integer part and an 8 bit fractional part in the range 0 to 3,9961 volt.
(352 + ui32TrimP1) (128 + ui32TrimP0) x Vbmon Vout = ------------------- + ----------------------------- 2^8 2^12
ui32TrimP0 | is a 6 bit trim value. |
ui32TrimP1 | is a 6 bit trim value. |
Definition at line 230 of file aon_batmon.h.
__STATIC_INLINE uint32_t AONBatMonBatteryVoltageGet | ( | void | ) |
Get the battery monitor measurement.
This function will return the current battery monitor measurement. The battery voltage measurements are updated every cycle as defined using AONBatMonMeasurementCycleSet().
Definition at line 367 of file aon_batmon.h.
__STATIC_INLINE void AONBatMonDisable | ( | void | ) |
Disable the temperatur and battery monitoring.
This function will disable the measurements of the temperature and the battery voltage.
Definition at line 138 of file aon_batmon.h.
__STATIC_INLINE void AONBatMonEnable | ( | void | ) |
Enable the temperatur 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 temperatur 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.
Definition at line 117 of file aon_batmon.h.
__STATIC_INLINE uint32_t AONBatMonMeasurementCycleGet | ( | void | ) |
Get the measurement cycle for the temperature and the battery voltage.
This function returns the value of the register AON_BATMON_O_MEASCFG which contains the settings for the measurement interval.
Definition at line 196 of file aon_batmon.h.
__STATIC_INLINE void AONBatMonMeasurementCycleSet | ( | uint32_t | ui32Cycle | ) |
Adjust the measurement cycle for the temperature and the battery voltage.
The AON battery and temperature monitor can measure continously or wait a predefined number of BATMON clock cycles between each measurement. This function is used to adjust the length of the measurement cycle in number of BATMON clock cycles.
ui32Cycle | defines the number of clock cycles between each measurement.
|
Definition at line 167 of file aon_batmon.h.
__STATIC_INLINE bool AONBatMonNewBatteryMeasureReady | ( | void | ) |
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.
true
if the measurement value has changed and false
otherwise.Definition at line 400 of file aon_batmon.h.
__STATIC_INLINE bool AONBatMonNewTempMeasureReady | ( | void | ) |
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.
true
if the measurement value has changed and false
otherwise.Definition at line 445 of file aon_batmon.h.
__STATIC_INLINE uint32_t AONBatMonTemperatureGet | ( | void | ) |
Get the current temperature measurement.
This function will return the current temperature measurement. The temperature measurements are updated every cycle as defined using AONBatMonMeasurementCycleSet().
Definition at line 315 of file aon_batmon.h.
__STATIC_INLINE void AONBatMonTemperatureTrimSet | ( | uint32_t | ui32TrimP0, |
uint32_t | ui32TrimP1, | ||
uint32_t | ui32TrimP2 | ||
) |
Set the trim values for the temperature calculation.
The trim value must be setup correctly before enabling the temperature measurement, to ensure correct calculation and system behaviour.The output from the temperature monitor measurement is a signed 10 bit vector with an 8 bit integer part and a 2 bit fractional part in the range -128 C to +127,75 C with a resolution of 0,25 C.
(-384 + ui32TrimP2) (256 + ui32TrimP1) x Temp (64 + ui32TrimP0) x Temp^2 Vout = ------------------- + ---------------------------- + ---------------------------- 2^2 2^8 2^12
ui32TrimP0 | is an 8 bit trim value. |
ui32TrimP1 | is a 6 bit trim value. |
ui32TrimP2 | is a 5 bit trim value. |
Definition at line 273 of file aon_batmon.h.
#define AON_BATMON_CYCLE_16 AON_BATMON_MEASCFG_PER_16CYC |
Definition at line 76 of file aon_batmon.h.
Referenced by AONBatMonMeasurementCycleSet().
#define AON_BATMON_CYCLE_32 AON_BATMON_MEASCFG_PER_32CYC |
Definition at line 74 of file aon_batmon.h.
Referenced by AONBatMonMeasurementCycleSet().
#define AON_BATMON_CYCLE_8 AON_BATMON_MEASCFG_PER_8CYC |
Definition at line 78 of file aon_batmon.h.
Referenced by AONBatMonMeasurementCycleSet().
#define AON_BATMON_CYCLE_CONT AON_BATMON_MEASCFG_PER_CONT |
Definition at line 80 of file aon_batmon.h.
Referenced by AONBatMonMeasurementCycleSet().