Contiki-NG
CC13xx/CC26xx BatMon sensor driver

Driver for the on-chip battery voltage and chip temperature sensor. More...

Files

file  batmon-sensor.c
 Driver for the CC13xx/CC26xx AON battery monitor.
 
file  batmon-sensor.h
 Header file for the CC13xx/CC26xx battery monitor.
 

Functions

static int value (int type)
 Returns a reading from the sensor. More...
 
static int configure (int type, int enable)
 Configuration function for the battery monitor sensor. More...
 
static int status (int type)
 Returns the status of the sensor. More...
 

Detailed Description

Driver for the on-chip battery voltage and chip temperature sensor.

Function Documentation

◆ configure()

static int configure ( int  type,
int  enable 
)
static

Configuration function for the battery monitor sensor.

Parameters
typeActivate, enable or disable the sensor. See below
enableIf

When type == SENSORS_HW_INIT we turn on the hardware When type == SENSORS_ACTIVE and enable==1 we enable the sensor When type == SENSORS_ACTIVE and enable==0 we disable the sensor

Definition at line 96 of file batmon-sensor.c.

◆ status()

static int status ( int  type)
static

Returns the status of the sensor.

Parameters
typeSENSORS_ACTIVE or SENSORS_READY
Returns
1 if the sensor is enabled

Definition at line 124 of file batmon-sensor.c.

◆ value()

static int value ( int  type)
static

Returns a reading from the sensor.

Parameters
typeBATMON_SENSOR_TYPE_TEMP or BATMON_SENSOR_TYPE_VOLT
Returns
The value as returned by the respective CC26xxware function

Definition at line 67 of file batmon-sensor.c.