20 #include "../config/rx.h"
21 #include "../config/rc_controls.h"
114 #define RC_KEY_REPEAT_MS 200
116 #define CHANNEL_RANGE_MIN 900
117 #define CHANNEL_RANGE_MAX 2100
119 #define MODE_STEP_TO_CHANNEL_VALUE(step) (CHANNEL_RANGE_MIN + 25 * (step))
120 #define CHANNEL_VALUE_TO_STEP(channelValue) ((constrain((channelValue), CHANNEL_RANGE_MIN, CHANNEL_RANGE_MAX) - CHANNEL_RANGE_MIN) / 25)
122 #define MIN_MODE_RANGE_STEP 0
123 #define MAX_MODE_RANGE_STEP ((CHANNEL_RANGE_MAX - CHANNEL_RANGE_MIN) / 25)
126 #define CONTROL_RATE_CONFIG_ROLL_PITCH_RATE_MAX 100
129 #define CONTROL_RATE_CONFIG_YAW_RATE_MAX 255
131 #define CONTROL_RATE_CONFIG_TPA_MAX 100
133 #define IS_RANGE_USABLE(range) ((range)->startStep < (range)->endStep)
returned by rc_key_state() when the key is pressed
Definition: rc.h:69
arming through box range
Definition: rc.h:51
returned by rc_key_state() when the key is not pressed
Definition: rc.h:70
const struct config * config
Definition: rc.h:101
rollPitchStatus_e
Definition: rc.h:109
rc_key_state_t rc_key_state(struct rc *rc, rc_key_t key)
Definition: rc.c:171
rc_key_t
Definition: rc.h:30
void rc_init(struct rc *self, struct rx *rx, struct rc_event_listener *evl, const struct config *config)
Definition: rc.c:157
uint8_t key_enabled_mask[RC_NUM_KEYS/8+1]
Definition: rc.h:98
uint32_t range_mask
Definition: rc.h:99
void(* on_key_repeat)(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)
Definition: rc.h:88
throttleStatus_e
Definition: rc.h:104
RC commands state. Inputs are raw commands in range [1000-2000]. Outputs are RC commands in range [-5...
Definition: rc_command.h:39
returned by rc_key_state() if the key does not exist (not configured etc.)
Definition: rc.h:68
void rc_update(struct rc *self)
Definition: rc.c:113
struct rc_event_listener * evl
Definition: rc.h:95
int16_t rc_get_command(struct rc *self, uint8_t axis)
Definition: rc.c:166
struct rx * rx
Definition: rc.h:94
rc_key_state_t
Definition: rc.h:67
uint32_t boxes
Definition: rc.h:93
void(* on_key_state)(struct rc_event_listener *self, rc_key_t key, rc_key_state_t newstate)
Definition: rc.h:82
uint8_t key_mask[RC_NUM_KEYS/8+1]
holds the key bits. This mask grows as we add more keys.
Definition: rc.h:97