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_arch.c File Reference
#include "mcu_periph/can_arch.h"
#include "mcu_periph/can.h"
#include "mcu_periph/sys_time_arch.h"
#include "stdio.h"
#include "string.h"
#include <ch.h>
#include <hal.h>
+ Include dependency graph for can_arch.c:

Go to the source code of this file.

Data Structures

struct  can_arch_periph
 

Functions

static void can_thd_rx (void *arg)
 
static void can_start (struct can_periph *canp)
 
static bool canConfigureIface (struct can_arch_periph *cas)
 Try to compute the timing registers for the can interface and set the configuration.
 
void can_hw_init ()
 
int can_transmit_frame (struct pprzcan_frame *txframe, struct pprzaddr_can *addr)
 

Data Structure Documentation

◆ can_arch_periph

struct can_arch_periph

Definition at line 24 of file can_arch.c.

+ Collaboration diagram for can_arch_periph:
Data Fields
struct pprzaddr_can addr
uint32_t can_baudrate
bool can_initialized
CANDriver * cand
uint32_t canport
CANConfig cfg
int if_index
bool new_rxframe
struct pprzcan_frame rxframe
void * thread_rx_wa
size_t thread_rx_wa_size

Function Documentation

◆ can_hw_init()

void can_hw_init ( void  )

Definition at line 68 of file can_arch.c.

References can1_arch_s, can_start(), and foo.

Referenced by can_init().

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

◆ can_start()

static void can_start ( struct can_periph canp)
static

Definition at line 172 of file can_arch.c.

References can1_arch_s, can_thd_rx(), canConfigureIface(), can_arch_periph::cfg, and foo.

Referenced by can_hw_init().

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

◆ can_thd_rx()

static void can_thd_rx ( void arg)
static

Definition at line 81 of file can_arch.c.

References can_dlc_to_len(), CAN_FRAME_EFF, CAN_FRAME_ERR, CAN_FRAME_RTR, pprzcan_frame::can_id, pprzaddr_can::can_ifindex, CAN_NB_CALLBACKS_MAX, CANFD_ESI, CANFD_FDF, foo, get_sys_time_msec(), and status.

Referenced by can_start().

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

◆ can_transmit_frame()

int can_transmit_frame ( struct pprzcan_frame txframe,
struct pprzaddr_can addr 
)

Definition at line 137 of file can_arch.c.

References CAN_EID_MASK, CAN_FRAME_EFF, CAN_FRAME_RTR, pprzaddr_can::can_ifindex, can_len_to_dlc(), CAN_SID_MASK, foo, and frame.

Referenced by slcan_handle_frame().

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

◆ canConfigureIface()

static bool canConfigureIface ( struct can_arch_periph cas)
static

Try to compute the timing registers for the can interface and set the configuration.

Definition at line 197 of file can_arch.c.

References foo.

Referenced by can_start().

+ Here is the caller graph for this function: