STM32L4xx_HAL_Driver  1.14.0
CAN Exported Types

Data Structures

struct  CAN_InitTypeDef
 CAN init structure definition. More...
 
struct  CAN_FilterTypeDef
 CAN filter configuration structure definition. More...
 
struct  CAN_TxHeaderTypeDef
 CAN Tx message header structure definition. More...
 
struct  CAN_RxHeaderTypeDef
 CAN Rx message header structure definition. More...
 
struct  __CAN_HandleTypeDef
 CAN handle Structure definition. More...
 

Typedefs

typedef struct __CAN_HandleTypeDef CAN_HandleTypeDef
 CAN handle Structure definition. More...
 
typedef void(* pCAN_CallbackTypeDef) (CAN_HandleTypeDef *hcan)
 HAL CAN Callback pointer definition. More...
 

Enumerations

enum  HAL_CAN_StateTypeDef {
  HAL_CAN_STATE_RESET = 0x00U, HAL_CAN_STATE_READY = 0x01U, HAL_CAN_STATE_LISTENING = 0x02U, HAL_CAN_STATE_SLEEP_PENDING = 0x03U,
  HAL_CAN_STATE_SLEEP_ACTIVE = 0x04U, HAL_CAN_STATE_ERROR = 0x05U
}
 HAL State structures definition. More...
 
enum  HAL_CAN_CallbackIDTypeDef {
  HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID = 0x00U, HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID = 0x01U, HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID = 0x02U, HAL_CAN_TX_MAILBOX0_ABORT_CB_ID = 0x03U,
  HAL_CAN_TX_MAILBOX1_ABORT_CB_ID = 0x04U, HAL_CAN_TX_MAILBOX2_ABORT_CB_ID = 0x05U, HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID = 0x06U, HAL_CAN_RX_FIFO0_FULL_CB_ID = 0x07U,
  HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID = 0x08U, HAL_CAN_RX_FIFO1_FULL_CB_ID = 0x09U, HAL_CAN_SLEEP_CB_ID = 0x0AU, HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID = 0x0BU,
  HAL_CAN_ERROR_CB_ID = 0x0CU, HAL_CAN_MSPINIT_CB_ID = 0x0DU, HAL_CAN_MSPDEINIT_CB_ID = 0x0EU
}
 HAL CAN common Callback ID enumeration definition. More...
 

Detailed Description


Data Structure Documentation

◆ CAN_InitTypeDef

struct CAN_InitTypeDef

CAN init structure definition.

Definition at line 61 of file stm32l4xx_hal_can.h.

Data Fields
FunctionalState AutoBusOff

Enable or disable the automatic bus-off management. This parameter can be set to ENABLE or DISABLE.

FunctionalState AutoRetransmission

Enable or disable the non-automatic retransmission mode. This parameter can be set to ENABLE or DISABLE.

FunctionalState AutoWakeUp

Enable or disable the automatic wake-up mode. This parameter can be set to ENABLE or DISABLE.

uint32_t Mode

Specifies the CAN operating mode. This parameter can be a value of CAN Operating Mode

uint32_t Prescaler

Specifies the length of a time quantum. This parameter must be a number between Min_Data = 1 and Max_Data = 1024.

FunctionalState ReceiveFifoLocked

Enable or disable the Receive FIFO Locked mode. This parameter can be set to ENABLE or DISABLE.

uint32_t SyncJumpWidth

Specifies the maximum number of time quanta the CAN hardware is allowed to lengthen or shorten a bit to perform resynchronization. This parameter can be a value of CAN Synchronization Jump Width

uint32_t TimeSeg1

Specifies the number of time quanta in Bit Segment 1. This parameter can be a value of CAN Time Quantum in Bit Segment 1

uint32_t TimeSeg2

Specifies the number of time quanta in Bit Segment 2. This parameter can be a value of CAN Time Quantum in Bit Segment 2

FunctionalState TimeTriggeredMode

Enable or disable the time triggered communication mode. This parameter can be set to ENABLE or DISABLE.

FunctionalState TransmitFifoPriority

