Data Structures | Typedefs | Functions
BatMonSupportLPF3.h File Reference

Detailed Description

BatMon Support layer.


Overview

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:

Note
The BatMon Support layer is not intended to be used by the application. It is only intended to be used by TI drivers.

Usage

Initialisation

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.

BATMON Event Callbacks

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.

Registering Event Callbacks

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.

Synopsis

#include <ti/drivers/BatMonSupportLPF3.h>
BatMonSupportLPF3_registerTemperatureCb(PMUD_EVENT_TEMP_BELOW_LL | PMUD_EVENT_TEMP_OVER_UL, myTempCb);
BatMonSupportLPF3_registerBatteryCb(PMUD_EVENT_BATT_BELOW_LL | PMUD_EVENT_BATT_OVER_UL, myBattCb);
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <ti/drivers/utils/List.h>
Include dependency graph for BatMonSupportLPF3.h:

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 Documentation

§ BatMonSupportLPF3_EventCb

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

Parameters
[in]eventFlagsThe event flags read from PMUD.EVENT masked with the event mask used when registering the callback function in BatMonSupportLPF3_registerTemperatureCb() or BatMonSupportLPF3_registerBatteryCb().

Function Documentation

§ BatMonSupportLPF3_init()

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.

§ BatMonSupportLPF3_registerTemperatureCb()

void BatMonSupportLPF3_registerTemperatureCb ( uint32_t  eventMask,
BatMonSupportLPF3_EventCb  callback 
)

This function registers a callback dedicated for the Temperature driver.

Note
This function does not set PMUD.EVENTMASK. The 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.
Parameters
[in]eventMaskEvent 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]callbackThe 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.

§ BatMonSupportLPF3_registerBatteryCb()

void BatMonSupportLPF3_registerBatteryCb ( uint32_t  eventMask,
BatMonSupportLPF3_EventCb  callback 
)

This function registers a callback dedicated for the Battery Monitor driver.

Note
This function does not set PMUD.EVENTMASK. The 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.
Parameters
[in]eventMaskEvent 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]callbackThe 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.
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale