15 lines
364 B
C
15 lines
364 B
C
#include "RFReceiver.h"
|
|
|
|
void RFReceiver_conf(TIM_TypeDef * timer, int channel)
|
|
{
|
|
Timer_pwmi_conf(timer, channel);
|
|
}
|
|
|
|
float RFReceiver_getData(TIM_TypeDef * timer)
|
|
{
|
|
const int dutyCycle = Timer_pwmi_getDutyCycle(timer);
|
|
const int period = Timer_pwmi_getPeriod(timer);
|
|
const float impulseLength = dutyCycle * period;
|
|
|
|
return (impulseLength -1) * 200 - 100;
|
|
}
|