Enable or disable the transmit FIFO priority. This parameter can be set to ENABLE or DISABLE.

◆ CAN_FilterTypeDef

struct CAN_FilterTypeDef

CAN filter configuration structure definition.

Definition at line 102 of file stm32l4xx_hal_can.h.

Data Fields
uint32_t FilterActivation

Enable or disable the filter. This parameter can be a value of CAN Filter Activation

uint32_t FilterBank

Specifies the filter bank which will be initialized. For single CAN instance(14 dedicated filter banks), this parameter must be a number between Min_Data = 0 and Max_Data = 13. For dual CAN instances(28 filter banks shared), this parameter must be a number between Min_Data = 0 and Max_Data = 27.

uint32_t FilterFIFOAssignment

Specifies the FIFO (0 or 1U) which will be assigned to the filter. This parameter can be a value of CAN Filter FIFO

uint32_t FilterIdHigh

Specifies the filter identification number (MSBs for a 32-bit configuration, first one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF.

uint32_t FilterIdLow

Specifies the filter identification number (LSBs for a 32-bit configuration, second one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF.

uint32_t FilterMaskIdHigh

Specifies the filter mask number or identification number, according to the mode (MSBs for a 32-bit configuration, first one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF.

uint32_t FilterMaskIdLow

Specifies the filter mask number or identification number, according to the mode (LSBs for a 32-bit configuration, second one for a 16-bit configuration). This parameter must be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF.

uint32_t FilterMode

Specifies the filter mode to be initialized. This parameter can be a value of CAN Filter Mode

uint32_t FilterScale

Specifies the filter scale. This parameter can be a value of CAN Filter Scale

uint32_t SlaveStartFilterBank

Select the start filter bank for the slave CAN instance. For single CAN instances, this parameter is meaningless. For dual CAN instances, all filter banks with lower index are assigned to master CAN instance, whereas all filter banks with greater index are assigned to slave CAN instance. This parameter must be a number between Min_Data = 0 and Max_Data = 27.

◆ CAN_TxHeaderTypeDef

struct CAN_TxHeaderTypeDef

CAN Tx message header structure definition.

Definition at line 152 of file stm32l4xx_hal_can.h.

Data Fields
uint32_t DLC

Specifies the length of the frame that will be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 8.

uint32_t ExtId

Specifies the extended identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF.

uint32_t IDE

Specifies the type of identifier for the message that will be transmitted. This parameter can be a value of CAN Identifier Type

uint32_t RTR

Specifies the type of frame for the message that will be transmitted. This parameter can be a value of CAN Remote Transmission Request

uint32_t StdId

Specifies the standard identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF.

FunctionalState TransmitGlobalTime

Specifies whether the timestamp counter value captured on start of frame transmission, is sent in DATA6 and DATA7 replacing pData[6] and pData[7].

Note
: Time Triggered Communication Mode must be enabled.
: DLC must be programmed as 8 bytes, in order these 2 bytes are sent. This parameter can be set to ENABLE or DISABLE.

◆ CAN_RxHeaderTypeDef

struct CAN_RxHeaderTypeDef

CAN Rx message header structure definition.

Definition at line 180 of file stm32l4xx_hal_can.h.

Data Fields
uint32_t DLC

Specifies the length of the frame that will be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 8.

uint32_t ExtId

Specifies the extended identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFFFFF.

uint32_t FilterMatchIndex

Specifies the index of matching acceptance filter element. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF.

uint32_t IDE

Specifies the type of identifier for the message that will be transmitted. This parameter can be a value of CAN Identifier Type

uint32_t RTR

Specifies the type of frame for the message that will be transmitted. This parameter can be a value of CAN Remote Transmission Request

uint32_t StdId

Specifies the standard identifier. This parameter must be a number between Min_Data = 0 and Max_Data = 0x7FF.

uint32_t Timestamp

Specifies the timestamp counter value captured on start of frame reception.

Note
: Time Triggered Communication Mode must be enabled. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF.

◆ __CAN_HandleTypeDef

struct __CAN_HandleTypeDef

CAN handle Structure definition.

Definition at line 209 of file stm32l4xx_hal_can.h.

Data Fields

CAN_TypeDef * Instance
 
CAN_InitTypeDef Init
 
__IO HAL_CAN_StateTypeDef State
 
__IO uint32_t ErrorCode
 
void(* TxMailbox0CompleteCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* TxMailbox1CompleteCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* TxMailbox2CompleteCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* TxMailbox0AbortCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* TxMailbox1AbortCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* TxMailbox2AbortCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* RxFifo0MsgPendingCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* RxFifo0FullCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* RxFifo1MsgPendingCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* RxFifo1FullCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* SleepCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* WakeUpFromRxMsgCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* ErrorCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* MspInitCallback )(struct __CAN_HandleTypeDef *hcan)
 
void(* MspDeInitCallback )(struct __CAN_HandleTypeDef *hcan)
 

Field Documentation

◆ ErrorCallback

void(* __CAN_HandleTypeDef::ErrorCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Error callback

Definition at line 233 of file stm32l4xx_hal_can.h.

◆ ErrorCode

__IO uint32_t __CAN_HandleTypeDef::ErrorCode

CAN Error code. This parameter can be a value of CAN Error Code

Definition at line 217 of file stm32l4xx_hal_can.h.

◆ Init

CAN_InitTypeDef __CAN_HandleTypeDef::Init

CAN required parameters

Definition at line 213 of file stm32l4xx_hal_can.h.

◆ Instance

CAN_TypeDef* __CAN_HandleTypeDef::Instance

Register base address

Definition at line 211 of file stm32l4xx_hal_can.h.

◆ MspDeInitCallback

void(* __CAN_HandleTypeDef::MspDeInitCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Msp DeInit callback

Definition at line 236 of file stm32l4xx_hal_can.h.

◆ MspInitCallback

void(* __CAN_HandleTypeDef::MspInitCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Msp Init callback

Definition at line 235 of file stm32l4xx_hal_can.h.

◆ RxFifo0FullCallback

void(* __CAN_HandleTypeDef::RxFifo0FullCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Rx FIFO 0 full callback

Definition at line 228 of file stm32l4xx_hal_can.h.

◆ RxFifo0MsgPendingCallback

void(* __CAN_HandleTypeDef::RxFifo0MsgPendingCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Rx FIFO 0 msg pending callback

Definition at line 227 of file stm32l4xx_hal_can.h.

◆ RxFifo1FullCallback

void(* __CAN_HandleTypeDef::RxFifo1FullCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Rx FIFO 1 full callback

Definition at line 230 of file stm32l4xx_hal_can.h.

◆ RxFifo1MsgPendingCallback

void(* __CAN_HandleTypeDef::RxFifo1MsgPendingCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Rx FIFO 1 msg pending callback

Definition at line 229 of file stm32l4xx_hal_can.h.

◆ SleepCallback

void(* __CAN_HandleTypeDef::SleepCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Sleep callback

Definition at line 231 of file stm32l4xx_hal_can.h.

◆ State

__IO HAL_CAN_StateTypeDef __CAN_HandleTypeDef::State

CAN communication state

Definition at line 215 of file stm32l4xx_hal_can.h.

◆ TxMailbox0AbortCallback

void(* __CAN_HandleTypeDef::TxMailbox0AbortCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 0 abort callback

Definition at line 224 of file stm32l4xx_hal_can.h.

◆ TxMailbox0CompleteCallback

void(* __CAN_HandleTypeDef::TxMailbox0CompleteCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 0 complete callback

Definition at line 221 of file stm32l4xx_hal_can.h.

◆ TxMailbox1AbortCallback

void(* __CAN_HandleTypeDef::TxMailbox1AbortCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 1 abort callback

Definition at line 225 of file stm32l4xx_hal_can.h.

◆ TxMailbox1CompleteCallback

void(* __CAN_HandleTypeDef::TxMailbox1CompleteCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 1 complete callback

Definition at line 222 of file stm32l4xx_hal_can.h.

◆ TxMailbox2AbortCallback

void(* __CAN_HandleTypeDef::TxMailbox2AbortCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 2 abort callback

Definition at line 226 of file stm32l4xx_hal_can.h.

◆ TxMailbox2CompleteCallback

void(* __CAN_HandleTypeDef::TxMailbox2CompleteCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Tx Mailbox 2 complete callback

Definition at line 223 of file stm32l4xx_hal_can.h.

◆ WakeUpFromRxMsgCallback

void(* __CAN_HandleTypeDef::WakeUpFromRxMsgCallback) (struct __CAN_HandleTypeDef *hcan)

CAN Wake Up from Rx msg callback

Definition at line 232 of file stm32l4xx_hal_can.h.

Typedef Documentation

◆ CAN_HandleTypeDef

CAN handle Structure definition.

◆ pCAN_CallbackTypeDef

typedef void(* pCAN_CallbackTypeDef) (CAN_HandleTypeDef *hcan)

HAL CAN Callback pointer definition.

pointer to a CAN callback function

Definition at line 269 of file stm32l4xx_hal_can.h.

Enumeration Type Documentation

◆ HAL_CAN_CallbackIDTypeDef

HAL CAN common Callback ID enumeration definition.

Enumerator
HAL_CAN_TX_MAILBOX0_COMPLETE_CB_ID 

CAN Tx Mailbox 0 complete callback ID

HAL_CAN_TX_MAILBOX1_COMPLETE_CB_ID 

CAN Tx Mailbox 1 complete callback ID

HAL_CAN_TX_MAILBOX2_COMPLETE_CB_ID 

CAN Tx Mailbox 2 complete callback ID

HAL_CAN_TX_MAILBOX0_ABORT_CB_ID 

CAN Tx Mailbox 0 abort callback ID

HAL_CAN_TX_MAILBOX1_ABORT_CB_ID 

CAN Tx Mailbox 1 abort callback ID

HAL_CAN_TX_MAILBOX2_ABORT_CB_ID 

CAN Tx Mailbox 2 abort callback ID

HAL_CAN_RX_FIFO0_MSG_PENDING_CB_ID 

CAN Rx FIFO 0 message pending callback ID

HAL_CAN_RX_FIFO0_FULL_CB_ID 

CAN Rx FIFO 0 full callback ID

HAL_CAN_RX_FIFO1_MSG_PENDING_CB_ID 

CAN Rx FIFO 1 message pending callback ID

HAL_CAN_RX_FIFO1_FULL_CB_ID 

CAN Rx FIFO 1 full callback ID

HAL_CAN_SLEEP_CB_ID 

CAN Sleep callback ID

HAL_CAN_WAKEUP_FROM_RX_MSG_CB_ID 

CAN Wake Up fropm Rx msg callback ID

HAL_CAN_ERROR_CB_ID 

CAN Error callback ID

HAL_CAN_MSPINIT_CB_ID 

CAN MspInit callback ID

HAL_CAN_MSPDEINIT_CB_ID 

CAN MspDeInit callback ID

Definition at line 245 of file stm32l4xx_hal_can.h.

246 {
257  HAL_CAN_SLEEP_CB_ID = 0x0AU,
259  HAL_CAN_ERROR_CB_ID = 0x0CU,
261  HAL_CAN_MSPINIT_CB_ID = 0x0DU,
262  HAL_CAN_MSPDEINIT_CB_ID = 0x0EU,
HAL_CAN_CallbackIDTypeDef
HAL CAN common Callback ID enumeration definition.

◆ HAL_CAN_StateTypeDef

HAL State structures definition.

Enumerator
HAL_CAN_STATE_RESET 

CAN not yet initialized or disabled

HAL_CAN_STATE_READY 

CAN initialized and ready for use

HAL_CAN_STATE_LISTENING 

CAN receive process is ongoing

HAL_CAN_STATE_SLEEP_PENDING 

CAN sleep request is pending

HAL_CAN_STATE_SLEEP_ACTIVE 

CAN sleep mode is active

HAL_CAN_STATE_ERROR 

CAN error state

Definition at line 47 of file stm32l4xx_hal_can.h.