Can_Handletypedef; Can Firmware Driver Api Description; How To Use This Driver - ST STM32F2 User Manual

Description of stm32f2 hal and low layer drivers
Hide thumbs Also See for STM32F2:
Table of Contents

Advertisement

HAL CAN Generic Driver
uint32_t CanRxMsgTypeDef::RTR
Specifies the type of frame for the received message. This parameter can be a value
of
CAN_remote_transmission_request
uint32_t CanRxMsgTypeDef::DLC
Specifies the length of the frame that will be received. This parameter must be a
number between Min_Data = 0 and Max_Data = 8
uint8_t CanRxMsgTypeDef::Data[8]
Contains the data to be received. This parameter must be a number between
Min_Data = 0 and Max_Data = 0xFF
uint32_t CanRxMsgTypeDef::FMI
Specifies the index of the filter the message stored in the mailbox passes through.
This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF
uint32_t CanRxMsgTypeDef::FIFONumber
Specifies the receive FIFO number. This parameter can be CAN_FIFO0 or
CAN_FIFO1
8.1.5

CAN_HandleTypeDef

Data Fields
CAN_TypeDef * Instance
CAN_InitTypeDef Init
CanTxMsgTypeDef * pTxMsg
CanRxMsgTypeDef * pRxMsg
__IO HAL_CAN_StateTypeDef State
HAL_LockTypeDef Lock
__IO uint32_t ErrorCode
Field Documentation
CAN_TypeDef* CAN_HandleTypeDef::Instance
Register base address
CAN_InitTypeDef CAN_HandleTypeDef::Init
CAN required parameters
CanTxMsgTypeDef* CAN_HandleTypeDef::pTxMsg
Pointer to transmit structure
CanRxMsgTypeDef* CAN_HandleTypeDef::pRxMsg
Pointer to reception structure
__IO HAL_CAN_StateTypeDef CAN_HandleTypeDef::State
CAN communication state
HAL_LockTypeDef CAN_HandleTypeDef::Lock
CAN locking object
__IO uint32_t CAN_HandleTypeDef::ErrorCode
CAN Error code This parameter can be a value of
8.2

CAN Firmware driver API description

8.2.1

How to use this driver

1.
Enable the CAN controller interface clock using __HAL_RCC_CAN1_CLK_ENABLE()
for CAN1 and __HAL_RCC_CAN2_CLK_ENABLE() for CAN2 In case you are using
CAN2 only, you have to enable the CAN1 clock.
2.
CAN pins configuration
108/1371
Enable the clock for the CAN GPIOs using the following function:
__GPIOx_CLK_ENABLE()
DocID028236 Rev 2
CAN_Error_Code
UM1940

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32F2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF