Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
intermcu_fbw.c File Reference

Inter-MCU on FlyByWire side. More...

#include "modules/intermcu/intermcu_fbw.h"
#include "main_fbw.h"
#include "pprzlink/intermcu_msg.h"
#include "generated/modules.h"
#include "modules/radio_control/radio_control.h"
#include "modules/energy/electrical.h"
#include "modules/datalink/datalink.h"
#include "modules/core/abi.h"
#include "modules/spektrum_soft_bind/spektrum_soft_bind_fbw.h"
#include <BOARD_CONFIG>
#include "modules/gps/gps.h"
+ Include dependency graph for intermcu_fbw.c:

Go to the source code of this file.

Macros

#define IMCU_RADIO_CONTROL_ID   ABI_BROADCAST
 
#define IMCU_GPS_ID   GPS_MULTI_ID
 

Functions

static void rc_cb (uint8_t sender_id, struct RadioControl *rc)
 
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_event (void)
 
void intermcu_send_status (void)
 send fbw status message More...
 
void intermcu_parse_IMCU_COMMANDS (uint8_t *buf)
 Datalink event functions. More...
 
void intermcu_parse_IMCU_SPEKTRUM_SOFT_BIND (uint8_t *buf)
 
void intermcu_forward_uplink (uint8_t *buf)
 

Variables

struct intermcu_t intermcu
 
uint8_t imcu_msg_buf [256]
 The InterMCU message buffer. More...
 
pprz_t intermcu_commands [COMMANDS_NB]
 
bool intermcu_ap_motors_on = false
 
static abi_event rc_ev
 
static abi_event gps_ev
 

Detailed Description

Inter-MCU on FlyByWire side.

Definition in file intermcu_fbw.c.

Macro Definition Documentation

◆ IMCU_GPS_ID

#define IMCU_GPS_ID   GPS_MULTI_ID

Definition at line 85 of file intermcu_fbw.c.

◆ IMCU_RADIO_CONTROL_ID

#define IMCU_RADIO_CONTROL_ID   ABI_BROADCAST

Definition at line 76 of file intermcu_fbw.c.

Function Documentation

◆ gps_cb()

static void gps_cb ( uint8_t  sender_id,
uint32_t stamp  ,
struct GpsState gps_s 
)
static

◆ intermcu_event()

void intermcu_event ( void  )

Definition at line 115 of file intermcu_fbw.c.

References datalink_nb_msgs, datalink_time, intermcu_t::device, dl_parse_msg(), intermcu_t::enabled, imcu_msg_buf, intermcu, intermcu_dl_on_msg(), intermcu_t::msg_available, intermcu_t::time_since_last_frame, and intermcu_t::transport.

Referenced by main_fbw_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ intermcu_forward_uplink()

void intermcu_forward_uplink ( uint8_t buf)

Definition at line 197 of file intermcu_fbw.c.

References intermcu_t::device, intermcu, intermcu_dl_repack(), and intermcu_t::transport.

+ Here is the call graph for this function:

◆ intermcu_init()

void intermcu_init ( void  )

◆ intermcu_parse_IMCU_COMMANDS()

◆ intermcu_parse_IMCU_SPEKTRUM_SOFT_BIND()

void intermcu_parse_IMCU_SPEKTRUM_SOFT_BIND ( uint8_t buf)

Definition at line 190 of file intermcu_fbw.c.

References received_spektrum_soft_bind().

+ Here is the call graph for this function:

◆ intermcu_periodic()

◆ intermcu_send_status()

void intermcu_send_status ( void  )

◆ rc_cb()

Variable Documentation

◆ gps_ev

abi_event gps_ev
static

Definition at line 87 of file intermcu_fbw.c.

Referenced by intermcu_init().

◆ imcu_msg_buf

uint8_t imcu_msg_buf[256]

The InterMCU message buffer.

Definition at line 64 of file intermcu_fbw.c.

Referenced by intermcu_event().

◆ intermcu

struct intermcu_t intermcu
Initial value:
= {
.device = (&((INTERMCU_LINK).device)),
.enabled = true,
.msg_available = false
}

Definition at line 1 of file intermcu_fbw.c.

Referenced by fbw_safety_check(), gps_cb(), intermcu_event(), intermcu_forward_uplink(), intermcu_init(), intermcu_parse_IMCU_COMMANDS(), intermcu_periodic(), intermcu_send_status(), main_task_periodic(), opa_controller_periodic(), and rc_cb().

◆ intermcu_ap_motors_on

bool intermcu_ap_motors_on = false

Definition at line 67 of file intermcu_fbw.c.

Referenced by intermcu_parse_IMCU_COMMANDS(), and main_task_periodic().

◆ intermcu_commands

pprz_t intermcu_commands[COMMANDS_NB]

Definition at line 66 of file intermcu_fbw.c.

Referenced by intermcu_parse_IMCU_COMMANDS(), and main_task_periodic().

◆ rc_ev

abi_event rc_ev
static

Definition at line 78 of file intermcu_fbw.c.

Referenced by intermcu_init().