pub struct Pin {
pub hidden: bool,
pub unit: u32,
pub gate: u32,
pub number: String,
pub name: String,
pub alternates: Vec<String>,
pub electrical_type: String,
pub at: Point,
pub end: Point,
}Fields§
§unit: u32The symbol UNIT this pin belongs to, 1-based, as KiCad tags one. 0
means unassigned and reads as unit 1. A BREP part maps one unit to one
port group, so this is what says which connector a pin is on
(BREP_kernel/src/feature_pipeline/part_pins.rs).
Omitted when unset, so a SINGLE-UNIT symbol serializes exactly as it did before units existed. The editor compares its held symbol against the document’s block byte for byte to know whether it is in step, and a field that always wrote itself would put every stored symbol out of step until it was saved again.
gate: u32The GATE this pin is drawn with, 1-based: one of the separately placed
sections of a device, such as the two amplifiers and the power section of
a dual op-amp (KiCad calls them units and a sheet names them U1A, U1B,
…). 0 means the symbol is not split into gates.
A gate is a DRAWING matter only. Every gate of a device is one package,
one footprint and one port group, and a pin still binds by its number.
That is what keeps it apart from Pin::unit, which says which port
GROUP (which connector) a pin is on: the LM358’s pin 5 is on gate B and in
the same group as pin 1. Omitted when unset, for the reason unit is.
number: String§name: StringThe pin’s main name (PA1).
alternates: Vec<String>The other functions the pin can serve (I2C1_SDA, USART2_RTS), as
KiCad’s (alternate …) lists them. Each placed component chooses one of
these, or the main name, for each pin (Component::pin_functions).
The choice is DOCUMENTARY: it is the name the sheet prints, and nothing
electrical reads it — nets, ERC and the netlist keep binding by number
and reading the main name and type. Omitted when empty, for the reason
unit is.
electrical_type: String§at: Point§end: Point