From 779b5cfaf1560f40ae76866b3364769fac5033f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jasper=20G=C3=BCldenstein?= Date: Sun, 15 Nov 2020 16:52:49 +0100 Subject: [PATCH] alimenation documentation and move of includes to c --- keil_project/Services/Alimentation.c | 5 ++++ keil_project/Services/Alimentation.h | 39 ++++++++++++++++------------ 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/keil_project/Services/Alimentation.c b/keil_project/Services/Alimentation.c index 3e4d704..2015fa1 100644 --- a/keil_project/Services/Alimentation.c +++ b/keil_project/Services/Alimentation.c @@ -1,5 +1,10 @@ #include "Alimentation.h" +#include "stm32f1xx_ll_adc.h" +#include "stm32f1xx_ll_bus.h" +#include "stm32f1xx_ll_rcc.h" +#include "stm32f1xx_ll_gpio.h" +#include void ALIMENTATION_Init(void){ RCC -> CFGR |= (0x1<<15); diff --git a/keil_project/Services/Alimentation.h b/keil_project/Services/Alimentation.h index 7effb3d..a989461 100644 --- a/keil_project/Services/Alimentation.h +++ b/keil_project/Services/Alimentation.h @@ -1,25 +1,30 @@ -// RIEN A MODIFIER // - -//codé par Léonie GALLOIS et Morgane FOUSSATS - +/** + ****************************************************************************** + * @file RFOutput.h + * @author GALLOIS, Leonie and GÜLDENSTEIN, Jasper and FOUSSATS, Morgane + * @brief Service for using the RF Module to transmit characters. + ****************************************************************************** + */ #ifndef ALIMENTATION_H #define ALIMENTATION_H - - -#include "stm32f103xb.h" -#include "stm32f1xx_ll_adc.h" -#include "stm32f1xx_ll_bus.h" -#include "stm32f1xx_ll_rcc.h" -#include "stm32f1xx_ll_gpio.h" -#include "math.h" - -/* ===================================================================================== -Les fonctions qui gèrent les IO (ajout par rapport à l'activité 1) -=======================================================================================*/ - +/** + * @brief Initializes for reading of the power supply/battery level + * Peripherals used: ADC1 + * Pins used: PC2 (Analog input) + */ void ALIMENTATION_Init(void); + +/** + * @brief Reads the power supply/battery level + * @retval battery level in Volts + */ float ALIMENTATION_GetBatteryLevel(void); + +/** + * @brief Returns if the power supply/battery level is above acceptable level + * @retval state (0 or 1) + */ int ALIMENTATION_IsLevelEnough(void);