Loading...
Searching...
No Matches
candev_stm32.h File Reference

bxCAN specific definitions More...

Detailed Description

bxCAN specific definitions

Author
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m

Definition in file candev_stm32.h.

#include "can/candev.h"
+ Include dependency graph for candev_stm32.h:

Go to the source code of this file.

Data Structures

struct  can_conf_t
 ESP CAN device configuration. More...
 
struct  candev_stm32_rx_fifo
 This structure holds anything related to the receive part. More...
 
struct  candev_stm32_isr
 Internal interrupt flags. More...
 
struct  can
 Low level device structure for ESP32 CAN (extension of candev_t) More...
 

Macros

#define CANDEV_STM32_CHAN_NUMOF   1
 Number of channels in the device (up to 3)
 
#define CAN_STM32_NB_FILTER   28
 The maximum number of filters: 28 for dual channel, 14 for single channel.
 
#define CANDEV_STM32_DEFAULT_BITRATE   500000U
 Default bitrate.
 
#define CANDEV_STM32_DEFAULT_SPT   875
 Default sampling-point.
 
#define HAVE_CAN_CONF_T
 can_conf_t is re-defined
 
#define CAN_STM32_TX_MAILBOXES   3
 The number of transmit mailboxes.
 
#define CAN_STM32_RX_MAILBOXES   2
 The number of receive FIFO.
 
#define CAN_STM32_RX_MAIL_FIFO   12
 This is the maximum number of frame the driver can receive simultaneously.
 
#define HAVE_CAN_T
 can_t is re-defined
 

Typedefs

typedef struct can can_t
 bxCAN candev descriptor
 
typedef struct candev_stm32_rx_fifo candev_stm32_rx_fifo_t
 This structure holds anything related to the receive part.
 
typedef struct candev_stm32_isr candev_stm32_isr_t
 Internal interrupt flags.
 

Functions

void candev_stm32_set_pins (can_t *dev, gpio_t tx_pin, gpio_t rx_pin, gpio_af_t af)
 Set the pins of an stm32 CAN device.
 

ISR functions

#define ISR_CAN1_TX   isr_can1_tx
 
#define ISR_CAN1_RX0   isr_can1_rx0
 
#define ISR_CAN1_RX1   isr_can1_rx1
 
#define ISR_CAN1_SCE   isr_can1_sce
 
#define ISR_CAN2_TX   isr_can2_tx
 
#define ISR_CAN2_RX0   isr_can2_rx0
 
#define ISR_CAN2_RX1   isr_can2_rx1
 
#define ISR_CAN2_SCE   isr_can2_sce
 
#define ISR_CAN3_TX   isr_can3_tx
 
#define ISR_CAN3_RX0   isr_can3_rx0
 
#define ISR_CAN3_RX1   isr_can3_rx1
 
#define ISR_CAN3_SCE   isr_can3_sce
 

Macro Definition Documentation

◆ CAN_STM32_NB_FILTER

#define CAN_STM32_NB_FILTER   28

The maximum number of filters: 28 for dual channel, 14 for single channel.

Definition at line 78 of file candev_stm32.h.

◆ CAN_STM32_RX_MAIL_FIFO

#define CAN_STM32_RX_MAIL_FIFO   12

This is the maximum number of frame the driver can receive simultaneously.

Definition at line 141 of file candev_stm32.h.

◆ CAN_STM32_RX_MAILBOXES

#define CAN_STM32_RX_MAILBOXES   2

The number of receive FIFO.

Definition at line 137 of file candev_stm32.h.

◆ CAN_STM32_TX_MAILBOXES

#define CAN_STM32_TX_MAILBOXES   3

The number of transmit mailboxes.

Definition at line 135 of file candev_stm32.h.

◆ CANDEV_STM32_CHAN_NUMOF

#define CANDEV_STM32_CHAN_NUMOF   1

Number of channels in the device (up to 3)

Definition at line 46 of file candev_stm32.h.

◆ CANDEV_STM32_DEFAULT_BITRATE

#define CANDEV_STM32_DEFAULT_BITRATE   500000U

Default bitrate.

Definition at line 85 of file candev_stm32.h.

◆ CANDEV_STM32_DEFAULT_SPT

#define CANDEV_STM32_DEFAULT_SPT   875

Default sampling-point.

Definition at line 90 of file candev_stm32.h.

◆ HAVE_CAN_CONF_T

#define HAVE_CAN_CONF_T

can_conf_t is re-defined

Definition at line 132 of file candev_stm32.h.

◆ HAVE_CAN_T

#define HAVE_CAN_T

can_t is re-defined

Definition at line 147 of file candev_stm32.h.

◆ ISR_CAN1_RX0

#define ISR_CAN1_RX0   isr_can1_rx0

Definition at line 62 of file candev_stm32.h.

◆ ISR_CAN1_RX1

#define ISR_CAN1_RX1   isr_can1_rx1

Definition at line 63 of file candev_stm32.h.

◆ ISR_CAN1_SCE

#define ISR_CAN1_SCE   isr_can1_sce

Definition at line 64 of file candev_stm32.h.

◆ ISR_CAN1_TX

#define ISR_CAN1_TX   isr_can1_tx

Definition at line 61 of file candev_stm32.h.

◆ ISR_CAN2_RX0

#define ISR_CAN2_RX0   isr_can2_rx0

Definition at line 66 of file candev_stm32.h.

◆ ISR_CAN2_RX1

#define ISR_CAN2_RX1   isr_can2_rx1

Definition at line 67 of file candev_stm32.h.

◆ ISR_CAN2_SCE

#define ISR_CAN2_SCE   isr_can2_sce

Definition at line 68 of file candev_stm32.h.

◆ ISR_CAN2_TX

#define ISR_CAN2_TX   isr_can2_tx

Definition at line 65 of file candev_stm32.h.

◆ ISR_CAN3_RX0

#define ISR_CAN3_RX0   isr_can3_rx0

Definition at line 70 of file candev_stm32.h.

◆ ISR_CAN3_RX1

#define ISR_CAN3_RX1   isr_can3_rx1

Definition at line 71 of file candev_stm32.h.

◆ ISR_CAN3_SCE

#define ISR_CAN3_SCE   isr_can3_sce

Definition at line 72 of file candev_stm32.h.

◆ ISR_CAN3_TX

#define ISR_CAN3_TX   isr_can3_tx

Definition at line 69 of file candev_stm32.h.

Typedef Documentation

◆ can_t

typedef struct can can_t

bxCAN candev descriptor

Definition at line 145 of file candev_stm32.h.

Function Documentation

◆ candev_stm32_set_pins()

void candev_stm32_set_pins ( can_t dev,
gpio_t  tx_pin,
gpio_t  rx_pin,
gpio_af_t  af 
)

Set the pins of an stm32 CAN device.

Parameters
[in,out]devthe device to set pins
[in]tx_pintx pin
[in]rx_pinrx pin
[in]afalternate function