Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The first concrete model-specific modules are:
used by Arduino CNC shields, with its 2x8 socket, motor outputs, control
inputs, power domains, and microstep pull-downs modeled explicitly.

Each component is a single `<chip />` backed entirely by a female `pinrow`
Each component is a single `<chip />` backed entirely by a female `headermodule`
footprinter string. Every exposed header pin has `pinAttributes`, including
GPIO behavior, internal pull support, I2C/SPI/UART capabilities, and explicit
power/ground direction and voltage where applicable.
Expand Down Expand Up @@ -73,7 +73,7 @@ supply bulk capacitor.

The XIAO component also provides `XIAO_PIN1` through `XIAO_PIN14` aliases for
Seeed's official header numbering. This keeps those numbers exact even though
the underlying generic pinrow footprinter has its own perimeter numbering.
the underlying `headermodule` footprinter has its own perimeter numbering.
All aliases are available in selectors; pass `showPinAliases` when you also
want them rendered inside the schematic symbol.

Expand All @@ -86,8 +86,7 @@ The A4988 geometry, power limits, and control behavior come from Pololu's

## Footprinter compatibility

Independent row spacing and sparse pin grids are implemented in footprinter's
main branch but are not yet present in its latest published package. This repo
temporarily carries the matching upstream patch so installs and builds use the
correct geometry immediately. The patch can be removed after those features
are included in a footprinter release consumed by tscircuit.
Independent row spacing, sparse pin grids, module outlines, literal silkscreen
labels, and pin-one markers are provided by `@tscircuit/footprinter` 0.0.409 or
newer. The package is pinned to that release so the `headermodule` geometry and
silkscreen output are generated by the published implementation.
1 change: 1 addition & 0 deletions __snapshots__/index.circuit-pcb.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions __snapshots__/index.circuit-schematic.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 27 additions & 21 deletions bun.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,27 @@ export * from "./lib/AdafruitFeatherSTM32F405Express"
export * from "./lib/AdafruitFeatherESP32V2"
export * from "./lib/AdafruitFeatherESP32S2"
export * from "./lib/AdafruitFeatherESP32S34MBFlash2MBPSRAM"
export * from "./lib/AdafruitFeatherESP32S3TFT"
export * from "./lib/AdafruitFeatherRP2040"
export * from "./lib/AdafruitFeatherRP2350"
export * from "./lib/AdafruitItsyBitsyESP32"
export * from "./lib/AdafruitItsyBitsyM0Express"
export * from "./lib/AdafruitItsyBitsyM4Express"
export * from "./lib/AdafruitItsyBitsyNRF52840Express"
export * from "./lib/AdafruitItsyBitsyRP2040"
export * from "./lib/AdafruitQTPyESP32S2"
export * from "./lib/AdafruitQTPyESP32S3"
export * from "./lib/AdafruitQTPyNRF52840"
export * from "./lib/AdafruitQTPyRP2350"
export * from "./lib/AdafruitQTPySAMD21"
export * from "./lib/ArduinoNano33BLE"
export * from "./lib/ArduinoNano33BLESenseRev2"
export * from "./lib/ArduinoNano33IoT"
export * from "./lib/ArduinoNanoATmega328P"
export * from "./lib/ArduinoNanoESP32"
export * from "./lib/ArduinoNanoEvery"
export * from "./lib/ArduinoNanoMatter"
export * from "./lib/ArduinoNanoRP2040Connect"
export * from "./lib/generatedModules"
export * from "./lib/PololuA4988StepperMotorDriverCarrier"
export * from "./lib/SeeedXiaoRP2040"
36 changes: 33 additions & 3 deletions lib/AdafruitFeatherESP32S2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ChipProps, PinAttributeMap } from "@tscircuit/props"

/** Adafruit ESP32-S2 Feather 12+16 female socket footprint. */
export const ADAFRUIT_FEATHER_ESP32_S2_FOOTPRINT =
"pinrow28_rows2_cols16_p2.54mm_py20.32mm_missing(1,2,3,4)_id1mm_od1.6mm_female_nopinlabels" as const
"headermodule28_rows2_cols16_p2.54mm_py20.32mm_missing(1,2,3,4)_id1mm_od1.6mm_female_silkscreenborder_silkscreenlabel(FEATHER ESP32-S2)" as const

export const ADAFRUIT_FEATHER_ESP32_S2_PIN_LABELS = {
// Short row, USB end to opposite end.
Expand All @@ -22,8 +22,8 @@ export const ADAFRUIT_FEATHER_ESP32_S2_PIN_LABELS = {
// Long row, USB end to opposite end. The final position is the board's
// debug UART TX connection rather than a general-purpose GPIO.
pin13: ["RST", "RESET"],
pin14: ["3V3", "3.3V"],
pin15: ["3V3_2", "3V3", "3.3V"],
pin14: ["3V3", "V3_3"],
pin15: ["3V3_2", "3V3", "V3_3"],
pin16: ["GND"],
pin17: ["A0", "GPIO18", "ADC2_CH7", "DAC_2"],
pin18: ["A1", "GPIO17", "ADC2_CH6", "DAC_1"],
Expand Down Expand Up @@ -260,6 +260,36 @@ export const AdafruitFeatherESP32S2 = (props: AdafruitFeatherESP32S2Props) => (
datasheetUrl="https://learn.adafruit.com/adafruit-esp32-s2-feather/pinouts"
footprint={ADAFRUIT_FEATHER_ESP32_S2_FOOTPRINT}
pinLabels={ADAFRUIT_FEATHER_ESP32_S2_PIN_LABELS}
pcbPinLabels={{
pin1: "BAT",
pin2: "EN",
pin3: "USB",
pin4: "D13",
pin5: "D12",
pin6: "D11",
pin7: "D10",
pin8: "D9",
pin9: "D6",
pin10: "D5",
pin11: "SCL",
pin12: "SDA",
pin13: "RST",
pin14: "3V3",
pin15: "3V3_2",
pin16: "GND",
pin17: "A0",
pin18: "A1",
pin19: "A2",
pin20: "A3",
pin21: "A4",
pin22: "A5",
pin23: "SCK",
pin24: "MOSI",
pin25: "MISO",
pin26: "RX",
pin27: "TX",
pin28: "DEBUG_TX",
}}
pinAttributes={ADAFRUIT_FEATHER_ESP32_S2_PIN_ATTRIBUTES}
schWidth={1.5}
schHeight={2.6}
Expand Down
36 changes: 33 additions & 3 deletions lib/AdafruitFeatherESP32S34MBFlash2MBPSRAM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ChipProps, PinAttributeMap } from "@tscircuit/props"

/** Adafruit ESP32-S3 Feather 4MB Flash / 2MB PSRAM 12+16 female socket. */
export const ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_FOOTPRINT =
"pinrow28_rows2_cols16_p2.54mm_py20.32mm_missing(1,2,3,4)_id1mm_od1.6mm_female_nopinlabels" as const
"headermodule28_rows2_cols16_p2.54mm_py20.32mm_missing(1,2,3,4)_id1mm_od1.6mm_female_silkscreenborder_silkscreenlabel(FEATHER ESP32-S3)" as const

export const ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_PIN_LABELS = {
// Short row, USB end to opposite end.
Expand All @@ -22,8 +22,8 @@ export const ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_PIN_LABELS = {
// Long row, USB end to opposite end. The final position is the board's
// debug UART TX connection rather than a general-purpose GPIO.
pin13: ["RST", "RESET"],
pin14: ["3V3", "3.3V"],
pin15: ["3V3_2", "3V3", "3.3V"],
pin14: ["3V3", "V3_3"],
pin15: ["3V3_2", "3V3", "V3_3"],
pin16: ["GND"],
pin17: ["A0", "GPIO18", "ADC2_CH7"],
pin18: ["A1", "GPIO17", "ADC2_CH6"],
Expand Down Expand Up @@ -262,6 +262,36 @@ export const AdafruitFeatherESP32S34MBFlash2MBPSRAM = (
datasheetUrl="https://learn.adafruit.com/adafruit-esp32-s3-feather/pinouts"
footprint={ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_FOOTPRINT}
pinLabels={ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_PIN_LABELS}
pcbPinLabels={{
pin1: "BAT",
pin2: "EN",
pin3: "USB",
pin4: "D13",
pin5: "D12",
pin6: "D11",
pin7: "D10",
pin8: "D9",
pin9: "D6",
pin10: "D5",
pin11: "SCL",
pin12: "SDA",
pin13: "RST",
pin14: "3V3",
pin15: "3V3_2",
pin16: "GND",
pin17: "A0",
pin18: "A1",
pin19: "A2",
pin20: "A3",
pin21: "A4",
pin22: "A5",
pin23: "SCK",
pin24: "MOSI",
pin25: "MISO",
pin26: "RX",
pin27: "TX",
pin28: "DEBUG_TX",
}}
pinAttributes={ADAFRUIT_FEATHER_ESP32_S3_4MB_FLASH_2MB_PSRAM_PIN_ATTRIBUTES}
schWidth={1.5}
schHeight={2.6}
Expand Down
206 changes: 206 additions & 0 deletions lib/AdafruitFeatherESP32S3TFT.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
import type { ChipProps, PinAttributeMap } from "@tscircuit/props"

/** Adafruit ESP32-S3 TFT Feather: the two populated Feather header rows. */
export const ADAFRUIT_FEATHER_ESP32_S3_TFT_FOOTPRINT =
"headermodule28_rows2_cols16_p2.54mm_py20.32mm_missing(1,2,3,4)_id1mm_od1.6mm_female_silkscreenborder_silkscreenlabel(FEATHER S3 TFT)" as const

export const ADAFRUIT_FEATHER_ESP32_S3_TFT_PIN_LABELS = {
pin1: ["VBAT"],
pin2: ["EN"],
pin3: ["VBUS"],
pin4: ["D13", "GPIO48"],
pin5: ["D12", "GPIO47"],
pin6: ["D11", "GPIO38"],
pin7: ["D10", "GPIO21"],
pin8: ["D9", "GPIO18"],
pin9: ["D6", "GPIO9"],
pin10: ["D5", "GPIO8"],
pin11: ["SCL", "GPIO4"],
pin12: ["SDA", "GPIO3"],
pin13: ["RESET", "RST"],
pin14: ["3V3", "V3_3"],
pin15: ["3V3_2", "V3_3"],
pin16: ["GND"],
pin17: ["A0"],
pin18: ["A1"],
pin19: ["A2"],
pin20: ["A3"],
pin21: ["A4"],
pin22: ["A5"],
pin23: ["SCK"],
pin24: ["MOSI"],
pin25: ["MISO"],
pin26: ["RX"],
pin27: ["TX"],
pin28: ["TXD0", "DEBUG_TX"],
} as const

const GPIO = {
isGpio: true,
includeInBoardPinout: true,
canUseInternalPullup: true,
canUseInternalPulldown: true,
canUseOpenDrain: true,
canUsePushPull: true,
} as const satisfies PinAttributeMap

const I2C_SCL = { ...GPIO, capabilities: ["i2c_scl"] } satisfies PinAttributeMap
const I2C_SDA = { ...GPIO, capabilities: ["i2c_sda"] } satisfies PinAttributeMap
const SPI_SCK = { ...GPIO, capabilities: ["spi_sck"] } satisfies PinAttributeMap
const SPI_MOSI = { ...GPIO, capabilities: ["spi_mosi"] } satisfies PinAttributeMap
const SPI_MISO = { ...GPIO, capabilities: ["spi_miso"] } satisfies PinAttributeMap
const UART_RX = { ...GPIO, capabilities: ["uart_rx"] } satisfies PinAttributeMap
const UART_TX = { ...GPIO, capabilities: ["uart_tx"] } satisfies PinAttributeMap

export const ADAFRUIT_FEATHER_ESP32_S3_TFT_PIN_ATTRIBUTES = {
VBAT: { providesPower: true, includeInBoardPinout: true },
EN: { includeInBoardPinout: true },
VBUS: {
requiresPower: true,
providesPower: true,
requiresVoltage: "5V",
providesVoltage: "5V",
includeInBoardPinout: true,
},
D13: GPIO,
D12: GPIO,
D11: GPIO,
D10: GPIO,
D9: GPIO,
D6: GPIO,
D5: GPIO,
SCL: I2C_SCL,
SDA: I2C_SDA,
RESET: { includeInBoardPinout: true },
"3V3": {
providesPower: true,
providesVoltage: "3.3V",
includeInBoardPinout: true,
},
"3V3_2": {
providesPower: true,
providesVoltage: "3.3V",
includeInBoardPinout: true,
},
GND: {
requiresGround: true,
providesGround: true,
includeInBoardPinout: true,
},
A0: GPIO,
A1: GPIO,
A2: GPIO,
A3: GPIO,
A4: GPIO,
A5: GPIO,
SCK: SPI_SCK,
MOSI: SPI_MOSI,
MISO: SPI_MISO,
RX: UART_RX,
TX: UART_TX,
TXD0: { capabilities: ["uart_tx"], includeInBoardPinout: true },
} as const satisfies Record<string, PinAttributeMap>

type FixedProps =
| "datasheetUrl"
| "displayName"
| "footprint"
| "manufacturerPartNumber"
| "mfn"
| "pinAttributes"
| "pinLabels"
| "schHeight"
| "schPinArrangement"
| "schWidth"

export type AdafruitFeatherESP32S3TFTProps = Omit<
ChipProps<typeof ADAFRUIT_FEATHER_ESP32_S3_TFT_PIN_LABELS>,
FixedProps
>

export const AdafruitFeatherESP32S3TFT = (
props: AdafruitFeatherESP32S3TFTProps,
) => (
<chip
{...props}
displayName="Adafruit Feather ESP32-S3 TFT"
mfn="Adafruit"
manufacturerPartNumber="5483"
datasheetUrl="https://learn.adafruit.com/adafruit-esp32-s3-tft-feather/pinouts"
footprint={ADAFRUIT_FEATHER_ESP32_S3_TFT_FOOTPRINT}
pinLabels={ADAFRUIT_FEATHER_ESP32_S3_TFT_PIN_LABELS}
pcbPinLabels={{
pin1: "VBAT",
pin2: "EN",
pin3: "VBUS",
pin4: "D13",
pin5: "D12",
pin6: "D11",
pin7: "D10",
pin8: "D9",
pin9: "D6",
pin10: "D5",
pin11: "SCL",
pin12: "SDA",
pin13: "RESET",
pin14: "3V3",
pin15: "3V3_2",
pin16: "GND",
pin17: "A0",
pin18: "A1",
pin19: "A2",
pin20: "A3",
pin21: "A4",
pin22: "A5",
pin23: "SCK",
pin24: "MOSI",
pin25: "MISO",
pin26: "RX",
pin27: "TX",
pin28: "TXD0",
}}
pinAttributes={ADAFRUIT_FEATHER_ESP32_S3_TFT_PIN_ATTRIBUTES}
schWidth={1.8}
schHeight={2.8}
schPinArrangement={{
leftSide: {
direction: "top-to-bottom",
pins: [
"RESET",
"3V3",
"3V3_2",
"GND",
"A0",
"A1",
"A2",
"A3",
"A4",
"A5",
"SCK",
"MOSI",
"MISO",
"RX",
"TX",
"TXD0",
],
},
rightSide: {
direction: "top-to-bottom",
pins: [
"VBAT",
"EN",
"VBUS",
"D13",
"D12",
"D11",
"D10",
"D9",
"D6",
"D5",
"SCL",
"SDA",
],
},
}}
/>
)
Loading