|
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Interface with uavcan using the Chibios can interfaces. More...
#include <canard.h>#include <string.h>#include "mcu_periph/can.h"#include "modules/core/threads.h"#include "utils/circular_buffer.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... | |
Macros | |
| #define | UAVCAN_TX_FIFO_SIZE 1024 |
| #define | UAVCAN_MSG_MAX_SIZE 256 |
Typedefs | |
| typedef void(* | uavcan_callback) (struct uavcan_iface_t *iface, CanardRxTransfer *transfer) |
| Generic uavcan callback definition. | |
| typedef struct uavcan_event_t | uavcan_event |
Functions | |
| void | uavcan_init (void) |
| uavcan interfaces | |
| 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. | |
| 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. | |
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.
| struct uavcan_iface_t |
Collaboration diagram for uavcan_iface_t:| Data Fields | ||
|---|---|---|
| struct circular_buffer | _tx_fifo | |
| uint8_t | _tx_fifo_buffer[UAVCAN_TX_FIFO_SIZE] | |
| pprz_bsem_t | bsem | |
| uint32_t | can_baudrate | |
| struct pprzaddr_can | can_net | |
| CanardInstance | canard | |
| uint8_t | canard_memory_pool[1024 *2] | |
| bool | initialized | |
| pprz_mutex_t | mutex | |
| uint8_t | node_id | |
| pprz_thread_t | thread_tx | |
| uint8_t | transfer_id | |
| pprz_mutex_t | tx_fifo_mutex | |
| event_source_t | tx_request | |
| struct uavcan_event_t |
Main uavcan event structure for registering/calling callbacks.
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 void(* uavcan_callback) (struct uavcan_iface_t *iface, CanardRxTransfer *transfer) |
| typedef struct uavcan_event_t uavcan_event |
| 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 250 of file uavcan.c.
References abi_struct::cb, ev, abi_struct::next, and uavcan_event_hd.
Referenced by actuators_uavcan_init(), airspeed_uavcan_init(), can_fuelcell_init(), gps_uavcan_init(), mag_uavcan_init(), power_uavcan_init(), and range_sensor_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 265 of file uavcan.c.
References circular_buffer_drop(), circular_buffer_put(), foo, pprz_bsem_signal(), pprz_mtx_lock(), and pprz_mtx_unlock().
Referenced by actuators_uavcan_cmd_commit(), and actuators_uavcan_commit().
Here is the call graph for this function:
Here is the caller graph for this function: