mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-28 14:14:07 +08:00
STM32 driver: CAN timing docs
This commit is contained in:
parent
e5efb2bb62
commit
c2fec7be38
@ -298,6 +298,12 @@ int CanIface::computeTimings(const uavcan::uint32_t target_bitrate, Timings& out
|
||||
|
||||
/*
|
||||
* Final validation
|
||||
* Helpful Python:
|
||||
* def sample_point_from_btr(x):
|
||||
* assert 0b0011110010000000111111000000000 & x == 0
|
||||
* ts2,ts1,brp = (BTR>>20)&7, (BTR>>16)&15, BTR&511
|
||||
* return (1+ts1+1)/(1+ts1+1+ts2+1)
|
||||
*
|
||||
*/
|
||||
if ((target_bitrate != (pclk / (prescaler * (1 + solution.bs1 + solution.bs2)))) || !solution.isValid())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user