27 #define PERIODIC_C_INTERMCU
30 #include "pprzlink/intermcu_msg.h"
32 #include "generated/modules.h"
34 #if TELEMETRY_INTERMCU
37 #include "generated/periodic_telemetry.h"
40 #warning "INTERMCU UART CAN ONLY SEND 8 COMMANDS OR THE UART MIGHT BE OVERFILLED"
56 #if PERIODIC_TELEMETRY
62 pprz_msg_send_FBW_STATUS(trans,
dev, AC_ID,
73 #if PERIODIC_TELEMETRY
88 #ifdef TELEMETRY_PROCESS_InterMCU
105 if (class_id == DL_intermcu_CLASS_ID) {
112 #if TELEMETRY_INTERMCU
bool autopilot_get_motors_on(void)
get motors status
Core autopilot interface common to all firmwares.
uint16_t datalink_time
time in seconds since last datalink message was received
uint16_t datalink_nb_msgs
number of datalink/uplink messages received
struct Electrical electrical
Interface for electrical status: supply voltage, current, battery status, etc.
float current
current in A
float vsupply
supply voltage in V
struct link_device * device
Device used for communication.
#define INTERMCU_SET_CMD_STATUS(_bit)
#define INTERMCU_LOST_CNT
@ INTERMCU_LOST
No interMCU communication anymore.
bool enabled
If the InterMCU communication is enabled.
@ INTERMCU_CMD_MOTORS_ON
The status of intermcu_ap_motors_on.
uint8_t cmd_status
Command status information that is transfered (intermcu_cmd_status)
enum intermcu_status status
Status of the INTERMCU.
bool msg_available
If we have an InterMCU message.
uint8_t time_since_last_frame
Time since last frame.
struct pprz_transport transport
Transport over communication line (PPRZ)
void intermcu_event(void)
void intermcu_periodic(void)
static void send_status(struct transport_tx *trans, struct link_device *dev)
struct intermcu_t intermcu
void intermcu_send_spektrum_bind(void)
send binding signal for spektrum receiver
void intermcu_set_enabled(bool value)
enable/disable intermcu link
void intermcu_parse_IMCU_FBW_STATUS(uint8_t *buf)
Datalink event functions.
uint8_t imcu_msg_buf[128]
The InterMCU message buffer.
void intermcu_send_commands(pprz_t *command_values, uint8_t ap_mode)
send command vector over intermcu link instead of actuators
static struct fbw_status_t fbw_status
Inter-MCU on the AP side.
void intermcu_dl_on_msg(uint8_t *msg, uint8_t size)
function to forward telemetry from AP to the ground
datalink forwarder for InterMCU
void dl_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
Should be called when chars are available in dl_buffer.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.