documentation rfinput

This commit is contained in:
Jasper Güldenstein 2020-11-15 17:08:21 +01:00
parent a4c1eaa559
commit d2a19989fd
2 changed files with 27 additions and 5 deletions

View file

@ -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;

View file

@ -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