Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
can_arch.c File Reference
#include "mcu_periph/can_arch.h"
#include "mcu_periph/can.h"
#include "mcu_periph/sys_time.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

Macros

#define USE_FDCAN_DRIVER   ((STM32_CAN_USE_FDCAN1) || (STM32_CAN_USE_FDCAN2) || (STM32_CAN_USE_FDCAN3))

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 26 of file can_arch.c.

Data Fields
uint32_t can_baudrate
CANDriver * cand
CANConfig cfg
int if_index
void * thread_rx_wa
size_t thread_rx_wa_size

Macro Definition Documentation

◆ USE_FDCAN_DRIVER

#define USE_FDCAN_DRIVER   ((STM32_CAN_USE_FDCAN1) || (STM32_CAN_USE_FDCAN2) || (STM32_CAN_USE_FDCAN3))

Definition at line 24 of file can_arch.c.

Function Documentation

◆ can_hw_init()

void can_hw_init ( void )

Definition at line 66 of file can_arch.c.

References can_start().

Referenced by can_init().

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

◆ can_start()

void can_start ( struct can_periph * canp)
static

Definition at line 208 of file can_arch.c.

References can_periph::arch_struct, can_thd_rx(), canConfigureIface(), can_arch_periph::cand, can_arch_periph::cfg, can_arch_periph::thread_rx_wa, and can_arch_periph::thread_rx_wa_size.

Referenced by can_hw_init().

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

◆ can_thd_rx()

void can_thd_rx ( void * arg)
static

◆ can_transmit_frame()

int can_transmit_frame ( struct pprzcan_frame * txframe,
struct pprzaddr_can * addr )

Definition at line 159 of file can_arch.c.

References CAN_EID_MASK, CAN_FRAME_EFF, CAN_FRAME_RTR, pprzcan_frame::can_id, pprzaddr_can::can_ifindex, can_len_to_dlc(), CAN_SID_MASK, pprzcan_frame::data, frame, and pprzcan_frame::len.

Referenced by slcan_handle_frame(), and uavcan_tx().

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

◆ canConfigureIface()

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 225 of file can_arch.c.

References can_arch_periph::can_baudrate, and can_arch_periph::cfg.

Referenced by can_start().

Here is the caller graph for this function: