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

Handling of CAN hardware for STM32. More...

#include <stdint.h>
#include <string.h>
#include "mcu_periph/can_arch.h"
#include "mcu_periph/can.h"
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/can.h>
#include <libopencm3/cm3/nvic.h>
#include "led.h"
+ Include dependency graph for can_arch.c:

Go to the source code of this file.

Data Structures

struct  can_arch_periph
 

Macros

#define NVIC_USB_LP_CAN_RX0_IRQ_PRIO   1
 
#define NVIC_CAN1_RX_IRQ_PRIO   1
 

Functions

void _can_run_rx_callback (uint32_t id, uint8_t *buf, uint8_t len)
 
void can_hw_init (void)
 
int can_transmit_frame (struct pprzcan_frame *txframe, struct pprzaddr_can *addr)
 
void __unsupported_isr (void)
 
void can_event ()
 

Variables

struct can_arch_periph can1_arch_s
 

Detailed Description

Handling of CAN hardware for STM32.

Definition in file can_arch.c.


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

Macro Definition Documentation

◆ NVIC_CAN1_RX_IRQ_PRIO

#define NVIC_CAN1_RX_IRQ_PRIO   1

Definition at line 48 of file can_arch.c.

◆ NVIC_USB_LP_CAN_RX0_IRQ_PRIO

#define NVIC_USB_LP_CAN_RX0_IRQ_PRIO   1

Definition at line 47 of file can_arch.c.

Function Documentation

◆ __unsupported_isr()

◆ _can_run_rx_callback()

void _can_run_rx_callback ( uint32_t  id,
uint8_t buf,
uint8_t  len 
)

◆ can_event()

◆ can_hw_init()

void can_hw_init ( void  )

◆ can_transmit_frame()

int can_transmit_frame ( struct pprzcan_frame txframe,
struct pprzaddr_can addr 
)

Definition at line 184 of file can_arch.c.

References can1_arch_s, CAN_EID_MASK, CAN_FRAME_RTR, can_arch_periph::can_initialized, can_len_to_dlc(), CAN_SID_MASK, can_arch_periph::canport, and foo.

+ Here is the call graph for this function:

Variable Documentation

◆ can1_arch_s

struct can_arch_periph can1_arch_s
Initial value:
= {
.canport = CAN1,
.can_initialized = false,
.addr = {.can_ifindex = 1},
.rxframe = {0},
.new_rxframe = false;
}
uint16_t foo
Definition main_demo5.c:58

Definition at line 61 of file can_arch.c.

Referenced by __unsupported_isr(), can_event(), can_hw_init(), can_hw_init(), can_start(), and can_transmit_frame().