1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Physical layer implementations for automotive protocols.
//!
//! This module provides implementations for the physical layer protocols:
//! - Classic CAN (Controller Area Network)
//! - CAN-FD (CAN with Flexible Data-Rate)
//!
//! The physical layer is responsible for the actual transmission and reception
//! of bits on the physical medium. It handles:
//! - Bit timing and synchronization
//! - Signal levels and electrical characteristics
//! - Frame formatting and bit stuffing
//! - Error detection at the physical level
//!
//! # Examples
//!
//! ```text
//! # Example usage of the physical layer (conceptual, not actual code)
//! # CAN interface example:
//! let can_config = can::CustomConfig {
//! bitrate: 500_000, // 500 kbps
//! sample_point: 0.75 // 75% sample point
//! };
//! let mut can = can::CustomInterface::new(can_config);
//! can.open();
//!
//! # CAN-FD interface example:
//! let canfd_config = canfd::CustomConfig {
//! data_bitrate: 2_000_000, // 2 Mbps
//! nominal_bitrate: 500_000 // 500 kbps
//! };
//! let mut canfd = canfd::CustomInterface::new(canfd_config);
//! canfd.open();
//! ```
use crate;
use crate;
/// Physical layer trait that must be implemented by hardware interfaces