modm API documentation
|
#include <modm/platform/can/can_bit_timings.hpp>
Static Public Member Functions | |
static constexpr uint8_t | getBS1 () |
static constexpr uint8_t | getBS2 () |
static constexpr uint8_t | getSJW () |
static constexpr uint8_t | getPrescaler () |
static constexpr CanBitTimingConfiguration | getBitTimings () |
template<percent_t tolerance> | |
static constexpr void | assertBitrateInTolerance () |
CAN Bit Timing
Example for CAN bit timing: CLK on APB1 = 36 MHz BaudRate = 125 kBPs = 1 / NominalBitTime NominalBitTime = 8uS = tq + tBS1 + tBS2 with: tBS1 = tq * (TS1[3:0] + 1) = 12 * tq tBS2 = tq * (TS2[2:0] + 1) = 5 * tq tq = (BRP[9:0] + 1) * tPCLK where tq refers to the Time quantum tPCLK = time period of the APB clock = 1 / 36 MHz
STM32F1xx tPCLK = 1 / 36 MHz STM32F20x tPCLK = 1 / 30 MHz STM32F40x tPCLK = 1 / 42 MHz