STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
Peripheral State and Error functions

CAN Peripheral State functions. More...

Collaboration diagram for Peripheral State and Error functions:

Functions

HAL_CAN_StateTypeDef HAL_CAN_GetState (const CAN_HandleTypeDef *hcan)
 Return the CAN state.
 
uint32_t HAL_CAN_GetError (const CAN_HandleTypeDef *hcan)
 Return the CAN error code.
 
HAL_StatusTypeDef HAL_CAN_ResetError (CAN_HandleTypeDef *hcan)
 Reset the CAN error code.
 

Detailed Description

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.

Function Documentation

◆ HAL_CAN_GetState()

HAL_CAN_StateTypeDef HAL_CAN_GetState ( const CAN_HandleTypeDef * hcan)

#include <stm32f4xx_hal_can.h>

Return the CAN state.

Parameters
hcanpointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN.
Return values
HALstate

Definition at line 2376 of file stm32f4xx_hal_can.c.

References HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_CAN_STATE_SLEEP_ACTIVE, HAL_CAN_STATE_SLEEP_PENDING, CAN_HandleTypeDef::Instance, and CAN_HandleTypeDef::State.

◆ HAL_CAN_GetError()

uint32_t HAL_CAN_GetError ( const CAN_HandleTypeDef * hcan)

#include <stm32f4xx_hal_can.h>

Return the CAN error code.

Parameters
hcanpointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN.
Return values
CANError Code

Definition at line 2411 of file stm32f4xx_hal_can.c.

References CAN_HandleTypeDef::ErrorCode.

◆ HAL_CAN_ResetError()

HAL_StatusTypeDef HAL_CAN_ResetError ( CAN_HandleTypeDef * hcan)

#include <stm32f4xx_hal_can.h>

Reset the CAN error code.

Parameters
hcanpointer to a CAN_HandleTypeDef structure that contains the configuration information for the specified CAN.
Return values
HALstatus

Definition at line 2423 of file stm32f4xx_hal_can.c.

References CAN_HandleTypeDef::ErrorCode, HAL_CAN_ERROR_NOT_INITIALIZED, HAL_CAN_STATE_LISTENING, HAL_CAN_STATE_READY, HAL_ERROR, HAL_OK, and CAN_HandleTypeDef::State.