modm API documentation
modm::CanBitTiming< Clk, Bitrate, prescaler_width, bs1_width, bs2_width, sjw_width > Class Template Reference

#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 ()
 

Detailed Description

template<int32_t Clk, int32_t Bitrate, uint8_t prescaler_width = 10, uint8_t bs1_width = 4, uint8_t bs2_width = 3, uint8_t sjw_width = 2>
class modm::CanBitTiming< Clk, Bitrate, prescaler_width, bs1_width, bs2_width, sjw_width >

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

Author
Kevin Laeufer

The documentation for this class was generated from the following file: