2022-03-18 06:42 AM
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.
2022-03-19 10:09 AM
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
2022-03-20 05:21 AM
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.
2022-03-21 04:38 AM
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.