RTEMS 7.0-rc1
Loading...
Searching...
No Matches
Data Structures | Enumerations | Functions
can-stats.h File Reference

This header file is part of CAN/CAN FD bus common support. It implements controller's statistics. More...

Go to the source code of this file.

Data Structures

struct  rtems_can_stats
 This structure is used to represent CAN statistics. More...
 

Enumerations

enum  can_state {
  CAN_STATE_ERROR_ACTIVE = 0 , CAN_STATE_ERROR_WARNING , CAN_STATE_ERROR_PASSIVE , CAN_STATE_BUS_OFF ,
  CAN_STATE_STOPPED , CAN_STATE_SLEEPING , CAN_STATE_STOPPING , CAN_STATE_MAX
}
 This enum represents the current state of CAN controller. More...
 

Functions

void rtems_can_stats_reset (struct rtems_can_stats *stats)
 This function resets the controller's statistics.
 

Detailed Description

This header file is part of CAN/CAN FD bus common support. It implements controller's statistics.

Implementation is based on original LinCAN - Linux CAN bus driver Part of OrtCAN project https://ortcan.sourceforge.net/

Enumeration Type Documentation

◆ can_state

enum can_state

This enum represents the current state of CAN controller.

Enumerator
CAN_STATE_ERROR_ACTIVE 

This member indicates the controller is in error active state ( RX/TX error count < 96)

CAN_STATE_ERROR_WARNING 

This member indicates the controller is in error warning state ( RX/TX error count < 128)

CAN_STATE_ERROR_PASSIVE 

This member indicates the controller is in error passive state ( RX/TX error count < 256)

CAN_STATE_BUS_OFF 

This member indicates the controller is in bus off state ( RX/TX error count >= 256)

CAN_STATE_STOPPED 

This member indicates the the controller is stopped.

CAN_STATE_SLEEPING 

This member indicates the the controller is in sleep.

CAN_STATE_STOPPING 

This member indicates the the controller is in stopping process.

CAN_STATE_MAX 

This member holds the maximum number of controller's states.

Function Documentation

◆ rtems_can_stats_reset()

void rtems_can_stats_reset ( struct rtems_can_stats stats)

This function resets the controller's statistics.

This sets all fields of rtems_can_stats structure to zero. It should be called by the controller after it is started.

Parameters
statsPointer to rtems_can_stats structure.