![]() |
![]() |
BatMon Support layer.
The purpose of the BatMon Support layer is to provide a way for multiple drivers to share the the BATMON hardware resource. The BATMON provides both temperature and supply voltage measurements. For this reason, both the Temperature driver and the Battery Monitor driver depends on the BATMON module.
Only a combined interrupt request for BATMON exists, and this needs to be shared by multiple drivers.
The two main services provided are:
The BatMon Support layer needs to be initialized by calling BatMonSupportLPF3_init(). BatMonSupportLPF3_init() should be called once before using other BatMon Support APIs. Subsequent BatMonSupportLPF3_init() calls will have no effect.
The main function of the BatMon Support layer is to dispatch the combined BATMON interrupt to registered callback functions when certain event flags are set.
There are two functions that register an event callback:
Only one Temperature Callback and one Battery Callback can be registered, and registered callbacks cannot be unregistered.
Go to the source code of this file.
Data Structures | |
struct | BatMonSupportLPF3_Config |
BatMon Support Configuration. More... | |
Typedefs | |
typedef void(* | BatMonSupportLPF3_EventCb) (uint32_t eventFlags) |
Function prototype for an event callback. More... | |
Functions | |
void | BatMonSupportLPF3_init (void) |
This function initializes the BatMon Support layer. More... | |
void | BatMonSupportLPF3_registerTemperatureCb (uint32_t eventMask, BatMonSupportLPF3_EventCb callback) |
This function registers a callback dedicated for the Temperature driver. More... | |
void | BatMonSupportLPF3_registerBatteryCb (uint32_t eventMask, BatMonSupportLPF3_EventCb callback) |
This function registers a callback dedicated for the Battery Monitor driver. More... | |
typedef void(* BatMonSupportLPF3_EventCb) (uint32_t eventFlags) |
Function prototype for an event callback.
The callback function is responsible for clearing the event flags associated with the callback
[in] | eventFlags | The event flags read from PMUD.EVENT masked with the event mask used when registering the callback function in BatMonSupportLPF3_registerTemperatureCb() or BatMonSupportLPF3_registerBatteryCb(). |
void BatMonSupportLPF3_init | ( | void | ) |
This function initializes the BatMon Support layer.
This function initializes the internal state of the BatMon Support layer. It must be called before calling any other BatMon Support functions. Subsequent calls to this function have no effect.
void BatMonSupportLPF3_registerTemperatureCb | ( | uint32_t | eventMask, |
BatMonSupportLPF3_EventCb | callback | ||
) |
This function registers a callback dedicated for the Temperature driver.
eventMask
parameter is only used as a filter for when to to call the callback function defined by callback
. The calling function is responsible to setting up BATMON to actually generate the desired events.[in] | eventMask | Event mask used as filter for when to call the callback function defined by callback . In the AON_PMU_COMB ISR the value of PMUD.EVENT will be AND'ed with eventMask , if the result is non-zero the callback function will be called. |
[in] | callback | The callback function that is called by the AON_PMU_COMB ISR if any of the event flags defined by eventMask is set in PMUD.EVENT. |
void BatMonSupportLPF3_registerBatteryCb | ( | uint32_t | eventMask, |
BatMonSupportLPF3_EventCb | callback | ||
) |
This function registers a callback dedicated for the Battery Monitor driver.
eventMask
parameter is only used as a filter for when to to call the callback function defined by callback
. The calling function is responsible to setting up BATMON to actually generate the desired events.[in] | eventMask | Event mask used as filter for when to call the callback function defined by callback . In the AON_PMU_COMB ISR the value of PMUD.EVENT will be AND'ed with eventMask , if the result is non-zero the callback function will be called. |
[in] | callback | The callback function that is called by the AON_PMU_COMB ISR if any of the event flags defined by eventMask is set in PMUD.EVENT. |