Pins
In typeCAD, the Pin object represents the pin/leg/lead/ball etc. of a component.
Pin Access Methods
There are two ways to access pins in typeCAD:
Numeric Pin Access: component.pin(number)
Use this for simple components like passives where pin numbers are straightforward:
import { Resistor } from '@typecad/passives/0805'
let r1 = new Resistor({ value: '1kohm' });
r1.pin(1); // first pin
r1.pin(2); // second pinNamed Pin Access: component.PINNAME
Use this for complex components (ICs, connectors) where pins have descriptive names and their own .ts file where Pin objects are defined:
import { ATtiny85_20S } from './ATtiny85_20S';
let u1 = new ATtiny85_20S();
u1.VCC // power pin (internally pin 8)
u1.GND // ground pin (internally pin 4)
u1.PB0 // GPIO pin PB0Power aware
Each Pin object has an optional powerInfo object that can be passed via the component.pin() config. It has the following properties:
minimum_voltage— minimum voltage the pin can toleratemaximum_voltage— maximum voltage the pin can toleratecurrent— maximum current the pin can handle
When pins have the object passed with data, typeCAD can check that the voltage levels and current draw are compatible with each other.
VCC = this.pin(8, { type: 'power_in', powerInfo: {
minimum_voltage: -0.5,
maximum_voltage: 6,
current: 0.2,
}});VCC can accept -0.5 to 6 volts and supply up to 0.2 amps. When connected to other pins, typeCAD can check that the voltage and current levels are compatible and issue error or warning messages if the voltage is too high or the current draw is too much.
On This Page