Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
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 |
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.
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