Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
radio_control_uavcan.c
Go to the documentation of this file.
1 /*
2 * Radio control over uavcan
3 * Copyright (C) 2026 Fabien-B <fabien-b@github.com>
4 * This file is part of paparazzi. See LICENCE file.
5 */
6
14#include "uavcan/uavcan.h"
15#include "modules/core/abi.h"
17#include "dronecan.sensors.rc.RCInput.h"
18#include "generated/radio.h"
19
21
25
26
27static void rc_uavcan_cb(struct uavcan_iface_t *iface __attribute__((unused)), CanardRxTransfer *transfer) {
28 if(pprz_mtx_trylock(&rc_mtx) == 0) {
30 return; // decode error
31 }
32 rc_frame_available = true;
34 }
35}
36
44
45
75
76
Main include for ABI (AirBorneInterface).
#define RADIO_CONTROL_UAVCAN_ID
int pprz_mtx_trylock(pprz_mutex_t *mtx)
Performs a nonblocking lock on the mutex.
int pprz_mtx_unlock(pprz_mutex_t *mtx)
int pprz_mtx_init(pprz_mutex_t *mtx)
uint16_t foo
Definition main_demo5.c:58
struct RadioControl radio_control
Generic interface for radio control modules.
uint8_t time_since_last_frame
uint8_t radio_ok_cpt
uint8_t frame_cpt
#define RC_OK
uint8_t nb_channel
static pprz_mutex_t rc_mtx
void rc_uavcan_init(void)
static bool rc_frame_available
static void rc_uavcan_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
static uavcan_event rc_uavcan_ev
struct dronecan_sensors_rc_RCInput rc_dronecan_msg
void rc_uavcan_event(void)
void uavcan_bind(uint16_t data_type_id, uint64_t data_type_signature, uavcan_event *ev, uavcan_callback cb)
Bind to a receiving message from uavcan.
Definition uavcan.c:240
Main uavcan event structure for registering/calling callbacks.
Definition uavcan.h:74
uavcan interface structure
Definition uavcan.h:44
int transfer(const Mat *from, const image_t *to)