9#include <uavcan.tunnel.Protocol.h>
11#if !defined(TUNNEL_UAVCAN_IFACE) && USE_CAN1
12#define TUNNEL_UAVCAN_IFACE uavcan1
15#if !defined(TUNNEL_UAVCAN_IFACE) && USE_CAN2
16#define TUNNEL_UAVCAN_IFACE uavcan2
19#if !defined(TUNNEL_UAVCAN_PROTOCOL)
20#define TUNNEL_UAVCAN_PROTOCOL 3
23#if !defined(TUNNEL_UAVCAN_CHANNEL_ID)
24#define TUNNEL_UAVCAN_CHANNEL_ID 0
140 msg.buffer.len = len;
141 msg.channel_id =
up->channel_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)
int pprz_mtx_lock(pprz_mutex_t *mtx)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
size_t ring_buffer_free_space(ring_buffer_t *ring_buffer)
size_t ring_buffer_write(ring_buffer_t *rb, const uint8_t *data, size_t len)
Write.
size_t ring_buffer_read(ring_buffer_t *rb, uint8_t *read_buffer, size_t len)
Read.
size_t ring_buffer_available(ring_buffer_t *rb)
void ring_buffer_init(ring_buffer_t *rb, uint8_t *buf, size_t size)
Init.
static void tunnel_uavcan_put_byte(struct tunnel_uavcan_periph *up, long fd, uint8_t c)
void tunnel_uavcan_init(void)
void tunnel_uavcan_set_baudrate(struct tunnel_uavcan_periph *up, uint32_t baudrate)
#define TUNNEL_UAVCAN_PROTOCOL
static int tunnel_uavcan_char_available(struct tunnel_uavcan_periph *up)
static int tunnel_uavcan_check_free_space(struct tunnel_uavcan_periph *up, long *fd, uint16_t len)
static void tunnel_uavcan_put_buffer(struct tunnel_uavcan_periph *up, long fd, const uint8_t *data, uint16_t len)
static void tunnel_uavcan_send_message(struct tunnel_uavcan_periph *up, long fd)
static void tunnel_uavcan_cb(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
void tunnel_uavcan_init_periph(struct tunnel_uavcan_periph *ucdl, uint8_t channel_id)
static uint8_t tunnel_uavcan_get_byte(struct tunnel_uavcan_periph *up)
struct tunnel_uavcan_periph tunnel_uavcan0
#define TUNNEL_UAVCAN_CHANNEL_ID
struct uavcan_iface_t * iface
void uavcan_broadcast(struct uavcan_iface_t *iface, uint64_t data_type_signature, uint16_t data_type_id, uint8_t priority, const void *payload, uint16_t payload_len)
Legacy function Broadcast an uavcan message to a specific interface.
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.
uavcan interface structure
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)