mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 18:13:34 +08:00
STM32 driver: CAN timing docs
This commit is contained in:
@@ -298,6 +298,12 @@ int CanIface::computeTimings(const uavcan::uint32_t target_bitrate, Timings& out
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Final validation
|
* 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())
|
if ((target_bitrate != (pclk / (prescaler * (1 + solution.bs1 + solution.bs2)))) || !solution.isValid())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user