Zephyr API 3.6.99
Loading...
Searching...
No Matches
can_timing Struct Reference

CAN bus timing structure. More...

#include <can.h>

Data Fields

uint16_t sjw
 Synchronisation jump width.
 
uint16_t prop_seg
 Propagation segment.
 
uint16_t phase_seg1
 Phase segment 1.
 
uint16_t phase_seg2
 Phase segment 2.
 
uint16_t prescaler
 Prescaler value.
 

Detailed Description

CAN bus timing structure.

This struct is used to pass bus timing values to the configuration and bitrate calculation functions.

The propagation segment represents the time of the signal propagation. Phase segment 1 and phase segment 2 define the sampling point. The prop_seg and phase_seg1 values affect the sampling point in the same way and some controllers only have a register for the sum of those two. The sync segment always has a length of 1 time quantum (see below).

+---------+----------+------------+------------+
|sync_seg | prop_seg | phase_seg1 | phase_seg2 |
+---------+----------+------------+------------+
^
Sampling-Point

1 time quantum (tq) has the length of 1/(core_clock / prescaler). The bitrate is defined by the core clock divided by the prescaler and the sum of the segments:

br = (core_clock / prescaler) / (1 + prop_seg + phase_seg1 + phase_seg2)

The Synchronization Jump Width (SJW) defines the amount of time quanta the sample point can be moved. The sample point is moved when resynchronization is needed.

Field Documentation

◆ phase_seg1

uint16_t can_timing::phase_seg1

Phase segment 1.

◆ phase_seg2

uint16_t can_timing::phase_seg2

Phase segment 2.

◆ prescaler

uint16_t can_timing::prescaler

Prescaler value.

◆ prop_seg

uint16_t can_timing::prop_seg

Propagation segment.

◆ sjw

uint16_t can_timing::sjw

Synchronisation jump width.


The documentation for this struct was generated from the following file: