Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
can_timing Struct Reference

canbus timings More...

#include <can.h>

Data Fields

uint16_t sjw
 
uint16_t prop_seg
 
uint16_t phase_seg1
 
uint16_t phase_seg2
 
uint16_t prescaler
 

Detailed Description

canbus timings

Used to pass bus timing values to the config and bitrate calculator function.

The propagation segment represents the time of the signal propagation. Phase segment 1 and phase segment 2 define the sampling point. prop_seg and phase_seg1 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 tq +------—+-------—+---------—+---------—+ |sync_seg | prop_seg | phase_seg1 | phase_seg2 | +------—+-------—+---------—+---------—+ ^ Sampling-Point 1 tq (time quantum) 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 resynchronization jump width (SJW) defines the amount of time quantum 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: