GrepitAB / mcan

Unofficial MCAN Hardware Abstraction Layer
Apache License 2.0
24 stars 4 forks source link

Enable bit timing configuration for bit-rate switched data #3

Closed nilfit closed 2 years ago

nilfit commented 2 years ago

TimingParams is split to exploit the similarities between the bit timing configuration in NBTP and DBTP. Timestamping is just moved to a separate struct for now.

The validity of the parameters in the new BitTiming struct now checked when applying them instead of on construction. This prevents public fields in the struct allowing the user to skip the checks.

The divider (now called prescaler to better match the manual) calculation is changed to remove floating point operations.

Must