RTEMS 7.0-rc1
Loading...
Searching...
No Matches
Macros | Functions
can-devcommon.c File Reference

This file is part of CAN/CAN FD bus common support and implements controller's side of FIFO operations. More...

#include <string.h>
#include <rtems/score/basedefs.h>
#include <dev/can/can-devcommon.h>
#include <dev/can/can-stats.h>

Macros

#define SEC_TO_NSEC   1000000000
 

Functions

void rtems_can_stats_reset (struct rtems_can_stats *stats)
 This function resets the controller's statistics.
 
int rtems_can_queue_ends_init_chip (struct rtems_can_chip *chip, const char *name)
 This function initializes ends from chip's side.
 
uint64_t rtems_can_fill_timestamp (void)
 This function fills timestamping with current monotonic time.
 
int rtems_can_chip_start (struct rtems_can_chip *chip)
 This function starts the controller.
 

Detailed Description

This file is part of CAN/CAN FD bus common support and implements controller's side of FIFO operations.

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

Function Documentation

◆ rtems_can_chip_start()

int rtems_can_chip_start ( struct rtems_can_chip chip)

This function starts the controller.

Provides common interface to start controller based on rtems_can_chip structure passed as input parameter.

Parameters
chipPointer to rtems_can_chip structure
Returns
Zero on success, negative value on error.

◆ rtems_can_fill_timestamp()

uint64_t rtems_can_fill_timestamp ( void  )

This function fills timestamping with current monotonic time.

Returns
64-bit timestamp value.

◆ rtems_can_queue_ends_init_chip()

int rtems_can_queue_ends_init_chip ( struct rtems_can_chip chip,
const char *  name 
)

This function initializes ends from chip's side.

It should be called by CAN controller to initialize its ends.

Parameters
chipPointer to rtems_can_chip structure
nameName of the controller's worker semaphore
Returns
Zero on success, negative value on error.

◆ 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.