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 { INA237Subcircuit } from "@tsci/tscircuit.ti"
All current component exports end with Subcircuit.
Place a TI Subcircuit
This example places the INA237Subcircuit current, voltage, and power monitor
on a small board.
import { INA237Subcircuit } from "@tsci/tscircuit.ti"
export default () => (
<board width="18mm" height="14mm">
<INA237Subcircuit name="INA237" />
</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 SCL pin on the internal J1
connector inside the INA237 subcircuit:
import { INA237Subcircuit } from "@tsci/tscircuit.ti"
export default () => (
<board width="22mm" height="16mm">
<INA237Subcircuit name="INA237" />
<resistor
name="R11"
resistance="1k"
footprint="0402"
pcbX={7}
pcbY={-3}
connections={{
pin1: ".INA237 .J1 .SCL",
}}
/>
</board>
)
The selector ".INA237 .J1 .SCL" means:
.INA237selects the placedINA237subcircuit.J1selects the internal connector namedJ1.SCLselects theSCLpin on that connector
You can use the same pattern for other exported TI subcircuits and their
internal parts. For example, ".INA237 .U1 .VS" selects the VS pin on the
internal U1 chip.
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