Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
can.c File Reference
#include <stdint.h>
#include "mcu_periph/can.h"
#include "mcu_periph/can_arch.h"
+ Include dependency graph for can.c:

Go to the source code of this file.

Functions

uint8_t can_dlc_to_len (uint8_t dlc)
 
uint8_t can_len_to_dlc (uint8_t len)
 
void can_init ()
 
static int add_can_callback (struct can_periph *canp, can_rx_frame_callback_t callback, void *user_data)
 
int can_register_callback (can_rx_frame_callback_t callback, struct pprzaddr_can *src_addr, void *user_data)
 Add a callback on received frames from an interface.
 

Variables

static const uint8_t dlc_to_len [] = {0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64}
 

Function Documentation

◆ add_can_callback()

static int add_can_callback ( struct can_periph canp,
can_rx_frame_callback_t  callback,
void user_data 
)
static

Definition at line 65 of file can.c.

References CAN_NB_CALLBACKS_MAX, and foo.

Referenced by can_register_callback().

+ Here is the caller graph for this function:

◆ can_dlc_to_len()

uint8_t can_dlc_to_len ( uint8_t  dlc)

Definition at line 39 of file can.c.

References dlc_to_len, and foo.

Referenced by __unsupported_isr(), can_thd_rx(), and slcan_handle_frame().

+ Here is the caller graph for this function:

◆ can_init()

void can_init ( void  )

Definition at line 59 of file can.c.

References can_hw_init().

+ Here is the call graph for this function:

◆ can_len_to_dlc()

uint8_t can_len_to_dlc ( uint8_t  len)

Definition at line 46 of file can.c.

References dlc_to_len.

Referenced by can_transmit_frame(), and slcan_can_rx_cb().

+ Here is the caller graph for this function:

◆ can_register_callback()

int can_register_callback ( can_rx_frame_callback_t  callback,
struct pprzaddr_can src_addr,
void user_data 
)

Add a callback on received frames from an interface.

Parameters
callbackThe callback called on received frames
src_addrInterface from which frames are received. 0 means all interfaces.
user_dataPointer that will be passed in callback parameters
Returns
0 if the callback was successfully added.

Definition at line 78 of file can.c.

References add_can_callback(), and foo.

Referenced by slcan_init().

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

Variable Documentation

◆ dlc_to_len

const uint8_t dlc_to_len[] = {0,1,2,3,4,5,6,7,8,12,16,20,24,32,48,64}
static

Definition at line 37 of file can.c.

Referenced by can_dlc_to_len(), and can_len_to_dlc().