Paparazzi UAS  v5.15_devel-81-gd13dafb
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.

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

#define NVIC_CAN1_RX_IRQ_PRIO   1

Definition at line 48 of file can_arch.c.

Referenced by can_hw_init().

#define NVIC_USB_LP_CAN_RX0_IRQ_PRIO   1

Definition at line 47 of file can_arch.c.

Referenced by can_hw_init().

Function Documentation

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.

void can_hw_init ( void  )

Definition at line 55 of file can_arch.c.

References CAN1, 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:

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

Definition at line 169 of file can_arch.c.

References CAN1, and can_initialized.

Referenced by ppz_can_transmit().

+ Here is the caller graph for this function:

Variable Documentation

bool can_initialized = false

Definition at line 53 of file can_arch.c.

Referenced by can_hw_init(), and can_hw_transmit().