Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
intermcu.h File Reference

Inter-MCU interface. More...

#include "std.h"
#include "modules/core/commands.h"
#include "pprzlink/pprz_transport.h"
#include <BOARD_CONFIG>
Include dependency graph for intermcu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  intermcu_t

Macros

#define INTERMCU_LOST_CNT   25 /* 50ms with a 512Hz timer TODO fixed value */
#define INTERMCU_SET_CMD_STATUS(_bit)
#define INTERMCU_CLR_CMD_STATUS(_bit)
#define INTERMCU_GET_CMD_STATUS(_bit)

Enumerations

enum  intermcu_status { INTERMCU_OK , INTERMCU_LOST }
enum  intermcu_cmd_status { INTERMCU_CMD_MOTORS_ON , INTERMCU_CMD_DISARM , INTERMCU_CMD_TIPPROPS , INTERMCU_CMD_FAILSAFE }

Functions

void intermcu_init (void)
void intermcu_periodic (void)
void intermcu_event (void)

Variables

struct intermcu_t intermcu

Detailed Description

Inter-MCU interface.

Definition in file intermcu.h.


Data Structure Documentation

◆ intermcu_t

struct intermcu_t

Definition at line 60 of file intermcu.h.

Data Fields
uint8_t cmd_status Command status information that is transfered (intermcu_cmd_status).
struct link_device * device Device used for communication.
bool enabled If the InterMCU communication is enabled.
bool msg_available If we have an InterMCU message.
enum intermcu_status status Status of the INTERMCU.
uint8_t time_since_last_frame Time since last frame.
struct pprz_transport transport Transport over communication line (PPRZ).

Macro Definition Documentation

◆ INTERMCU_CLR_CMD_STATUS

#define INTERMCU_CLR_CMD_STATUS ( _bit)
Value:
{ intermcu.cmd_status &= ~(1 << _bit); }
struct intermcu_t intermcu
Definition intermcu_ap.c:45

Definition at line 56 of file intermcu.h.

Referenced by intermcu_parse_IMCU_COMMANDS(), and opa_controller_periodic().

◆ INTERMCU_GET_CMD_STATUS

#define INTERMCU_GET_CMD_STATUS ( _bit)
Value:
(intermcu.cmd_status & (1 << _bit))

Definition at line 57 of file intermcu.h.

Referenced by intermcu_parse_IMCU_COMMANDS(), and opa_controller_periodic().

◆ INTERMCU_LOST_CNT

#define INTERMCU_LOST_CNT   25 /* 50ms with a 512Hz timer TODO fixed value */

Definition at line 35 of file intermcu.h.

Referenced by intermcu_periodic().

◆ INTERMCU_SET_CMD_STATUS

#define INTERMCU_SET_CMD_STATUS ( _bit)
Value:
{ intermcu.cmd_status |= (1 << _bit); }

Definition at line 55 of file intermcu.h.

Referenced by intermcu_send_commands(), and opa_controller_ap_disarm().

Enumeration Type Documentation

◆ intermcu_cmd_status

Enumerator
INTERMCU_CMD_MOTORS_ON 

The status of intermcu_ap_motors_on.

INTERMCU_CMD_DISARM 

Whether or not to dis-arm the FBW.

INTERMCU_CMD_TIPPROPS 

Enable tip props.

INTERMCU_CMD_FAILSAFE 

Set FBW in failsafe mode.

Definition at line 47 of file intermcu.h.

◆ intermcu_status

Enumerator
INTERMCU_OK 

InterMCU communication is OK.

INTERMCU_LOST 

No interMCU communication anymore.

Definition at line 41 of file intermcu.h.

Function Documentation

◆ intermcu_event()

void intermcu_event ( void )
extern

Definition at line 95 of file intermcu_ap.c.

References datalink_nb_msgs, datalink_time, dl_parse_msg(), imcu_msg_buf, intermcu, and intermcu_dl_on_msg().

Referenced by main_fbw_event().

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

◆ intermcu_init()

void intermcu_init ( void )
extern

Definition at line 69 of file intermcu_ap.c.

References DefaultPeriodic, gps_cb(), gps_ev, IMCU_GPS_ID, IMCU_RADIO_CONTROL_ID, intermcu, rc_cb(), rc_ev, register_periodic_telemetry(), and send_status().

Here is the call graph for this function:

◆ intermcu_periodic()

void intermcu_periodic ( void )
extern

Definition at line 79 of file intermcu_ap.c.

References DefaultPeriodic, intermcu, INTERMCU_LOST, and INTERMCU_LOST_CNT.

Variable Documentation

◆ intermcu