EFR32 Blue Gecko 1 Software Documentation  efr32bg1-doc-5.1.2
util_supply.c File Reference

Detailed Description

Power Supply Related Utility Functions for the Thunderboard Sense.



Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com

This file is licensed under the Silicon Labs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file util_supply.c.

#include <stdio.h>
#include "em_device.h"
#include "em_cmu.h"
#include "em_gpio.h"
#include "em_emu.h"
#include "em_adc.h"
#include "em_prs.h"
#include "thunderboard/board.h"
#include "thunderboard/util.h"
#include "thunderboard/si7021.h"

Go to the source code of this file.


static void adcDeInit (void)
 De-initializes the A/D converter. More...
static void adcInit (void)
 Initializes the A/D converter. More...
static uint16_t getAdcSample (void)
 Initiates an A/D conversion and reads the sample when done. More...
static float measureSupplyIR (uint8_t loadSetting)
 Measures the unladed and loaded supply voltage and calculates the intermal resistance of the connected supply. The load is provided by the heater element built in the Si7021. More...
static float measureSupplyVoltage (unsigned int avg)
 Measures the supply voltage by averaging multiple readings. More...
bool UTIL_isLowPower (void)
 Checks if the current power supply has low power capability. More...
void UTIL_supplyGetCharacteristics (uint8_t *type, float *voltage, float *ir)
 Retrieves the supply characteristic variables. More...
uint8_t UTIL_supplyGetType (void)
 Returns the type of the power supply. More...
void UTIL_supplyProbe (void)
 Probes the connected supply and determines its type. The results are stored in global variables. More...