Paparazzi UAS  v5.15_devel-99-g2ff7410
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
intermcu_fbw.c File Reference

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"
+ Include dependency graph for intermcu_fbw.c:

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
 

Detailed Description

Rotorcraft Inter-MCU on FlyByWire.

Definition in file intermcu_fbw.c.

Macro Definition Documentation

#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().

Function Documentation

static void gps_cb ( uint8_t  sender_id,
uint32_t  stamp,
struct GpsState gps_s 
)
static
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 253 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  )
static void intermcu_parse_msg ( void(*)(void)  commands_frame_handler)
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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

+ Here is the call graph for this function:

void intermcu_send_status ( uint8_t  mode)
void InterMcuEvent ( void(*)(void)  frame_handler)

Definition at line 199 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

bool autopilot_motors_on = false

Definition at line 64 of file intermcu_fbw.c.

Referenced by main_periodic().

abi_event gps_ev
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
Initial value:
= {
.device = (&((INTERMCU_LINK).device)),
.enabled = true,
.msg_available = false
}

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().