NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rc_command.c File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <stddef.h>
#include <platform.h>
#include "build_config.h"
#include "common/maths.h"
#include "common/axis.h"
#include "config/config.h"
#include "rc_command.h"
#include "rx/rx.h"
Include dependency graph for rc_command.c:

Macros

#define RC_MID   1500
 
#define RC_MIN   1000
 
#define RC_MAX   2000
 

Functions

void rc_command_init (struct rc_command *self, struct rx *rx)
 Initializes the curves with default linear ranges. More...
 
void rc_command_update (struct rc_command *self)
 Updates current rc rates from the current rc values. Inputs are in range [1000;2000] and should correspond to raw pwm values from rc receiver. More...
 
int16_t rc_command_axis (struct rc_command *self, uint8_t axis)
 Get current stick value in range [-500;500], stick is only ROLL, PITCH, YAw. More...
 
void rc_command_set_rate_config (struct rc_command *self, const struct rate_profile *rates)
 Updates internal variables to use new rates and also recalculates the lookup tables if the supplied profile is different than the one that is currently being used. More...
 

Macro Definition Documentation

#define RC_MAX   2000
#define RC_MID   1500
#define RC_MIN   1000

Function Documentation

int16_t rc_command_axis ( struct rc_command self,
uint8_t  axis 
)

Get current stick value in range [-500;500], stick is only ROLL, PITCH, YAw.

void rc_command_init ( struct rc_command self,
struct rx rx 
)

Initializes the curves with default linear ranges.

void rc_command_set_rate_config ( struct rc_command self,
const struct rate_profile rates 
)

Updates internal variables to use new rates and also recalculates the lookup tables if the supplied profile is different than the one that is currently being used.

void rc_command_update ( struct rc_command self)

Updates current rc rates from the current rc values. Inputs are in range [1000;2000] and should correspond to raw pwm values from rc receiver.

Here is the call graph for this function: