Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
tunnel_uavcan.c File Reference
#include "tunnel_uavcan.h"
#include "uavcan/uavcan.h"
#include <uavcan.tunnel.Protocol.h>
+ Include dependency graph for tunnel_uavcan.c:

Go to the source code of this file.

Macros

#define TUNNEL_UAVCAN_PROTOCOL   3
 
#define TUNNEL_UAVCAN_CHANNEL_ID   0
 

Functions

static int tunnel_uavcan_check_free_space (struct tunnel_uavcan_periph *up, long *fd, uint16_t len)
 
static void tunnel_uavcan_put_byte (struct tunnel_uavcan_periph *up, long fd, uint8_t c)
 
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 int tunnel_uavcan_char_available (struct tunnel_uavcan_periph *up)
 
static uint8_t tunnel_uavcan_get_byte (struct tunnel_uavcan_periph *up)
 
void tunnel_uavcan_set_baudrate (struct tunnel_uavcan_periph *up, uint32_t baudrate)
 
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)
 
void tunnel_uavcan_init (void)
 

Variables

struct tunnel_uavcan_periph tunnel_uavcan0
 

Macro Definition Documentation

◆ TUNNEL_UAVCAN_CHANNEL_ID

#define TUNNEL_UAVCAN_CHANNEL_ID   0

Definition at line 24 of file tunnel_uavcan.c.

◆ TUNNEL_UAVCAN_PROTOCOL

#define TUNNEL_UAVCAN_PROTOCOL   3

Definition at line 20 of file tunnel_uavcan.c.

Function Documentation

◆ tunnel_uavcan_cb()

static void tunnel_uavcan_cb ( struct uavcan_iface_t iface,
CanardRxTransfer transfer 
)
static

◆ tunnel_uavcan_char_available()

static int tunnel_uavcan_char_available ( struct tunnel_uavcan_periph up)
static

Definition at line 153 of file tunnel_uavcan.c.

References foo, pprz_mtx_lock(), pprz_mtx_unlock(), ring_buffer_available(), and up.

Referenced by tunnel_uavcan_init_periph().

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

◆ tunnel_uavcan_check_free_space()

static int tunnel_uavcan_check_free_space ( struct tunnel_uavcan_periph up,
long fd,
uint16_t  len 
)
static
Returns
free_space if free_space > len, else 0. That's not logic...

Definition at line 92 of file tunnel_uavcan.c.

References fd, foo, pprz_mtx_lock(), pprz_mtx_unlock(), ring_buffer_free_space(), and up.

Referenced by tunnel_uavcan_init_periph().

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

◆ tunnel_uavcan_get_byte()

static uint8_t tunnel_uavcan_get_byte ( struct tunnel_uavcan_periph up)
static

Definition at line 162 of file tunnel_uavcan.c.

References pprz_mtx_lock(), pprz_mtx_unlock(), ring_buffer_read(), and up.

Referenced by tunnel_uavcan_init_periph().

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

◆ tunnel_uavcan_init()

void tunnel_uavcan_init ( void  )

Definition at line 43 of file tunnel_uavcan.c.

References tunnel_uavcan0, TUNNEL_UAVCAN_CHANNEL_ID, and tunnel_uavcan_init_periph().

+ Here is the call graph for this function:

◆ tunnel_uavcan_init_periph()

◆ tunnel_uavcan_put_buffer()

static void tunnel_uavcan_put_buffer ( struct tunnel_uavcan_periph up,
long  fd,
const uint8_t data,
uint16_t  len 
)
static

Definition at line 113 of file tunnel_uavcan.c.

References fd, pprz_mtx_lock(), ring_buffer_write(), tunnel_uavcan_send_message(), and up.

Referenced by tunnel_uavcan_init_periph(), and tunnel_uavcan_put_byte().

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

◆ tunnel_uavcan_put_byte()

static void tunnel_uavcan_put_byte ( struct tunnel_uavcan_periph up,
long  fd,
uint8_t  c 
)
static

Definition at line 109 of file tunnel_uavcan.c.

References fd, tunnel_uavcan_put_buffer(), and up.

Referenced by tunnel_uavcan_init_periph().

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

◆ tunnel_uavcan_send_message()

static void tunnel_uavcan_send_message ( struct tunnel_uavcan_periph up,
long  fd 
)
static

Definition at line 127 of file tunnel_uavcan.c.

References fd, foo, msg, pprz_mtx_lock(), pprz_mtx_unlock(), ring_buffer_available(), ring_buffer_read(), TUNNEL_UAVCAN_PROTOCOL, uavcan_broadcast(), and up.

Referenced by tunnel_uavcan_init_periph(), and tunnel_uavcan_put_buffer().

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

◆ tunnel_uavcan_set_baudrate()

void tunnel_uavcan_set_baudrate ( struct tunnel_uavcan_periph up,
uint32_t  baudrate 
)

Definition at line 172 of file tunnel_uavcan.c.

Referenced by tunnel_uavcan_init_periph().

+ Here is the caller graph for this function:

Variable Documentation

◆ tunnel_uavcan0

struct tunnel_uavcan_periph tunnel_uavcan0

Definition at line 27 of file tunnel_uavcan.c.

Referenced by tunnel_uavcan_cb(), and tunnel_uavcan_init().