cancel
Showing results for 
Search instead for 
Did you mean: 

CAN_TypeDef details

jgauthier
Senior

Where can I find a document that details out the information of the bits, and how to use them, for the CAN_TypeDef structure?

http://stm32.kosyak.info/doc/struct_c_a_n___type_def.html

I am using an stm32L432, and stm32g0b, but I think the reference is the same for most of the MPUs that use bxCan.

3 REPLIES 3
Pavel A.
Evangelist III

For STM32L4 you want to use its specific header file, rather than something of STM32F10

https://github.com/STMicroelectronics/cmsis_device_l4/blob/master/Include/stm32l432xx.h

It doesn't document how to use them.

ie:

typedef struct
{
  __IO uint32_t TIR;  /*!< CAN TX mailbox identifier register */
  __IO uint32_t TDTR; /*!< CAN mailbox data length control and time stamp register */
  __IO uint32_t TDLR; /*!< CAN mailbox data low register */
  __IO uint32_t TDHR; /*!< CAN mailbox data high register */
} CAN_TxMailBox_TypeDef;

The only reference to TIR in that file.

		/* Request transmission */
		SET_BIT(hcan->Instance->sTxMailBox[TxMailbox].TIR, CAN_TI0R_TXRQ)

This is in HAL_CAN_AddTxMessage()

Also,

		/* Set up the Transmit Global Time mode */
		if (pHeader->TransmitGlobalTime == ENABLE) {
			SET_BIT(hcan->Instance->sTxMailBox[TxMailbox].TDTR, CAN_TDT0R_TGT);
		}

I'm looking for documentation on what to do with these registers.

Hello,

You can refer to STM32L4xx reference manual RM0394 / section 44 and more specifically the section 44.9 CAN registers that provides detailed descriptions of different bits.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.