Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
cubexHal.pdf
Скачиваний:
110
Добавлен:
10.02.2016
Размер:
16.16 Mб
Скачать

UM1725

HAL CAN Generic Driver

6 HAL CAN Generic Driver

6.1CAN Firmware driver registers structures

6.1.1CAN_InitTypeDef

Data Fields

uint32_t Prescaler

uint32_t Mode

uint32_t SJW

uint32_t BS1

uint32_t BS2

uint32_t TTCM

uint32_t ABOM

uint32_t AWUM

uint32_t NART

uint32_t RFLM

uint32_t TXFP

Field Documentation

uint32_t CAN_InitTypeDef::Prescaler

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

uint32_t CAN_InitTypeDef::Mode

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

CAN_operating_mode

uint32_t CAN_InitTypeDef::SJW

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_synchronisation_jump_width

uint32_t CAN_InitTypeDef::BS1

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 CAN_InitTypeDef::BS2

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

uint32_t CAN_InitTypeDef::TTCM

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

uint32_t CAN_InitTypeDef::ABOM

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

uint32_t CAN_InitTypeDef::AWUM

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

ENABLE or DISABLE

uint32_t CAN_InitTypeDef::NART

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

DOCID025834 Rev 2

129/900

HAL CAN Generic Driver

UM1725

uint32_t CAN_InitTypeDef::RFLM

Enable or disable the receive FIFO Locked mode. This parameter can be set to

ENABLE or DISABLE

uint32_t CAN_InitTypeDef::TXFP

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

6.1.2CAN_FilterConfTypeDef

Data Fields

uint32_t FilterIdHigh

uint32_t FilterIdLow

uint32_t FilterMaskIdHigh

uint32_t FilterMaskIdLow

uint32_t FilterFIFOAssignment

uint32_t FilterNumber

uint32_t FilterMode

uint32_t FilterScale

uint32_t FilterActivation

uint32_t BankNumber

Field Documentation

uint32_t CAN_FilterConfTypeDef::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 CAN_FilterConfTypeDef::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 CAN_FilterConfTypeDef::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 CAN_FilterConfTypeDef::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 CAN_FilterConfTypeDef::FilterFIFOAssignment

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

uint32_t CAN_FilterConfTypeDef::FilterNumber

Specifies the filter which will be initialized. This parameter must be a number between Min_Data = 0 and Max_Data = 27

uint32_t CAN_FilterConfTypeDef::FilterMode

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

CAN_filter_mode

uint32_t CAN_FilterConfTypeDef::FilterScale

Specifies the filter scale. This parameter can be a value of CAN_filter_scale

130/900

DOCID025834 Rev 2

UM1725

HAL CAN Generic Driver

 

uint32_t CAN_FilterConfTypeDef::FilterActivation

 

Enable or disable the filter. This parameter can be set to ENABLE or DISABLE.

 

uint32_t CAN_FilterConfTypeDef::BankNumber

 

Select the start slave bank filter. This parameter must be a number between

 

Min_Data = 0 and Max_Data = 28

6.1.3CanTxMsgTypeDef

Data Fields

uint32_t StdId

uint32_t ExtId

uint32_t IDE

uint32_t RTR

uint32_t DLC

uint8_t Data

Field Documentation

uint32_t CanTxMsgTypeDef::StdId

Specifies the standard identifier. This parameter must be a number between

Min_Data = 0 and Max_Data = 0x7FF

uint32_t CanTxMsgTypeDef::ExtId

Specifies the extended identifier. This parameter must be a number between

Min_Data = 0 and Max_Data = 0x1FFFFFFF

uint32_t CanTxMsgTypeDef::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 CanTxMsgTypeDef::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 CanTxMsgTypeDef::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

uint8_t CanTxMsgTypeDef::Data[8]

Contains the data to be transmitted. This parameter must be a number between Min_Data = 0 and Max_Data = 0xFF

6.1.4CanRxMsgTypeDef

Data Fields

uint32_t StdId

uint32_t ExtId

uint32_t IDE

uint32_t RTR

uint32_t DLC

uint8_t Data

uint32_t FMI

DOCID025834 Rev 2

131/900

HAL CAN Generic Driver

UM1725

uint32_t FIFONumber

Field Documentation

uint32_t CanRxMsgTypeDef::StdId

Specifies the standard identifier. This parameter must be a number between

Min_Data = 0 and Max_Data = 0x7FF

uint32_t CanRxMsgTypeDef::ExtId

Specifies the extended identifier. This parameter must be a number between

Min_Data = 0 and Max_Data = 0x1FFFFFFF

uint32_t CanRxMsgTypeDef::IDE

Specifies the type of identifier for the message that will be received. This parameter can be a value of CAN_Identifier_Type

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

6.1.5CAN_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

132/900

DOCID025834 Rev 2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]