26#ifndef MODULES_UAVCAN_ARCH_H
27#define MODULES_UAVCAN_ARCH_H
37#ifndef UAVCAN_TX_FIFO_SIZE
38#define UAVCAN_TX_FIFO_SIZE 1024
41#define UAVCAN_TID_STORE_CAPACITY 30
45#ifndef UAVCAN_RX_QUEUE_SIZE
46#define UAVCAN_RX_QUEUE_SIZE 64
55#define UAVCAN_RX_BUFFER_SIZE (UAVCAN_RX_QUEUE_SIZE * (sizeof(struct uavcan_rx_frame) + 2) + 3)
70 #if CANARD_ALLOCATE_SEM
This is a general purpose circular buffer for storing variable lenght buffers in a FIFO order.
struct pprzBSem pprz_bsem_t
struct pprzMutex pprz_mutex_t
uint32_t timestamp
Reception time (us).
uint8_t transfer_ids_values[UAVCAN_TID_STORE_CAPACITY]
void(* uavcan_callback)(struct uavcan_iface_t *iface, CanardRxTransfer *transfer)
Generic uavcan callback definition.
#define UAVCAN_RX_BUFFER_SIZE
A frame is a record of the framed ring buffer: 2 bytes length, and 3 bytes margin for the buffer.
void uavcan_init(void)
uavcan interfaces
uint8_t rx_queue_buf[UAVCAN_RX_BUFFER_SIZE]
void uavcan_transfer(struct uavcan_iface_t *iface, CanardTxTransfer *transfer)
uint32_t transfer_ids_keys[UAVCAN_TID_STORE_CAPACITY]
uint16_t rx_overflows
Frames dropped because the queue was full.
struct framed_ring_buffer rx_queue
Received frames, from the CAN receive thread to the main thread.
struct pprzaddr_can can_net
void uavcan_request(struct uavcan_iface_t *iface, uint8_t destination_node_id, CanardTxTransfer *transfer)
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.
kv_store_t transfer_ids_store
#define UAVCAN_TID_STORE_CAPACITY
uint8_t transfer_ids_used[UAVCAN_TID_STORE_CAPACITY]
void uavcan_reporting(void)
struct uavcan_event_t * next
void uavcan_rx_event(void)
Handle the received frames of all interfaces (main thread).
void uavcan_response(struct uavcan_iface_t *iface, uint8_t destination_node_id, CanardTxTransfer *transfer)
uint64_t data_type_signature
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.
uint8_t canard_memory_pool[1024 *2]
Main uavcan event structure for registering/calling callbacks.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned long long uint64_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
int transfer(const Mat *from, const image_t *to)