Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
|
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. | |
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).
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.
uint16_t can_timing::phase_seg1 |
Phase segment 1.
uint16_t can_timing::phase_seg2 |
Phase segment 2.
uint16_t can_timing::prescaler |
Prescaler value.
uint16_t can_timing::prop_seg |
Propagation segment.
uint16_t can_timing::sjw |
Synchronisation jump width.