Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Interface with uavcan using the Chibios can interfaces. More...
#include <hal.h>
#include <canard.h>
#include <string.h>
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... | |
Typedefs | |
typedef void(* | uavcan_callback) (struct uavcan_iface_t *iface, CanardRxTransfer *transfer) |
Generic uavcan callback definition. More... | |
typedef struct uavcan_event_t | uavcan_event |
Functions | |
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... | |
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 |
Data Fields | ||
---|---|---|
uint32_t | can_baudrate | |
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.
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 412 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(), power_uavcan_init(), and range_sensor_uavcan_init().
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 427 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_cmd_commit(), and actuators_uavcan_commit().
void uavcan_init | ( | void | ) |
uavcan interfaces
uavcan external functions
uavcan interfaces
Definition at line 383 of file uavcan.c.
References uavcan_iface_t::can_cfg, and uavcanInitIface().