#include "servo_dec.h"
#include "stm32f4xx_conf.h"
#include "ch.h"
#include "hal.h"
#include "hw.h"
#include "utils.h"
Macros | |
#define | SERVO_NUM 1 |
#define | TIMER_FREQ 1000000 |
Functions | |
void | servodec_init (void(*d_func)(void)) |
void | servodec_set_pulse_options (float start, float end, bool median_filter) |
float | servodec_get_servo (int servo_num) |
uint32_t | servodec_get_time_since_update (void) |
float | servodec_get_last_pulse_len (int servo_num) |
#define SERVO_NUM 1 |
#define TIMER_FREQ 1000000 |
float servodec_get_last_pulse_len | ( | int | servo_num | ) |
Get the length of the last received pulse.
servo_num | The servo index. If it is out of range, 0.0 will be returned. |
float servodec_get_servo | ( | int | servo_num | ) |
Get a decoded servo value.
servo_num | The servo index. If it is out of range, 0.0 will be returned. |
uint32_t servodec_get_time_since_update | ( | void | ) |
Get the amount of milliseconds that has passed since the last time servo positions were received.
void servodec_init | ( | void(*)(void) | d_func | ) |
Initialize the serve decoding driver.
d_func | A function that should be called every time the servo signals have been decoded. Can be NULL. |
void servodec_set_pulse_options | ( | float | start, |
float | end, | ||
bool | median_filter | ||
) |
Change the limits of how the servo pulses should be decoded.
start | The amount of milliseconds the pulse starts at (default is 1.0) |
end | he amount of milliseconds the pulse ends at (default is 2.0) |