pcb_toolkit/differential/
types.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7pub enum DiffProtocol {
8 Ddr2ClkDqs,
9 Ddr3ClkDqs,
10 Ddr4ClkDqs,
11 Usb2x,
12 Usb3x,
13 Lvds,
14 Hdmi,
15 Sata,
16 Ethernet,
17 DisplayPort,
18 DisplayPortEaglelake,
19 DisplayPortCalpella,
20 PcieGen1,
21 PcieGen2,
22 PcieGen3,
23 PcieGen4,
24 SsrxSstx,
25 Custom,
26}
27
28impl DiffProtocol {
29 pub fn target_zdiff(self) -> Option<f64> {
31 match self {
32 Self::Ddr2ClkDqs | Self::Ddr3ClkDqs => Some(100.0),
33 Self::Ddr4ClkDqs => Some(80.0),
34 Self::Usb2x => Some(90.0),
35 Self::Usb3x => Some(90.0),
36 Self::Lvds | Self::Hdmi | Self::Sata | Self::Ethernet => Some(100.0),
37 Self::DisplayPort => Some(100.0),
38 Self::DisplayPortEaglelake | Self::DisplayPortCalpella => Some(85.0),
39 Self::PcieGen1 => Some(100.0),
40 Self::PcieGen2 | Self::PcieGen3 | Self::PcieGen4 => Some(85.0),
41 Self::SsrxSstx => Some(85.0),
42 Self::Custom => None,
43 }
44 }
45}
46
47#[derive(Debug, Clone, Serialize, Deserialize)]
49pub struct DifferentialResult {
50 pub zdiff: f64,
52 pub zo: f64,
54 pub zodd: f64,
56 pub zeven: f64,
58 pub kb: f64,
60 pub kb_db: f64,
62}