#[repr(C)]pub struct BMBitrate {
pub n_bitrate: u16,
pub d_bitrate: u16,
pub n_sample_pos: u8,
pub d_sample_pos: u8,
pub clock_freq: u8,
pub reserved: u8,
pub n_btr0: u8,
pub n_btr1: u8,
pub d_btr0: u8,
pub d_btr1: u8,
}Expand description
CAN channel bitrate configuration, used by super::api::BM_SetBitrate
Fields§
§n_bitrate: u16Nominal bitrate in kbps, default as 500, note this is the only valid bitrate in CAN CLASSIC mode.
d_bitrate: u16Data bitrate in kbps, default as 500, note this is ignored in CAN CLASSIC mode.
n_sample_pos: u8Nominal sample position (percentage, 0-100, default as 75
d_sample_pos: u8Data sample position (percentage, 0-100, default as 75
clock_freq: u8CAN controller clock in Mhz, default as 0
reserved: u8Reserved
n_btr0: u8Nominal BTR0 register value, note this value is calculated using clock_freq, which might not be 16MHz
n_btr1: u8Nominal BTR1 register value, note this value is calculated using clock_freq, which might not be 16MHz
d_btr0: u8Data BTR0 register value, note this value is calculated using clock_freq, which might not be 16MHz
d_btr1: u8Data BTR1 register value, note this value is calculated using clock_freq, which might not be 16MHz