40 #include "lib/sensors.h" 50 #define PRINTF(...) printf(__VA_ARGS__) 55 #define SENSOR_STATUS_DISABLED 0 56 #define SENSOR_STATUS_ENABLED 1 58 static int enabled = SENSOR_STATUS_DISABLED;
69 if(enabled == SENSOR_STATUS_DISABLED) {
70 PRINTF(
"Sensor Disabled\n");
74 if(type == BATMON_SENSOR_TYPE_TEMP) {
75 return (
int)ti_lib_aon_batmon_temperature_get_deg_c();
76 }
else if(type == BATMON_SENSOR_TYPE_VOLT) {
77 return (
int)ti_lib_aon_batmon_battery_voltage_get();
79 PRINTF(
"Invalid type\n");
100 ti_lib_aon_batmon_enable();
101 enabled = SENSOR_STATUS_ENABLED;
105 ti_lib_aon_batmon_enable();
106 enabled = SENSOR_STATUS_ENABLED;
108 ti_lib_aon_batmon_disable();
109 enabled = SENSOR_STATUS_DISABLED;
134 return SENSOR_STATUS_DISABLED;
Header file with macros which rename TI CC26xxware functions.
static int status(int type)
Returns the status of the sensor.
Header file for the CC13xx/CC26xx battery monitor.
static int value(int type)
Returns a reading from the sensor.
static int configure(int type, int enable)
Configuration function for the battery monitor sensor.