Expand description
§use-pin
Primitive electronic pin vocabulary.
use-pin describes pin numbers, pin names, roles, polarity, and references to component pins. It does not implement electrical simulation, embedded HAL traits, MCU pin configuration, or GPIO control.
§Example
use use_component::ReferenceDesignator;
use use_pin::{PinName, PinNumber, PinRef, PinRole};
let component = ReferenceDesignator::new("U2")?;
let numbered = PinRef::numbered(component.clone(), PinNumber::new(1)?);
let named = PinRef::named(component, PinName::new("VCC")?);
assert_eq!(numbered.to_string(), "U2:1");
assert_eq!(named.pin().to_string(), "VCC");
assert_eq!("power".parse::<PinRole>()?, PinRole::Power);§Scope
Use this crate for descriptive pin metadata only. Use embedded, HAL, firmware, or simulation crates for behavior.
Modules§
- prelude
- Commonly used pin primitives.
Structs§
- PinName
- A descriptive pin name such as
VCC,GND,SDA, orRESET. - PinNumber
- A one-based package or component pin number.
- PinRef
- A reference to a component pin, such as
U2:VCCorR1:1.
Enums§
- PinIdentifier
- A pin identified by number or name.
- PinName
Error - Errors returned while constructing pin names.
- PinNumber
Error - Errors returned while constructing pin numbers.
- PinPolarity
- Descriptive pin polarity vocabulary.
- PinPolarity
Parse Error - Errors returned while parsing pin polarity.
- PinRole
- Descriptive electronic pin roles.
- PinRole
Parse Error - Errors returned while parsing pin roles.