Paparazzi UAS
v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
|
Rotorcraft Inter-MCU on FlyByWire. More...
#include "intermcu_fbw.h"
#include "pprzlink/intermcu_msg.h"
#include "subsystems/radio_control.h"
#include "subsystems/electrical.h"
#include "mcu_periph/uart.h"
#include "modules/telemetry/telemetry_intermcu.h"
#include "modules/spektrum_soft_bind/spektrum_soft_bind_fbw.h"
#include <BOARD_CONFIG>
#include "subsystems/abi.h"
#include "subsystems/gps.h"
Go to the source code of this file.
Macros | |
#define | ABI_C |
#define | IMCU_GPS_ID GPS_MULTI_ID |
Functions | |
static void | intermcu_parse_msg (void(*commands_frame_handler)(void)) |
static void | gps_cb (uint8_t sender_id, uint32_t stamp, struct GpsState *gps_s) |
void | intermcu_init (void) |
void | intermcu_periodic (void) |
void | intermcu_on_rc_frame (uint8_t fbw_mode) |
void | intermcu_send_status (uint8_t mode) |
void | InterMcuEvent (void(*frame_handler)(void)) |
void | gps_periodic_check (struct GpsState *gps_s) |
Periodic GPS check. More... | |
Variables | |
struct intermcu_t | intermcu |
uint8_t | imcu_msg_buf [128] |
The InterMCU message buffer. More... | |
pprz_t | intermcu_commands [COMMANDS_NB] |
bool | autopilot_motors_on = false |
static abi_event | gps_ev |
Rotorcraft Inter-MCU on FlyByWire.
Definition in file intermcu_fbw.c.
#define ABI_C |
Definition at line 27 of file intermcu_fbw.c.
#define IMCU_GPS_ID GPS_MULTI_ID |
Definition at line 74 of file intermcu_fbw.c.
Referenced by intermcu_init().
Definition at line 227 of file intermcu_fbw.c.
References LlaCoor_i::alt, GpsState::course, intermcu_t::device, GpsState::ecef_pos, GpsState::ecef_vel, GpsState::fix, GpsState::gspeed, GpsState::hmsl, INTERMCU_FBW, GpsState::lla_pos, GpsState::num_sv, GpsState::pacc, GpsState::sacc, intermcu_t::transport, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by intermcu_init().
void gps_periodic_check | ( | struct GpsState * | gps_s | ) |
Periodic GPS check.
Marks GPS as lost when no GPS message was received for GPS_TIMEOUT seconds
Definition at line 247 of file intermcu_fbw.c.
References GpsState::comp_id, GpsState::fix, gps, GPS_FIX_NONE, GPS_TIMEOUT, GpsState::last_msg_time, and sys_time::nb_sec.
void intermcu_init | ( | void | ) |
Definition at line 83 of file intermcu_fbw.c.
References DefaultPeriodic, gps_cb(), GPS_FIX_NONE, GPS_IMCU_ID, IMCU_GPS_ID, register_periodic_telemetry(), send_status(), sys_time_register_timer(), and intermcu_t::transport.
void intermcu_on_rc_frame | ( | uint8_t | fbw_mode | ) |
Definition at line 106 of file intermcu_fbw.c.
References intermcu_t::device, INTERMCU_FBW, INTERMCU_RADIO_AUX1, INTERMCU_RADIO_AUX2, INTERMCU_RADIO_AUX3, INTERMCU_RADIO_KILL_SWITCH, INTERMCU_RADIO_MODE, INTERMCU_RADIO_PITCH, INTERMCU_RADIO_ROLL, INTERMCU_RADIO_THROTTLE, INTERMCU_RADIO_YAW, RADIO_AUX1, RADIO_AUX2, RADIO_AUX3, radio_control, RADIO_CONTROL_NB_CHANNEL, RADIO_KILL_SWITCH, RADIO_MODE, RADIO_PITCH, RADIO_ROLL, RADIO_THROTTLE, RADIO_YAW, intermcu_t::transport, and RadioControl::values.
Referenced by fbw_on_rc_frame().
|
static |
Definition at line 148 of file intermcu_fbw.c.
References intermcu_t::cmd_status, imcu_msg_buf, INTERMCU_CLR_CMD_STATUS, INTERMCU_CMD_MOTORS_ON, INTERMCU_GET_CMD_STATUS, INTERMCU_OK, msg, received_spektrum_soft_bind(), intermcu_t::status, telemetry_intermcu_on_msg(), and intermcu_t::time_since_last_frame.
Referenced by InterMcuEvent().
void intermcu_periodic | ( | void | ) |
Definition at line 96 of file intermcu_fbw.c.
References gps_periodic_check(), INTERMCU_LOST, INTERMCU_LOST_CNT, intermcu_t::status, and intermcu_t::time_since_last_frame.
void intermcu_send_status | ( | uint8_t | mode | ) |
Definition at line 139 of file intermcu_fbw.c.
References Electrical::current, intermcu_t::device, electrical, RadioControl::frame_rate, INTERMCU_FBW, radio_control, RadioControl::status, intermcu_t::transport, and Electrical::vsupply.
Referenced by telemetry_periodic().
void InterMcuEvent | ( | void(*)(void) | frame_handler | ) |
Definition at line 193 of file intermcu_fbw.c.
References intermcu_t::device, imcu_msg_buf, intermcu_parse_msg(), intermcu_t::msg_available, and intermcu_t::transport.
Referenced by main_event().
bool autopilot_motors_on = false |
Definition at line 64 of file intermcu_fbw.c.
Referenced by main_periodic().
|
static |
Definition at line 79 of file intermcu_fbw.c.
uint8_t imcu_msg_buf[128] |
The InterMCU message buffer.
Definition at line 61 of file intermcu_fbw.c.
Referenced by intermcu_parse_msg(), and InterMcuEvent().
struct intermcu_t intermcu |
Definition at line 56 of file intermcu_fbw.c.
pprz_t intermcu_commands[COMMANDS_NB] |
Definition at line 63 of file intermcu_fbw.c.
Referenced by fbw_on_ap_command().