Using the tscircuit TI Library
Overview
The @tsci/tscircuit.ti package provides ready-to-use Texas Instruments
reference subcircuits for tscircuit. Each export is a reusable
<subcircuit /> that bundles the TI chip together with
its supporting components, connectors, and nets.
Install the library in a local tscircuit project:
bun add @tsci/tscircuit.ti
Then import the TI subcircuit you want to place:
import { BQ24074Subcircuit } from "@tsci/tscircuit.ti";
All current component exports end with Subcircuit.
Place a TI Subcircuit
This example places the BQ24074Subcircuit single-cell Li-ion charger on a
small board.
import { BQ24074Subcircuit } from "@tsci/tscircuit.ti"
export default () => (
<board width="18mm" height="14mm">
<BQ24074Subcircuit name="BQ24074" />
</board>
)
Connect to a Pin Inside the Subcircuit
Imported TI parts are subcircuits. To connect an external component to a pin inside the subcircuit, start the selector with the placed subcircuit name, then select the internal component and pin.
In this example, R11.pin1 connects to the OUT pin on the internal U1
charger chip inside the BQ24074 subcircuit:
import { BQ24074Subcircuit } from "@tsci/tscircuit.ti"
export default () => (
<board width="22mm" height="16mm">
<BQ24074Subcircuit name="BQ24074" />
<resistor
name="R11"
resistance="1k"
footprint="0402"
pcbX={7}
pcbY={-3}
connections={{
pin1: ".BQ24074 .U1 .OUT",
}}
/>
</board>
)
The selector ".BQ24074 .U1 .OUT" means:
.BQ24074selects the placedBQ24074subcircuit.U1selects the internal charger chip namedU1.OUTselects theOUTpin on that chip
You can use the same pattern for other exported TI subcircuits and their
internal parts. For example, ".BQ24074 .J1 .DC_PLUS" selects the DC_PLUS
pin on the internal J1 input connector.
If you want a deeper refresher on selector syntax, see Port and Net Selectors.
Available Exports
The package currently exports these reusable TI subcircuits:
BQ24074SubcircuitBQ25895SubcircuitBQ27441G1SubcircuitCC2340R5SubcircuitCC3235SFSubcircuitDRV8833SubcircuitDRV8876SubcircuitHDC2080SubcircuitHDC3020SubcircuitHDC3022SubcircuitINA237SubcircuitMSPM0G3507SubcircuitTMP1075SubcircuitTPS22919SubcircuitTPS62933SubcircuitTPS63802SubcircuitTPS7A02SubcircuitTPSM82823Subcircuit
The package also exports:
TiSubcircuitComponentsto access the full map of exported TI subcircuitsTiSubcircuitNameas a union of the export namesTiSubcircuitComponentas a type for any exported TI subcircuit component