Paparazzi UAS  v6.0_unstable-94-gda5b527-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
uavcan.h File Reference

Interface with uavcan using the Chibios can interfaces. More...

#include <hal.h>
#include <canard.h>
#include <string.h>
+ Include dependency graph for uavcan.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uavcan_iface_t
 uavcan interface structure More...
struct  uavcan_event_t
 Main uavcan event structure for registering/calling callbacks. More...


typedef void(* uavcan_callback )(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
 Generic uavcan callback definition. More...
typedef struct uavcan_event_t uavcan_event


void uavcan_init (void)
 uavcan interfaces More...
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. More...
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)
 Broadcast an uavcan message to a specific interface. More...

Detailed Description

Interface with uavcan using the Chibios can interfaces.

Stub needed for compiling modules requiring uavcan.

This uses multithreading and starts a transmit and receive thread per interface.

Definition in file uavcan.h.

Data Structure Documentation

struct uavcan_iface_t

uavcan interface structure

Definition at line 34 of file uavcan.h.

Data Fields
CANConfig can_cfg
CANDriver * can_driver
CanardInstance canard
uint8_t canard_memory_pool[1024 *2]
bool initialized
mutex_t mutex
uint8_t node_id
void * thread_rx_wa
size_t thread_rx_wa_size
void * thread_tx_wa
size_t thread_tx_wa_size
void * thread_uavcan_wa
size_t thread_uavcan_wa_size
uint8_t transfer_id
event_source_t tx_request
struct uavcan_event_t

Main uavcan event structure for registering/calling callbacks.

Definition at line 59 of file uavcan.h.

+ Collaboration diagram for uavcan_event_t:
Data Fields
uavcan_callback cb
uint16_t data_type_id
uint64_t data_type_signature
struct uavcan_event_t * next

Typedef Documentation

typedef void(* uavcan_callback)(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)

Generic uavcan callback definition.

Definition at line 56 of file uavcan.h.

typedef struct uavcan_event_t uavcan_event

Definition at line 65 of file uavcan.h.

Function Documentation

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 at line 267 of file uavcan.c.

References uavcan_event_t::cb, uavcan_event_t::data_type_id, uavcan_event_t::data_type_signature, ev, uavcan_event_t::next, and uavcan_event_hd.

Referenced by actuators_uavcan_init().

+ Here is the caller graph for this function:

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 

Broadcast an uavcan message to a specific interface.

Definition at line 282 of file uavcan.c.

References uavcan_iface_t::canard, uavcan_iface_t::initialized, uavcan_iface_t::mutex, uavcan_iface_t::transfer_id, and uavcan_iface_t::tx_request.

Referenced by actuators_uavcan_commit().

+ Here is the caller graph for this function:

void uavcan_init ( void  )

uavcan interfaces

uavcan external functions

uavcan interfaces

Definition at line 254 of file uavcan.c.

References uavcanInitIface().

+ Here is the call graph for this function: