CAN Peripheral State functions.
More...
CAN Peripheral State functions.
==============================================================================
##### Peripheral State and Error functions #####
==============================================================================
[..]
This subsection provides functions allowing to :
(+) HAL_CAN_GetState() : Return the CAN state.
(+) HAL_CAN_GetError() : Return the CAN error codes if any.
(+) HAL_CAN_ResetError(): Reset the CAN error codes if any.
◆ HAL_CAN_GetError()
Return the CAN error code.
- Parameters
-
| hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
- Return values
-
Definition at line 2381 of file stm32l4xx_hal_can.c.
◆ HAL_CAN_GetState()
Return the CAN state.
- Parameters
-
| hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
- Return values
-
Definition at line 2346 of file stm32l4xx_hal_can.c.
2354 if ((hcan->
Instance->MSR & CAN_MSR_SLAK) != 0U)
2360 else if ((hcan->
Instance->MCR & CAN_MCR_SLEEP) != 0U)
__IO HAL_CAN_StateTypeDef State
HAL_CAN_StateTypeDef
HAL State structures definition.
◆ HAL_CAN_ResetError()
Reset the CAN error code.
- Parameters
-
| hcan | pointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN. |
- Return values
-
Definition at line 2393 of file stm32l4xx_hal_can.c.
2395 HAL_StatusTypeDef status =
HAL_OK;
2407 hcan->
ErrorCode |= HAL_CAN_ERROR_NOT_INITIALIZED;
__IO HAL_CAN_StateTypeDef State
HAL_CAN_StateTypeDef
HAL State structures definition.