Embedded System Design 2 - Project
|
ADC functionality for reading the (battery) voltage and internal temperature. More...
#include <stdint.h>
Go to the source code of this file.
Typedefs | |
typedef enum adc_measurements | ADC_Measurement_t |
Enumerations | |
enum | adc_measurements { BATTERY_VOLTAGE, INTERNAL_TEMPERATURE } |
Functions | |
void | initADC (ADC_Measurement_t peripheral) |
Method to initialize the ADC to later check the battery voltage or internal temperature. More... | |
int32_t | readADC (ADC_Measurement_t peripheral) |
Method to read the battery voltage or internal temperature. More... | |
ADC functionality for reading the (battery) voltage and internal temperature.
Copyright (C) 2019 - Brecht Van Eeckhoudt
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
A copy of the GNU General Public License can be found in the LICENSE
file along with this source code.
Some methods use code obtained from examples from Silicon Labs' GitHub. These sections are licensed under the Silabs 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 adc.h.
typedef enum adc_measurements ADC_Measurement_t |
Enum type for the ADC
enum adc_measurements |
void initADC | ( | ADC_Measurement_t | peripheral | ) |
Method to initialize the ADC to later check the battery voltage or internal temperature.
[in] | peripheral | Select the ADC peripheral to initialize. |
Definition at line 86 of file adc.c.
int32_t readADC | ( | ADC_Measurement_t | peripheral | ) |
Method to read the battery voltage or internal temperature.
This method re-initializes the ADC settings if necessary.
Negative internal temperatures work fine.
[in] | peripheral | Select the ADC peripheral to read from. |
Definition at line 164 of file adc.c.