From d2a19989fd26f6235bbe1c7520fc7da1afe72125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jasper=20G=C3=BCldenstein?= Date: Sun, 15 Nov 2020 17:08:21 +0100 Subject: [PATCH] documentation rfinput --- keil_project/Services/RFInput.c | 2 +- keil_project/Services/RFInput.h | 30 ++++++++++++++++++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/keil_project/Services/RFInput.c b/keil_project/Services/RFInput.c index 9fb4057..3211ba5 100644 --- a/keil_project/Services/RFInput.c +++ b/keil_project/Services/RFInput.c @@ -26,7 +26,7 @@ void RF_INPUT_Init(void) LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM4); LL_TIM_InitTypeDef tim4_init_struct; - tim4_init_struct.Autoreload= 0xFFFF; // ?? + tim4_init_struct.Autoreload= 0xFFFF; tim4_init_struct.Prescaler=71; tim4_init_struct.ClockDivision=LL_TIM_CLOCKDIVISION_DIV1; tim4_init_struct.CounterMode=LL_TIM_COUNTERMODE_UP; diff --git a/keil_project/Services/RFInput.h b/keil_project/Services/RFInput.h index 8139834..954510c 100644 --- a/keil_project/Services/RFInput.h +++ b/keil_project/Services/RFInput.h @@ -1,16 +1,38 @@ +/** + ****************************************************************************** + * @file RFInput.h + * @author CAVAILLES, Kevin and GÜLDENSTEIN, Jasper + * @brief Service for reveiving a PWM signal from an RF remote + ****************************************************************************** + */ #ifndef RF_INPUT_H #define RF_INPUT_H -// initializes the PWM input of the remote on PB6 +/** + * @brief Initialziation function for the RF_OUTPUT module. + * Peripherals used: TIM4 + * Pins used: PB6 (PWM Input) + */ void RF_INPUT_Init(void); -// returns the period of the PWM signal of the remote in us +/** + * @brief Reads the period of the PWM signal + * @retval period of the PWM signal in microseconds (10^(-6)) + */ int RF_INPUT_GetPeriodUs(void); -// returns the duty time of the PWM signal of the remote in us + +/** + * @brief Reads the length of the active time of the PWM signal + * @retval active time of the PWM signal in microseconds (10^(-6)) + */ int RF_INPUT_GetDutyTimeUs(void); -// returns the duty time of the PWM signal of the remote as a value between -100 and 100 +/** + * @brief Reads the length of the active time of the PWM signal and converts it to a relative value + * @retval value between -100 corresponding to 1000us and 100 corresponding to 2000us active time of the PWM signal + */ int RF_INPUT_GetDutyTimeRelative(void); + #endif