Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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.

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_hw_transmit (uint32_t id, const uint8_t *buf, uint8_t len)
 

Variables

bool can_initialized = false
 

Detailed Description

Handling of CAN hardware for STM32.

Definition in file can_arch.c.

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

◆ _can_run_rx_callback()

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

Definition at line 43 of file can.c.

References can_rx_callback.

◆ can_hw_init()

void can_hw_init ( void  )

Definition at line 55 of file can_arch.c.

References can_initialized, GPIO8, GPIO9, GPIO_AF9, gpio_set(), GPIOB, NVIC_CAN1_RX_IRQ_PRIO, and NVIC_USB_LP_CAN_RX0_IRQ_PRIO.

Referenced by ppz_can_init().

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

◆ can_hw_transmit()

int can_hw_transmit ( uint32_t  id,
const uint8_t buf,
uint8_t  len 
)

Definition at line 168 of file can_arch.c.

References can_initialized.

Referenced by ppz_can_transmit().

+ Here is the caller graph for this function:

Variable Documentation

◆ can_initialized

bool can_initialized = false

Definition at line 53 of file can_arch.c.

Referenced by can_hw_init(), and can_hw_transmit().